homepage Welcome to WebmasterWorld Guest from 54.227.215.139
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

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

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4021742 posted 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 :)

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved