Hi
New to flash but not to programming. Need help on two things:
If i need to load movie clips from library onto the stage one after the other. How do i make the second clip load only after the first stops playing. The main time line i have has only one frame.
I need to make a movie clip on stage fade away using action script. I tried to use a loop to decrement the alpha value but flash discards the script saying that it would make the system unstable (it really does) . Any solutions or work arounds??
thanks in advance
use onEnterFrame actions:
//attachcode
_root.attachclip1.onEnterFrame = function() {
this._alpha -= 10;
if(this._alpha <= 0) {
//attach second clip
this.removeMovieClip();
}
}
Hopefully thats helps
Thanks
it works for two movie clips with fixed names. What if i want to go through a list of movies in the library (jpeg images stored as movie clips ) and make them appear and fade one by one? The main timeline is one frame so is the movie:) how do i keep running the piece of code above every time a new movie loads. I guess i can if i put some code in the first frame of every movie but i would like to avoid that
i = 0;
function makeClip() {
init = new Object(); //creates a new blank object for the initiating actions
init._x = 300; //desired x position
init._y = 300; //desired y position
init.onEnterFrame = function() { //inits onEnterFrame action
this._alpha -= 10;
if(this._alpha <= 0) {
_root.i++;
_root.makeClip(); //create another movieclip
this.removeMovieClip();
}
}
_root.attachMovie("clip"+_root.i, "clip"+_root.i, _root.getNextHighestDepth(), init); //attach clip using init object so movie clip initiates with parameters specified ini init object
}
makeClip();
This will use a function to attach a clip with name clip+i where i is a number to make the clip name unique, so have the linkage name of your clips clip+i and increment i in the order you want the images displayed. Once the _alpha of the clip equals 0 it increments the i variable so the next clip loaded is different, runs the makeClip function again, creating another clip, and then removes itself. Hope that makes sense.