首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Flex 4:我可以在同一个平行中设置多个对象的动画吗?

Flex 4:我可以在同一个平行中设置多个对象的动画吗?
EN

Stack Overflow用户
提问于 2010-07-21 05:02:18
回答 1查看 1.1K关注 0票数 0

我有多个旋转的球,我想让它们一起动起来。这是我到目前为止所拥有的,但是当我使用parallel (spinning.play())时,什么也没有发生。

我哪里错了?

代码语言:javascript
运行
复制
<fx:Declarations>                       
    <fx:Vector id="kfP1" type="spark.effects.animation.MotionPath">
        <s:MotionPath property="baseColor">
            <s:interpolator>
                <s:HSBInterpolator />
            </s:interpolator>
            <s:Keyframe time="0" value="0x9F9B9B" />
            <s:Keyframe time="250" value="0xFFFFFF" />
            <s:Keyframe time="500" value="0x9F9B9B" />
        </s:MotionPath>         
    </fx:Vector>
    <fx:Vector id="kfP2" type="spark.effects.animation.MotionPath">
        <s:MotionPath property="baseColor">
            <s:interpolator>
                <s:HSBInterpolator />
            </s:interpolator>
            <s:Keyframe time="125" value="0x9F9B9B" />
            <s:Keyframe time="375" value="0xFFFFFF" />
            <s:Keyframe time="625" value="0x9F9B9B" />
        </s:MotionPath>         
    </fx:Vector>
    <fx:Vector id="kfP3" type="spark.effects.animation.MotionPath">
        <s:MotionPath property="baseColor">
            <s:interpolator>
                <s:HSBInterpolator />
            </s:interpolator>
            <s:Keyframe time="250" value="0x9F9B9B" />
            <s:Keyframe time="500" value="0xFFFFFF" />
            <s:Keyframe time="750" value="0x9F9B9B" />
        </s:MotionPath>         
    </fx:Vector>
    <fx:Vector id="kfP4" type="spark.effects.animation.MotionPath">
        <s:MotionPath property="baseColor">
            <s:interpolator>
                <s:HSBInterpolator />
            </s:interpolator>
            <s:Keyframe time="375" value="0x9F9B9B" />
            <s:Keyframe time="625" value="0xFFFFFF" />
            <s:Keyframe time="875" value="0x9F9B9B" />
        </s:MotionPath>         
    </fx:Vector>
    <fx:Vector id="kfP5" type="spark.effects.animation.MotionPath">
        <s:MotionPath property="baseColor">
            <s:interpolator>
                <s:HSBInterpolator />
            </s:interpolator>
            <s:Keyframe time="500" value="0x9F9B9B" />
            <s:Keyframe time="750" value="0xFFFFFF" />
            <s:Keyframe time="1000" value="0x9F9B9B" />
        </s:MotionPath>         
    </fx:Vector>
    <fx:Vector id="kfP6" type="spark.effects.animation.MotionPath">
        <s:MotionPath property="baseColor">
            <s:interpolator>
                <s:HSBInterpolator />
            </s:interpolator>
            <s:Keyframe time="625" value="0x9F9B9B" />
            <s:Keyframe time="875" value="0xFFFFFF" />
            <s:Keyframe time="1125" value="0x9F9B9B" />
        </s:MotionPath>         
    </fx:Vector>
    <fx:Vector id="kfP7" type="spark.effects.animation.MotionPath">
        <s:MotionPath property="baseColor">
            <s:interpolator>
                <s:HSBInterpolator />
            </s:interpolator>
            <s:Keyframe time="125" value="0x9E9A9A" />
            <s:Keyframe time="750" value="0x9F9B9B" />
            <s:Keyframe time="1000" value="0xFFFFFF" />
            <s:Keyframe time="1125" value="0xCECCCC" />
        </s:MotionPath>         
    </fx:Vector>
    <fx:Vector id="kfP8" type="spark.effects.animation.MotionPath">
        <s:MotionPath property="baseColor">
            <s:interpolator>
                <s:HSBInterpolator />
            </s:interpolator>
            <s:Keyframe time="0" value="0xFFFFFF" />
            <s:Keyframe time="125" value="0x9E9A9A" />
            <s:Keyframe time="875" value="0x9F9B9B" />
            <s:Keyframe time="1125" value="0xFFFBFB" />
        </s:MotionPath>         
    </fx:Vector>

    <s:Parallel id="spinning" repeatCount="0" duration="1125"  >
        <s:Animate id="animateP1" motionPaths="{kfP1}" target="{p1}"/>
        <s:Animate id="animateP2" motionPaths="{kfP2}" target="{p2}"/>
        <s:Animate id="animateP3" motionPaths="{kfP3}" target="{p3}"/>
        <s:Animate id="animateP4" motionPaths="{kfP4}" target="{p4}"/>
        <s:Animate id="animateP5" motionPaths="{kfP5}" target="{p5}"/>
        <s:Animate id="animateP6" motionPaths="{kfP6}" target="{p6}"/>
        <s:Animate id="animateP7" motionPaths="{kfP7}" target="{p7}"/>
        <s:Animate id="animateP8" motionPaths="{kfP8}" target="{p8}"/>
    </s:Parallel>
</fx:Declarations>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-07-21 19:15:53

查看Catalyst生成的并行格式(可以工作),看起来您需要这样做(未选中)

代码语言:javascript
运行
复制
<s:Parallel>
    <s:Parallel target = "{p1}">
        <s:Animate id="animateP1" motionPaths="{kfP1}"/>
   </s:Parallel>
    <s:Parallel target = "{p2}">
        <s:Animate id="animateP2" motionPaths="{kfP2}"/>
    </s:Parallel>
</s:Parallel>

对我来说,这看起来很奇怪,但这就是工具产生的结果!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3294330

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档