timeline to tween
- Started
- Last post
- 3 Responses
- jysta
I got some great help from things like gotoAndLearn etc, and have started using mctween and fuse. Thing is how do I go about tackling a load of "if/else" statements using this method. Because I used to label stop positions etc in all my movieclips involved e.g.
btn1.onRollOut = function():Void
{
if (anim1._currentframe != 16); {
anim1.gotoAndPlay = ("out");
}
}btn1.onPress = function():Void
{
if (anim2._currentframe != 1){
anim2.gotoAndPlay("out");
anim1.gotoAndStop("clicked");
}
}
But with the tweening I no longer have the labels or stop positions, how to I achieve the same effect. Forgive me if this sounds stupid but Im shit with code :-/
- coalson0
store them all in an array. then count through with a for loop.
- coalson0
oh sorry i did really read your post. So ... instead of calling the frame label call a function that does you animation.
- fyoucher10
if ur using mctween, why not just use frameTo() ?
btn1.onRollOver=function():Void {
this.frameTo(rolloverEndFrameNum... 0.4, "linear");
};btn1.onRollOut = function():Void {
this.frameTo(rolloverStartFrameN... 0.4, "linear");
////// or.... ///////
this.frameTo(this._totalframes, 0.4, "linear");
////// or.... ///////
this.frameTo(1, 0.4, "linear");
};