I was trying to send 4 paragraphs to a .swf element. I have no idea how to what to do. I tried using FlashVars but I feel like i need to drop in some actionscript to be able to work with the vars
conceptsNdisciplinesPar=(some text)&cultures&countriesPar=(some text) etc开发者_高级运维...
Is there an easy way to get access to this text in my .swf?
If you are successfully embedding the flash vars into your HTML embed, then yes, you can access those values from within the SWF:
for (var flashVar:String in stage.loaderInfo.parameters)
{
trace(flashVar+":"+stage.loaderInfo.parameters[flashVar]);
}
Note, you'll need a reference to the stage for this to work. It's usually always available, but I have sometimes run into situations where my SWF needs to listen for the Event.ADDED_TO_STAGE event before using the above code.
ExternalInterface.callBack;
is the best way to send data from html to .swf.
for more to know about externalInterface
click here.
精彩评论