2010-07-20 30 views
0

我有多個旋轉球,我想完全製作動畫。這是我迄今爲止的,但當我玩平行(spinning.play())時,沒有任何反應。Flex 4:我可以在同一個並行中爲多個對象設置動畫效果嗎?

我哪裏錯了?

<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> 

回答

0

望着並行該催化劑生產(工作)的格式,它看起來像你需要做這樣的事情(未選中)

<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

我使用了您的解決方案,但我也意識到,因爲我使用的路徑和填充需要將id {p1}移動到solidfill而不是路徑。一旦我這樣做,並改變屬性,然後「色」它的工作。謝謝! – Amy 2010-07-21 21:06:48

相關問題