all groups > flash data integration > may 2007 >
You're in the

flash data integration

group:

Send data from html to flash action script


Send data from html to flash action script tedpottel
5/31/2007 10:54:17 PM
flash data integration: Hi,

I would like my flash to act differently depending on what html page it is on. Can I send information from html code to action script?
Re: Send data from html to flash action script srisumeet
6/13/2007 6:36:41 AM
Hi,

Yes you can, by using FLASHVARS. Refer the attached code for example. Also you
can use Javascript setVariable method of Flash object to set values in between
i.e. after the page has loaded, as in case of FLASHVARS these are sent to flash
just at the begining i.e. once SWF loads. In the attached exmple i've sent 2
variables to Flash one is 'username' and other is 'userId', thse will be
fetched inside flash movie as _root.username and _root.userId.

Note: I've added flashvars as PARAM and also as an attribute for EMBED tag
(used by Mozilla, NS etc)

Hope this helps.

Thanks,
Sumeet

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=7,0,19,0" width="550" height="400">
<param name="movie" value="test.swf" />
<param name="quality" value="high" />
<param name="flashvars" value="username=sumeet&userId=1" />
<embed src="test.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" flashvars="username=sumeet&userId=1"
width="550" height="400"></embed>
</object>
AddThis Social Bookmark Button