Joann
Joann

Reputation: 21

Load external images in Flash using javascript?

I have created a flash movie that loads external pngs using this as2 code:

photo1.loadMovie("flashimages/photo1.png");

My client wants me to use javascript so they can edit the file location. Is this possible?

Be gentle! I am not very familiar with javascript :)

Thanks!

Upvotes: 2

Views: 210

Answers (1)

mgraph
mgraph

Reputation: 15338

no need to use javascript, just flashVars will be enough in your embed code :

<param name="flashVars" value="imgPath=flashimages/photo1.png"/>
<embed movie="" flashVars="imgPath=flashimages/photo1.png"....></embed>

then in flash get the imgPath from the embed code :

photo1.loadMovie(_root.imgPath);

Upvotes: 1

Related Questions