0

你好,我想在 flex 中使用 actionscript 在 UIcomponents 上应用补间动画。

我搜索了很多,但没有找到需要的有用帮助。

提前致谢。

4

2 回答 2

1

下面的代码为 actionscript 中的按钮创建移动补间。

单击屏幕上的任意位置会将按钮移动到该位置。

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" click="moveButton(event)">

    <mx:Script>
        <![CDATA[
            import mx.effects.Move;

            private function moveButton(event:MouseEvent):void {
                var myMove:Move = new Move();

                myMove.target = myButton;
                myMove.xTo = event.stageX;
                myMove.yTo = event.stageY;
                myMove.play();
            }
        ]]>
    </mx:Script>

    <mx:Button id="myButton" />

</mx:Application>

有关更高级的示例,您可以查看 Flex 文档:http://livedocs.adobe.com/flex/3/html/help.html?content=createeffects_3.html

它显示了如何扩展和使用 TweenEffect 类的示例创建自己的效果类。

于 2010-10-29T14:31:14.997 回答
0

Caurina Tweener:http ://code.google.com/p/tweener/

于 2010-11-05T10:27:44.610 回答