all groups > flash actionscript > november 2006 >
You're in the

flash actionscript

group:

Sometimes _currentframe returns "undefined"



Re: Sometimes _currentframe returns "undefined" SMB
11/9/2006 2:52:32 PM
flash actionscript:
[quoted text, click to view]

What action is causing the nearestOctet() function to be fired off?


Sometimes _currentframe returns "undefined" Timothy Hall
11/9/2006 9:14:04 PM
Here's an example of how I am using this..
I am calling a function "nearestOctet()" that begins with the following two
lines:
[Q]currentFrame = theMovie_mc._currentframe;
trace("On entering nearestOctet, the currentFrame is: "+currentFrame);[/Q]

Sometimes I call it and it returns a number, other times it does not.

Can anybody please tell me what might cause this?

Thanks.
Re: Sometimes _currentframe returns "undefined" Timothy Hall
11/9/2006 11:57:01 PM
Here's a couple of examples..

movieL_btn.onRelease = function () {
trace("Your pressed: movieL_btn");
currentFrame = nearestOctet();
playOctet(movieL_var, currentFrame);
}

p1_btn.onRelease = function () {
trace("Your pressed: p1_btn");
currentFrame = nearestOctet();
playOctet(p1_var, currentFrame);
}


There are two scenarios where the buttons might be used.
In one, the movie is stopped, and one of the buttons is pressed.
When this is the case the function call works fine.

In the other, the movie is playing.
When that is the case, pressing the button works the first time it is pressed,
but then (with the movie now stopped) it now fails.
Re: Sometimes _currentframe returns "undefined" Timothy Hall
11/10/2006 12:04:59 AM
Here's a link to the file; however it is not done yet and still has other
problems, but should give you a better idea of the context in which this issue
arises.

http://issues.swingthing.net/example.fla.zip
AddThis Social Bookmark Button