/ Published in: ActionScript 3
For almost every Flash project I present on the web, I use SWFObject and with version 2 out, it's easier than ever to pass variables. This is how I collect variables using Flash CS3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/************************************* This is how the SWF Object would look *************************************/ <script type="text/javascript" src="js/swfobject.js"></script> <script type="text/javascript"> var flashVars = { key: "AAA555XXXYYYZZZ", title: "This is my Title" }; var flashParams = { menu: "false"}; var flashID = { id : "swfContent" }; swfobject.embedSWF("main.swf", "swfContent", "550", "400", "9.0.0", "expressInstall.swf", flashVars, flashParams, flashID); </script> /************************************* Place this code in the Actions window of Flash CS3 *************************************/ var APP_ID:String = getFlashVars().key; var title:String = getFlashVars().title; function getFlashVars():Object { return Object( LoaderInfo( this.loaderInfo ).parameters ); }