我应该如何在平滑弯曲/ flashbuilder这两种状态之间的转换 [英] How should I smooth the transition between these two states in flex/flashbuilder

查看:134
本文介绍了我应该如何在平滑弯曲/ flashbuilder这两种状态之间的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在里面有两个国家的项目,最好的形容为开放式和封闭式的,他们是这样的:

I have an item in which has two states, best described as open and closed, and they look like this:

和我想要做的是为平滑的状态,而另一个,之间的过渡有效地以平稳的方式(正弦波)的两点之间进行插值来移动页脚/按钮块,然后消失在饼形图。

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.

不过,这显然超出了我和我的不能这样做了一个小时后,摔跤+我在这里张贴:D

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:

正文块是固定的高度(也许是使用了一些效果XBY变量?)始终。

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.

呵呵和正弦块上面定义的声明,就像&LT; S:正弦波ID =正弦波&GT;

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

感谢很多提前!

和灰度上道歉,但我真的不能决定一个配色方案。任何建议表示欢迎。

And apologies on greyscale, but I can't really decide on a colour scheme. Any suggestions welcome.

推荐答案

如果你不介意做一些动作的编码,这将成为pretty的易于使用的AS3的功能。

If you dont mind doing some actionscript coding, this becomes pretty easy with an as3 function.

您需要做到以下几点:

public function doTransition():void
        {
            var move:Move= new Move();
            move.target=footer;
            move.yFrom = 0;//current position
            move.yTo = 400;//or whatever is the final position of the footer
            move.duration=500;//duration in milliseconds

            var resize:Resize=new Resize();
            resize.target=body;
            resize.heightFrom=0;//or whatever is initial height
            resize.heightTo=400;//or whatver is the final height
            resize.duration=500;

            var fadeIn:Fade =new Fade();
            fadeIn.target = pieChart;//the id of the piechart
            fadeIn.alphaFrom =0;
            fadeIn.alphaTo = 1;
            fadeIn.duration =500;

            move.play();
            resize.play();
            fadeIn.play();
        }

这做,你将需要code旋转的饼图。 对于您可以使用定时器和旋转变换。

This done, you would need code to rotate the pie chart. For that you can use timers and rotation transformations.

这篇关于我应该如何在平滑弯曲/ flashbuilder这两种状态之间的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆