Are you trying to see if the current frame of myThumb is 10, or the
current frame of the Main clip?
If you are looking at the current frame of the Main clip, then
e.target.currentFrame should be changed to this.currentFrame.
If these don't have 10 or more frames, then your code won't work. If
you need to have a check based on the number of times something is
called, e.g. the enterframe handler, then use a counter to increment
until it gets to your magic number then do something:
//class variable called counter.
private var counter:int = 0;
public function checkFrame(e:Event):void {
if (counter == 10) {
doTween();
counter = 0;
} else {
counter++;
}
}
beno - wrote:
OOPS! I spoke too soon!!
Here's the revised code:
package
{
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.easing.*;
public class Main2 extends MovieClip
{
//Import Library Assests
public var myThumb:CloseThumb;
public function Main2()
{
init();
}
public function init():void
{
theThumb();
}
public function doTween():void {
addChild(myThumb);
TweenMax.to(myThumb, .4, {shortRotation:{rotation:60},
ease:Back.easeOut,onComplete:onFinishTween});
}
//If you want to get rid of the thumb after the tween has finished, then add
the "onComplete handler above to point here...
public function onFinishTween():void {
removeChild(myThumb);
}
//Then in your theThumb function:
public function theThumb():void
{
myThumb = new CloseThumb();
myThumb.x = 365;
myThumb.y = 355;
myThumb.addEventListener(Event.ENTER_FRAME, checkFrame);
}
public function checkFrame(e:Event):void {
if (e.target.currentFrame == 10) {
doTween();
}
}
}
}
I still need to target the frame I want to use. Again, when I change the
value to anything other than 1, it fails. Please advise.
TIA,
beno
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders