Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving to nextScene or nextFrame

Status
Not open for further replies.

dipita

Programmer
Apr 7, 2005
22
US
Hi,
I have some code (in frame 1 of a scene) that iterates through a set of images (to scroll them) and when done, I want it to go to either the nextframe or next scene, but everytime I put the code to go to the next scene at the end, it doesn't do anything. I actually had this code from a guy who was working for me and wasn't able to complete it so I'm trying to finish the project but am a little lost (haven't done too much actionscripting..)

Here's the code snippet from frame 1 in scene one (there are some other layers that have other symbols and the mc for the family1...
Any help?
Thanks!

family1.setMask(mask);
letter.text = "Exquisite food";
letter.nXstart = 25;
var lett = letter;

family1.onEnterFrame = function() {
this._x -= 4;
if (this._x<mask._x-(this._width-mask._width)) {
this.onEnterFrame = function() {
this._alpha -= 10;
lett._visible=0;
if (this._alpha<0) {
this._visible = 0;
lett.removeMovieClip();
family1.removeMovieClip();
//delete this.onEnterFrame;
}
};
}
};
nextScene();
 
Thanks! I did put it in the innermost function and it seemed to work - I have a question though - I thought that when it comes out of the first function, then I could call nextScene - do you know why this doesn't work - does it never come out of that function unless you explicitly redirect it?

Thanks again!
 
nextScene() is usually used in conjunction with an event--whether it be a mouse event [on(press/release)] or clip events (enterFrame/load/keyDown).
In your case you need it on the onEnterFrame event.

Example:
Code:
on(press){
nextScene();
}

You could also use it in conditional statments:
Code:
if (x == y) {
    nextScene ();
}

 
ok. Thanks for the explanation (I come from a c, c++ background and am trying to do actionscript based on that experience :)- )

THANKS! You've helped me solve my problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top