tags:

views:

389

answers:

1

I tried to pass the string to a flash movie just like in CS2 and it throws and error "access to undefined property imgSrc"

I want a dynamic image to be loaded onto the movie.

//vars
var myrequest:URLRequest=new URLRequest (imgSrc);
var myLoader:Loader = new Loader();

//load image into holder
myLoader.load(myrequest);

I'm passing imgSrc from an HTML file , it used to work on CS2.

+1  A: 

If you're using actionscript 3 your parameter imgSrc will can be accessed like this:

//vars
var myrequest:URLRequest=new URLRequest ( this.loaderInfo.parameters.imgSrc);
var myLoader:Loader = new Loader();

//load image into holder
myLoader.load(myrequest);

Also, please try to accept the previous answers you've been given on the site. There's a badge waiting for you! (and 15 reputation points for me)

grapefrukt
Thanks for your help, I accepted your answers.
Sergio Rodriguez