TweenEvent.MOTION_FINISH & how can I get "next frame()" to work?


i started learning as3 other day , need help!!. i'm trying tween 2 movie clips @ same time , when finished, make them timeline move next frame. how do or make work!?!!?!? .

here current code:

import fl.transitions.tween;
import fl.transitions.easing.*;
import fl.transitions.tweenevent;

var mytween:tween = new tween(doorrightmc, "x", bounce.easeout, 500.7, 1001, 3, true);
var mytween2:tween = new tween(doorleftmc, "x", bounce.easeout, 24.2, -480, 3, true);
stop();

mytween.addeventlistener(tweenevent.motion_finish, handlereset);
function handlereset(e:tweenevent):void {
    e.target.nextframe();
}

please me out this! can't nextframe() function work .

thanks!!!


here error message:
error: error #1023: stack overflow occurred.
    @ fl.transitions::tween/getposition()
    @ fl.transitions::tween/update()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()
    @ intro4_fla::maintimeline/onfinish()
    @ flash.events::eventdispatcher/dispatcheventfunction()
    @ flash.events::eventdispatcher/dispatchevent()
    @ fl.transitions::tween/set time()
    @ fl.transitions::tween/nextframe()

i'm not sure how got error message, make sure you're publishing as3.

 

then use:

 


import fl.transitions.tween;
import fl.transitions.easing.*;
import fl.transitions.tweenevent;

var mytween:tween = new tween(doorrightmc, "x", bounce.easeout, 500.7, 1001, 3, true);
var mytween2:tween = new tween(doorleftmc, "x", bounce.easeout, 24.2, -480, 3, true);
stop();

var tl:movieclip = this;

mytween.addeventlistener(tweenevent.motion_finish, handlereset);
function handlereset(e:tweenevent):void {
    tl.nextframe();
}





More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino DUE ADC to DAC Piezo 30 Khz-100Khz

Indesign and MathType fonts