FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Help! Actionscript---loading an image





jayrelle
Can anyone help me how to write an action script? There is a button and when I click that button, an image will appear. The image is stored externally in one of the folders in the web..please can anyone teach me how to do it?...Thanks.... Very Happy
makli
You have to create an empty movieclip on your stage. Then you have to name the instance (e.g. "my_mc").

Let's say, that the name of your image is "myimage.jpg" and its position is in the same folder than your swf-file.

You have to attach the following code to your button:

on(press) {
_root.my_mc.loadMovie("./myimage.jpg");
}

After this code is executed, your image will appear in your empty movieclip you created in the first step.

HTH

Makli
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.