Flex 擦除状态转换?
我正在尝试在两种状态之间创建一个简单的擦除/滑动类型转换。 类似于 iPhone 从一个列表“滑动”到另一个列表(即收件箱 > 邮件列表)的方式,
我似乎无法弄清楚或找到如何使用 2 个简单的画布组件和其中一个滑动的转换来执行此操作的正确文档当另一个从右侧滑入时,它会从屏幕左侧滑出。
我已经使用以下代码获得了第二个状态“滑入”,但是如何修改以同时“滑出”第一个状态?
<mx:transitions>
<mx:Transition fromState="summaryState" toState="detailState">
<mx:Parallel target="{contentCanvas}">
<mx:WipeLeft duration="300"/>
</mx:Parallel>
</mx:Transition>
</mx:transitions>
提前致谢。
I'm trying to create a simple wipe / slide type transition between 2 states. Similiar to the way the iphone 'slides' from one list to another (ie. inbox > mail listing)
I can't seem to figure out or find correct documentation on how to do this using 2 simple canvas components and transitions where one slides off screen to the left as the other slides in from the right.
I've got the second state 'sliding in' with the following code, but how can I modify to simultaneously 'slide out' the first?
<mx:transitions>
<mx:Transition fromState="summaryState" toState="detailState">
<mx:Parallel target="{contentCanvas}">
<mx:WipeLeft duration="300"/>
</mx:Parallel>
</mx:Transition>
</mx:transitions>
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Adobe 网站 上,他们提到您应该使用并设置 'fromState ' 和 'toState' (您可以使用 '*' 来定义状态)。 我假设您的 2 个简单画布组件各自处于其自己的状态? 如果是的话一旦你设置了转场,就应该能够发挥出你的效果了。 链接站点还提到效果可以按顺序或并行播放,这可能需要获得您想要的效果。
编辑:
我做了一个小测试,这就是我想出的结果。 它似乎在我的测试中有效,因为两个画布都是动画的。 我假设您正在使用 setCurrentState("newState", true)。 我希望这就是您所要求的。
进一步编辑:
这也可能有用。 我认为您需要做的是,让两个画布都处于其中一种状态,然后执行它。 也许您需要稍微重新安排您的状态,以便两个画布都处于同一个状态,目前我假设您已将它们保持在不同的状态。
On Adobe's site, they mention you should use the and set the 'fromState' and 'toState' (you may use '*' to define the states). I'm assuming that your 2 simple canvas components are each in its own state? If so once you set the transition, it should be able to play out your effect. Also the linked site mentions that effects can be played in sequence or in parallel which may be needed to get the effect you want.
EDIT:
I did a small test and this was what I came up with. It seems to work in my tests as both canvas were animated. I'm assuming you are using setCurrentState("newState", true). I hope this is what you are asking for.
Further EDIT:
This may be useful as well. I think what you'll need to do is, have both canvas be in one of the state and then execute it. Perhaps you'll need to re-arrange your states a little so that both canvas are in the one state which at the moment I assume you have kept them in separate states.
公共函数 addTransitions():void
{
var 转换:Transition = new Transition();
var move:Move = new Move();
}
public function addTransitions():void
{
var transition:Transition = new Transition();
var move:Move = new Move();
}