xml 动画,

来源:互联网 发布:桂林广电网络营业厅 编辑:程序博客网 时间:2024/05/16 17:43

1.右击传统补间箭头,选择 将动画复制为actionscript3.0,输入实例名,例如myMc

2.从库中拖出元件,实例名称改为之前定义的,F9,粘贴即可。运行就有刚才的动画效果~

================================================================

第二种方法简历包,

package {
    import fl.motion.Animator;
    import flash.display.MovieClip;
    public class CloudFlow extends MovieClip {
        private var _cloud_xml:XML;/////新增
        private var _mCloud_Animation:Animator;///////新增
        public function CloudFlow(target:MovieClip) {///////传入参数
            _cloud_xml =  <Motion duration="30" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
            <source>
            <Source frameRate="24" x="77" y="53.45" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" instanceName="circle" symbolName="circle 副本">
            <dimensions>
            <geom:Rectangle left="0" top="0" width="82" height="82"/>
            </dimensions>
            <transformationPoint>
            <geom:Point x="0.5" y="0.5"/>
            </transformationPoint>
            </Source>
            </source>
            
            <Keyframe index="0" tweenSnap="true">
            <color>
            <Color alphaMultiplier="0"/>
            </color>
            <tweens>
            <SimpleEase ease="0"/>
            </tweens>
            </Keyframe>
            
            <Keyframe index="29">
            <color>
            <Color/>
            </color>
            </Keyframe>
            </Motion>;
            _mCloud_Animation = new Animator(_cloud_xml,target);//新增
            _mCloud_Animation.play();//play

        }
    }
}


将其保存在fla相同的目录,将舞台上的元件命名实例名称,在动作面板中:var myMc_animator:Animator = new Animator(myMc_xml, myMc);//myMc,舞台上新的不能与myMc_animation相同!

可以同时对多个元件执行,


原创粉丝点击