Dear Forum I'm trying to find out how to efficiently scale both xscale and yscale with one tween instance. Is that possible? I'm picturing something like this: scTween:Tween = new Tween(targetClip, {"_xscale","_yscale"}, Regular.easeOut, 0, _targetScale, 0.5, true); Any insight appreciated. Thanks Stephan
No. The Tween Class accepts a property - passed as a string value - as an argument. Not an object. Fuse is an excellent choice as a third party solution by the way. But you can also write your own methods that use the Tween Class to build your own custom animations. Attached an example of a function (in a class) that will first animate a movieclip using the _x property of the provided movieclip and then moves the movieclip over the _y axis. /** * Animates a box, starting with the _x properties, * then animate _y properties (if provided). * Dispatches an event 'Drawn' when animation is completed. * * @param target_mc The mc that will be animated * @param props An object holding the properties that will be animated * @param func A function to pass to the Tween Class * @param xFinal Number, final width of the box * @param yFinal Number, final height of the box * @param xDelay Number, duration of the Tween * @param yDelay Number, duration of the Tween */ public function animateBoxOverX(target_mc:MovieClip, props:Object, func:Function, xFinal:Number, yFinal:Number, xDelay:Number, yDelay:Number):Void{ var thisObj:Box=this; var xTween:Object=new Tween(target_mc,props.xProp,func,props.xInit,xFinal,xDelay,true); if(props.yProp){ xTween.onMotionFinished=function():Void{ var yTween:Object=new Tween(target_mc,props.yProp,func,props.yInit,yFinal,yDelay,true); yTween.onMotionFinished=function():Void{ var evtObj:Object=new Object(); evtObj.target=thisObj; evtObj.mc=target_mc; evtObj.name=target_mc._name; evtObj.type="Drawn"; thisObj.dispatchEvent(evtObj); }; }; } else { xTween.onMotionFinished=function():Void{ var evtObj:Object=new Object(); evtObj.target=thisObj; evtObj.mc=target_mc; evtObj.name=target_mc._name; evtObj.type="Drawn"; thisObj.dispatchEvent(evtObj); }; } }
Hmmm?.I never tried to pass multiple properties in a Tween class like that. Then again I really don?t use Flash?s Tween class that often. In the past I have used Fuse Kit. If you install this plug-in you will be able to do such a thing you are asking. Use ZigoEngine; http://www.mosessupposes.com/Fuse/fuse2.0docs/index.html
Don't see what you're looking for? Try a search.
|