Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Later
-
Adobe Flex SDK 4.1 (Release)
-
None
-
None
-
Affected OS(s): All OS Platforms
Affected OS(s): All OS Platforms
Browser: Internet Explorer 8.x
Language Found: English
Description
Steps to reproduce:
1. Run the app below
2. Press the test composite button
3. Then press the test single effect button
Actual Results:
When the composite effect ends, tracing the evt.effectInstance.target is null, however tracing the same property on a single effect prints out the fadebutton1
Expected Results:
effectInstance.target should point to fadeButton1.
It appears as if the createInstances method in CompositeEffect.as on line 246 is not creating a newInstance for each target similarly to Effect.as createInstances method
override public function createInstances(targets:Array = null):Array
{ if (!targets) targets = this.targets; childTargets = targets; var newInstance:IEffectInstance = createInstance(); <---- loses the target here, so its not passed to ParallelInstance constructor childTargets = null; return newInstance ? [ newInstance ] : []; }<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.events.EffectEvent;
protected function button1_clickHandler(event:MouseEvent):void
protected function doTheFades_effectEndHandler(evt:EffectEvent):void
{ // TODO Auto-generated method stub trace(evt.effectInstance); trace(evt.effectInstance.target); }protected function button2_clickHandler(event:MouseEvent):void
{ fadeOut.play([fadeButton1]); }protected function fadeOut_effectEndHandler(evt:EffectEvent):void
{ trace(evt.effectInstance); trace(evt.effectInstance.target); } ]]
>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<mx:Parallel id="doTheFades" duration="1500" effectEnd="doTheFades_effectEndHandler(event)">
<mx:Fade id="fadeOut" alphaFrom="1" alphaTo="0" effectEnd="fadeOut_effectEndHandler(event)"/>
<mx:Fade id="fadeIn" alphaFrom="0" alphaTo="1"/>
</mx:Parallel>
</fx:Declarations>
<s:HGroup>
<s:Button label="Fade Button" id="fadeButton1"/>
<s:Button label="Test Composite" click="button1_clickHandler(event)"/>
<s:Button label="Test Single Effect" click="button2_clickHandler(event)"/>
</s:HGroup>
</s:Application>