469,623 Members | 1,800 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

load button states images from a folder!

Hi,
Is there a way in actionscript, to tell a specific button to load the image from a folder that exist in the same root of the flash file?

Let's say I have one button in flash that is called "Home".
and I have in the folder that is called "Images" three pictures: Home1.jpg(normal state) , Home2.jpg(over state), Home3.jpg(clicking state)

What i need to do is, when I change the layout of the buttons in photoshop and replace these images in the folder. I want these new buttons to automatically load when I play the flash file the next time instead of the old images.

Thanks,
Wassim
Aug 8 '07 #1
1 1924
xNephilimx
213 Expert 100+
That is not very usefull, you should try to make the buttons in flash or at least in vector a form, if you use a lot of bitmaps your movie will start to become unnecessarily heavy.
Also, that's the same as doing it in javacript, if you want to use images like that, don't use flash, that is wasting or misusing the capabilities of flash.

Anyway it's a rather simple task:

You should, inside a movieclip that will be the button, put three other movieclips (empty if you want) and then, in some function run only once when the movie loads, use the loadMovie method to load the images in the three correspondig movieclips, then hiding dinamically all of them and showing only the corresponding state (normal, over and down).
You could use only one movieclip inside the button movieclip and in each state, use the laod movie to load the corresponding image to the state, but depending onthe user's connection the images might take a while to load each time the user passes over the button.

As I said before, this is more a JavaScript work than a ActionScript one.
You should reconsider this.

Kind regards.
The_Nephilim

Hi,
Is there a way in actionscript, to tell a specific button to load the image from a folder that exist in the same root of the flash file?

Let's say I have one button in flash that is called "Home".
and I have in the folder that is called "Images" three pictures: Home1.jpg(normal state) , Home2.jpg(over state), Home3.jpg(clicking state)

What i need to do is, when I change the layout of the buttons in photoshop and replace these images in the folder. I want these new buttons to automatically load when I play the flash file the next time instead of the old images.

Thanks,
Wassim
Aug 9 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.