I am hoping someone might be able to help me out with the Sliding Menu tutorial by Pom.
What I’m trying to figure out here is how I would get a movie to load into a higher level only after coming to a complete stop at it’s new coordinates.
For example in the attached file if I were to click button number 3, is there a way to have a movie load into a higher level only after the background slides in and comes to a complete stop. Also if I were then to click button number 1, could make the movie already loaded into the higher level unload before sliding back to background number 1.
Here the movie clip coordinates are slowly set to the destination coordinates.
So when the movieclip reaches it’s destination coordinates at that time you need to load a movie.
In this case it’ll be
MovieClip.prototype.move = function ()
{
dest = _root.xnew;
pos = this._x;
vel = (dest - pos) / 7;
this._x += vel;
if(Math.ceil(this._x)==Math.ceil(dest))
{
//write here the code for loading the movie
}
};
However, this code is being executed continuously becuause it is written in onEnterFrame clip event.
You need to keep some flag which tells that a new movie has been loaded.
Otherwise this code will keep on loading the new movie.
Thank you very much for the help. I’m still a little confused though. I’ve attached the file again with the changes you recommended. As you said, the file continuously loads, I’m not sure where I would put the flag to stop it. I appreciate any more help you can offer with this.