pulse00
10-05-2008, 01:43 PM
Hi,
i'm trying to write an image component that switches and old image with a newly loaded image using a move effect.
Not such a big task, but i'm having some problems understanding the Parallel effect.
When the new image is loaded, 2 move effects with each one having it's own target should start:
<mx:Parallel id="switcher" effectEnd="on_switch_end(event)" duration="300">
<mx:children>
<mx:Move xFrom="-100" xTo="0" target="new_image"/>
<mx:Move xFrom="0" xTo="100" target="old_image"/>
</mx:children>
</mx:Parallel>
<mx:Image id="new_image"
source="{model.image}" completeEffect="switcher"
width="100" height="100"
x="0" y="0">
</mx:Image>
<mx:Image id="old_image"
width="100" height="100"
x="0" y="0">
</mx:Image>
When the completeEffect of new_image is triggered, an error is thrown:
TypeError: Error #1006: value is not a function.
at mx.effects::EffectInstance/play()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ effects\EffectInstance.as:584]
by the target.dispatchEvent() line in the EffectInstance class:
public function play():void
{
playCount++;
dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
if (target)
{
target.dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
}
}
When i take out the parallel effect and simply trigger the 2 move effects manually, it works.
What i'm wondering, is it supposed to work having different effect targets in a parallel effect ?
i'm trying to write an image component that switches and old image with a newly loaded image using a move effect.
Not such a big task, but i'm having some problems understanding the Parallel effect.
When the new image is loaded, 2 move effects with each one having it's own target should start:
<mx:Parallel id="switcher" effectEnd="on_switch_end(event)" duration="300">
<mx:children>
<mx:Move xFrom="-100" xTo="0" target="new_image"/>
<mx:Move xFrom="0" xTo="100" target="old_image"/>
</mx:children>
</mx:Parallel>
<mx:Image id="new_image"
source="{model.image}" completeEffect="switcher"
width="100" height="100"
x="0" y="0">
</mx:Image>
<mx:Image id="old_image"
width="100" height="100"
x="0" y="0">
</mx:Image>
When the completeEffect of new_image is triggered, an error is thrown:
TypeError: Error #1006: value is not a function.
at mx.effects::EffectInstance/play()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ effects\EffectInstance.as:584]
by the target.dispatchEvent() line in the EffectInstance class:
public function play():void
{
playCount++;
dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
if (target)
{
target.dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
}
}
When i take out the parallel effect and simply trigger the 2 move effects manually, it works.
What i'm wondering, is it supposed to work having different effect targets in a parallel effect ?