Groups | Blog | Home
all groups > flash actionscript > june 2005 >

flash actionscript : Can we use a variable on a loaded SWF?


vinco75
6/29/2005 9:58:26 PM
Hi there,

I'm wondering if the following is possible.

Let's say I have a master.swf where I load another SWF file called other.swf
for example.

On my master.swf, let's say I have a variable called var example:String =
"good";

Is it possible to use this variable on my loaded SWF file (ie. other.swf)?

Eventually the goal would be to define a set of colors on my master.swf that
my loaded SWF file would recognize, giving the user the ability to change all
colors of his website dynamically.

I know I could do it by saving it to an external XML file then retrieving the
info but I'm wondering if there's an easiest way to do so.

Thanks for your help!
Vincent
NSurveyor
6/29/2005 11:11:09 PM
Definitely possible. You can either load your swf and then define the variable.
For example, if you used: my_mc.loadMovie("other.swf");, and after it loads you
could then use: my_mc.example = "good". I think a better way to pass the
varialbe is through querty string. FOr example:
my_mc.loadMovie("other.swf?example=good");
AddThis Social Bookmark Button