all groups > flash actionscript > january 2007 >
You're in the

flash actionscript

group:

Looping problem!!


Looping problem!! Newbie1234
1/20/2007 6:00:37 PM
flash actionscript:
Within a movieclip, I have code that says something like this:

this.onEnterFrame = function(){
if (this is true and this is true{
gotoAndPlay ("play")


delete this.onEnterFrame;

}

}

This works fine. BUT when I add an else if statement within this function, the
system doesnt read the first if statement and so it doesnt read the else if
statement too.

Any ideas why this is, and how to get around doing this? I just want the
movieclip to keep playing and playing until it doesnt satisfy the iff statements


Re: Looping problem!! Newbie1234
1/20/2007 6:08:23 PM
Re: Looping problem!! Shan-Dysigns
1/20/2007 8:18:29 PM
Re: Looping problem!! Newbie1234
1/20/2007 8:49:41 PM
No, it isnt on the main timeline. this is all within a movieclip.

I have played around with the code, the weirdest thing though is that it only
seems to be reading the first line of my if statement and not the 2nd line.
Code looks like this now:


this.onEnterFrame = function () {

if (_global.1POSITION == "start" && _global.2POSITION == "2" &&
_global.3POSITION!= "3") {
trace ("work 1")


delete this.onEnterFrame

}else if (_global.1POSITION == "1" && _global.2POSITION == "2" &&
_global.3POSITION == "3") {
trace ("work")


delete this.onEnterFrame
}
}




Re: Looping problem!! Shan-Dysigns
1/20/2007 11:25:25 PM
AddThis Social Bookmark Button