How do I dynamically change variables

0 views
Skip to first unread message

paulswansea

unread,
Jul 23, 2008, 7:16:07 AM7/23/08
to SWFObject
I'm looking for a way to dynamically change variables within a flash
file for loading images based on what javascript sends to it,
currently i'm testing by using the following in a loop triggered at a
specific time :

var flashvars = {
imagename: imagelist[curImage].smlsrc,
imagemsg: imagetext[curImage]
};
var params = {};
var attributes = {};
swfobject.embedSWF("flash/header.swf", "topbarimage", "900", "150",
"8.0.0", "swfobject/expressInstall.swf", flashvars, params,
attributes);

it consists of the image location, and some text to go with that
image, but because i'm embedding a new object every time, the whole
flash object flickers as it's reloaded, which i dont want, i'd just
like to pass it a new image name, and image message when needed, but
without embedding a new swf every time, just passing variables to the
current one, can you help please!?

Aran Rhee

unread,
Jul 23, 2008, 8:12:39 AM7/23/08
to swfo...@googlegroups.com
So you will want to use Flash's built in ExternalInterface class which
allows browser < > flash communication. Baically you can use javascript to
call flash methods (e.g. call a method on flash called loadPic() and pass it
your new location) or have flash call a js method on your page.

There are plenty of tutorials on EI, and if you search the lists, there
should be some good info too.

Cheers,
Aran

Reply all
Reply to author
Forward
0 new messages