Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading an image dynamically 1

Status
Not open for further replies.

aamaker

Programmer
Jan 20, 2002
222
US
I have a variable on an ASP page and am able to pass it to flash just fine as a string (to test this I setup a dynamic text field and assigned it the variable I pass to flash - Logo)...

the logo string (i.e. McDonalds.jpg) shows up just fine.

Now, I have a group of client logos in a folder (/images/clientlogos/) and would like to dynamically load the jpg logo using something like:

var thelogo;
thelogo = "images/clientlogo/"&Logo;
_root.createEmptyMovieClip("logo_container", 2);
_root.logo_container.loadMovie(thelogo)
_root.logo_container._x = 200;
_root.logo_container._y = 100;


first question is will something like this work (Im using the above actionscript in another project and it loads external images just fine)

second is what is wrong with the above that is preventing it from working?

Thanks!
 
Your problem could be that the jpgs are saved in the wrong format (Flash can't load 'progressive' format jpgs - you can resave them out of Photoshop etc as 'standard/baseline optimised' which should work) or that you're calling the loadMovie script before the ASP script has returned the value for 'logo' and therefore there's nothing there to load.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top