Groups | Blog | Home
all groups > flash (macromedia) > june 2004 >

flash (macromedia) : Listener and Tween class question



Allen Hung
6/30/2004 4:40:34 PM
Hi folks,
In MX2004, there is a undocumented class called tween(Please refer to
the following website for detail information:
http://www.actionscript.org/tutorials/advanced/Tween-Easing_Classes_Documented/index.shtml)
Now my question, is it possible to detect when the new tween object
finishing it's job by using the listener?

sample:

var plsTween = new mx.transitions.Tween(gg_mc, "_alpha",
mx.transitions.easing.None.easeNone, 0, 100, 10, false);
// this line will make the mc "gg_mc" alpha value from 0 to 100 in 10 frame
time using the special effect "easing.None.easeNone"
//Here I'd like to do something after above line code totally finished.


andrescobas
8/11/2004 11:50:13 AM

[quoted text, click to view]


Hi Allen.

Maybe a little bit late, but I hope this helps:

Use the addListener method of the Tween class to add a listener.

objTween = new mx.transitions.Tween(mc, "_y", easeType, begin
end, time, true);
objTween.addListener(myListener);


You can then add a funtion to objTween to process the event.

myListener.onMotionFinished = function(){
//Do stufff
}

This works fine.

There are other events available for the class, but I havn't teste
them.
Some are:

onMotionStarted
onMotionLooped
onMotionChanged
onMotionStopped
onMotionResumed

Greetings,

Andrés Coba


-
andrescoba
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message91951.htm
AddThis Social Bookmark Button