| Using Flashvars to pass in an image file I can replace text, but now I'd like to replace/add an image |
HelenDev

msg:4021744 | 4:42 pm on Nov 9, 2009 (gmt 0) | I have a flash movie with a text field which has an instance name of
theText
and I have an actions layer thus
if(root.loaderInfo.parameters["dText"] != null) theText.text = root.loaderInfo.parameters["dText"];
and then in the html code I have
<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> var flashvars = {}; flashvars.dText = "here is some text"; var params = {}; params.menu = "false"; params.scale = "noscale"; var attributes = {}; swfobject.embedSWF("multiple_vars.swf", "flashDiv", "550", "400", "8.0.0", "expressInstall.swf", flashvars, params, attributes); </script>
This all works fine. But now I also want to pass in an image file and I'm not sure how to go about it. I can put
flashvars.picFile = "my_pic%2Ejpg";
into the html, but how do I do the bit in Flash? My image doesn't seem to have an instance name the same as the text does, and should it be a straight image, or a graphic, button or movie symbol? Any guidance would be much appreciated :)
|
|