播放并行效果时出现问题
我无法播放由以下代码定义的并行效果:
var parallel:Parallel=new Parallel();
var E1:WipeDown=new WipeDown();
var E2:WipeLeft=new WipeLeft();
parallel.addChild(E2);
parallel.addChild(E1);
parallel.duration=2000;
parallel.target=this;
parallel.play();
在通过调用effect()函数播放效果时,仅播放效果E1。 如果代码是:
parallel.addChild(E1);
parallel.addChild(E2);
而不是:
parallel.addChild(E2);
parallel.addChild(E1);
那么只有效果 E2 正在播放。
总结一下,只有最上面的子效果正在播放。
任何人都可以提出解决方案吗...
<code>
<mx:Parallel target="{this}" id="wipeDownLeft" duration="2000">
<mx:WipeDown target="{this}" duration="2000"/>
<mx:WipeLeft target="{this}" duration="2000"/>
</code>
如果上面的代码不清楚,可以检查使用此应用程序(复制代码并运行) 代码
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768" xmlns:ns1="*">
<mx:Canvas id="C" creationComplete="{E.play()}" width="50%" height="50%" backgroundColor="#387C44">
</mx:Canvas>
<mx:Parallel id="E" duration="2000">
<mx:WipeLeft duration="2000" target="{C}"/>
<mx:WipeDown duration="2000" target="{C}"/>
</mx:Parallel>
<mx:Button click="E.play([C])" x="{C.width+10}" y="{C.height+10}">
</mx:Button>
</mx:Application>
I could not play the parallel effect which is defined by the following code:
var parallel:Parallel=new Parallel();
var E1:WipeDown=new WipeDown();
var E2:WipeLeft=new WipeLeft();
parallel.addChild(E2);
parallel.addChild(E1);
parallel.duration=2000;
parallel.target=this;
parallel.play();
On playin the effect by calling effect() function only the effect E1 is getting played.
If the code was:
parallel.addChild(E1);
parallel.addChild(E2);
instead of:
parallel.addChild(E2);
parallel.addChild(E1);
then only the effect E2 is getting played..
To summurize only the top most child effect is getting played..
Can any one plese suggest a solution...
<code>
<mx:Parallel target="{this}" id="wipeDownLeft" duration="2000">
<mx:WipeDown target="{this}" duration="2000"/>
<mx:WipeLeft target="{this}" duration="2000"/>
</code>
If above code is not clear one can check with this application(copy the code and run)code
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768" xmlns:ns1="*">
<mx:Canvas id="C" creationComplete="{E.play()}" width="50%" height="50%" backgroundColor="#387C44">
</mx:Canvas>
<mx:Parallel id="E" duration="2000">
<mx:WipeLeft duration="2000" target="{C}"/>
<mx:WipeDown duration="2000" target="{C}"/>
</mx:Parallel>
<mx:Button click="E.play([C])" x="{C.width+10}" y="{C.height+10}">
</mx:Button>
</mx:Application>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许尝试为每个子效果设置目标属性?
长时间这样做可能不会有什么坏处...
我只在 mxml 中使用了效果,这就是我总是这样做的(与文档示例相同?) - 事实上甚至已经完成了您在这里尝试的双重擦除,但不是在 AS 中...
[编辑] - 我看不到你的 mxml,除非进入编辑模式,但我无法提交编辑 - 使用其上的代码标签...
但同样,为孩子指定目标和持续时间,而不是指定孩子的目标和持续时间平行线...
Maybe try setting the target property for each of the child effects instead?
Probably wouldnt hurt to do this for duration either...
I have only used effects in mxml, and this it how ive always done it (same with the doc examples?) - in fact have even done the dual wipe you are trying here, but not in AS...
[Edit] - I cannot see your mxml unlessI go into edit mode, but i cannot submit edits - use the code tags on it...
but same again, specify target and duration for the children not the parallel...
我认为,原因在于,WipeLeft 和 WipeDown 是互斥的效果。但必须并行执行。如果你将 a 替换为 ,那么它就会起作用。或者,如果您将 WipeLeft(或 WipeDown)效果替换为其他效果,例如。 ,那么它也会起作用。
I think, the reason that, WipeLeft and WipeDown are mutually exclusive effects. But must performed in parallel. if you replace a to the , then it will be work. Or if you replace WipeLeft (or WipeDown) effect to some other effect, f.ex. , then it will be work too.