Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Using Flashvars to pass in an image file

I can replace text, but now I'd like to replace/add an image

4:42 pm on Nov 9, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 28, 2003
votes: 0

I have a flash movie with a text field which has an instance name of


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);

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 :)


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members