我有一个项目有两种状态,最好描述为打开和关闭,它们看起来像这样:
和
< img src="https://i.sstatic.net/HvtxC.png" alt="open">
我想做的是通过在两种状态之间进行插值来平滑一种状态和另一种状态之间的过渡以平滑的方式(正弦)移动页脚/按钮块,然后在饼图中淡入淡出。
然而,这显然超出了我的能力范围,在与我无法做到这一点搏斗了一个小时之后,我将其发布在这里:D
因此,我的转换块如下所示
<s:transitions>
<s:Transition id="TrayTrans" fromState="*" toState="*">
<s:Sequence>
<s:Move duration="400" target="{footer}" interpolator="{Sine}"/>
<s:Fade duration="300" targets="{body}"/>
</s:Sequence>
</s:Transition>
<s:Transition>
<s:Rotate duration="3000" />
</s:Transition>
</s:transitions>
,其中 {body}
指的是饼图, {footer}
指页脚/按钮块。
然而,这不起作用,所以我真的不知道该怎么做...
可能有益的附加信息:
主体块始终具有固定高度(也许在某些效果中用于 Xby 变量?)。
它需要在两个方向上发挥作用。
哦,Sine
块在上面的声明中定义为
。
此外!我将如何使用这些转换块将饼图设置为连续旋转? (这会在没有标签的情况下发生)或者这是错误的处理方式,因为它本身不是一个过渡?
我想要的效果是,在选择下面的按钮之前,饼图在没有标签的情况下缓慢旋转,但在选择时旋转停止并出现标签...
提前非常感谢!
对灰度表示歉意,但我无法真正决定配色方案。欢迎任何建议。
I have an item in which has two states, best described as open and closed, and they look like this:
and
And what I'd like to do is is smooth the transition between one state and the other, effectively by interpolating between the two points in a smooth manner (sine) to move the footer/button-block and then fade in the pie chart.
However this is apparently beyond me and after wrestling with my inability to do so for an hour+ I'm posting it here :D
So my transition block looks as follows
<s:transitions>
<s:Transition id="TrayTrans" fromState="*" toState="*">
<s:Sequence>
<s:Move duration="400" target="{footer}" interpolator="{Sine}"/>
<s:Fade duration="300" targets="{body}"/>
</s:Sequence>
</s:Transition>
<s:Transition>
<s:Rotate duration="3000" />
</s:Transition>
</s:transitions>
where {body}
refers to the pie chart and {footer}
refers to the footer/button-block.
However this doesn't work so I don't really know what to do...
Additional information which may be beneficial:
The body block is always of fixed height (perhaps of use for the Xby variables in some effects?).
It needs to work in both directions.
Oh and the Sine
block is defined above in declarations just as <s:Sine id="Sine">
.
Additionally! How would I go about setting the pie chart to rotate continually using these transition blocks? (this would occur without the labels on) Or is that the wrong way to go about it as it's not a transition as such?
The effect I'm after is one where the pie chart rotates slowly without labels prior to a selection of a button below, but on selection the rotation stops and labels appear...
Thanks a lot in advance!
And apologies on greyscale, but I can't really decide on a colour scheme. Any suggestions welcome.
发布评论
评论(2)
如果您不介意进行一些动作脚本编码,那么使用 as3 函数这将变得非常容易。
您需要执行以下操作:
完成此操作后,您将需要代码来旋转饼图。
为此,您可以使用计时器和旋转变换。
If you dont mind doing some actionscript coding, this becomes pretty easy with an as3 function.
You would need to do the following:
This done, you would need code to rotate the pie chart.
For that you can use timers and rotation transformations.
为了使补间更容易,我建议使用 TweenLite 来完成这项工作。您最终会编写更少的动作脚本。
To make your tweening easier, I'd recommend using TweenLite to get the job done. You'll end up writing less actionscript.