This content has been marked as final. Show 7 replies
1. your backgrounds should all be movieclips.
2. you should assign a linkage id to each background movieclip
3. when a link is clicked use a variable to store the name of the (next) background movieclip that will be faded-in (when the previous is faded-out).
4. start a loop that fades the current background when a button is clicked. again use a variable to store a reference to the current background movieclip.
3.5 this usually comes after the above step but pertains to something you should do before the above: clear the above loop before starting it.
5. when the above fade completes, assign the variable that contains the current background movieclip to the next background movieclip and start the fade-in of the next background movieclip.
6. terminate your loop when fade-in is complete.
you need to learn how to use the LoadMovieClip Class. I am into loading and fading external pics too and Had too much trouble trying to coordinate everything with onEnterFrame / delete onEnterFrame / gotoAnd....
when working with objects (a hurdle in itself) you will find this stuff much easier to handle. I can't remember the good tutorials, but there's a few out there on google.
pubchum, what makes you think he's loading anything?
Thanks for pointing me in the right direction. I ended up ditching the fade out, and just went with fading the backgrounds in. I used a single movieclip's timeline to house each background fading in and then used action script to code the buttons like so:
Now I have to figure out if I can use my variable currBackground with other pieces of the animation. This way, I'll be able to change the color of the about button for example to let the user know that they're on the about page.
Any thoughts? I'm not sure this was the best way to code it, but it sure seemed like the easiest. I wasn't too sure how to go about using the loop.
if you want to code all the color changes in one location you can use the watch() function to detect changes to currBackground and color the old value the default (not viewed page) and color the new value the whatever to indicate the viewed page.
or just add the code to each button.
So, if I use a variable within one movie clip container, is it accessible within other movie clips or the main fla timeline? Do I have to declare the variable as global somehow?
the variable, as used above with no prefix, will be available within all the other onRelase handlers that are defined on the same timeline.
if you prefix with _global, the variable will be available on all timelines in the same _level.
if you prefix with var, the variable will only be defined locally in that onRelease handler. (which would be of no use to you in this situation.)