This is an automated email from the ASF dual-hosted git repository.

pushminakazi pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new dad3ccf  Update EffectInstance.as
dad3ccf is described below

commit dad3ccf9578afaf37a24a81274a72a3f175dc6b2
Author: pashminakazi <[email protected]>
AuthorDate: Mon Sep 21 19:44:02 2020 +0500

    Update EffectInstance.as
---
 .../src/main/royale/mx/effects/EffectInstance.as   | 87 ++++++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/effects/EffectInstance.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/effects/EffectInstance.as
index c5b1d12..3a95608 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/effects/EffectInstance.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/effects/EffectInstance.as
@@ -73,6 +73,28 @@ public class EffectInstance extends EventDispatcher 
implements IEffectInstance
 {
 /*     include "../core/Version.as";
  */
+ 
+ /**
+     *  @private
+     *  Internal flag remembering whether the user
+     *  explicitly specified a duration or not.
+     */
+    mx_internal var durationExplicitlySet:Boolean = false;
+
+    /**
+     *  @private
+     *  If this is a "hide" effect, the EffectManager sets this flag
+     *  as a reminder to hide the object when the effect finishes.
+     */
+    mx_internal var hideOnEffectEnd:Boolean = false;
+    
+    /**
+     *  @private
+     *  Pointer back to the CompositeEffect that created this instance.
+     *  Value is null if we are not the child of a CompositeEffect
+     */
+    mx_internal var parentCompositeEffectInstance:EffectInstance;
+    
     
//--------------------------------------------------------------------------
     //
     //  Constructor
@@ -244,6 +266,71 @@ public class EffectInstance extends EventDispatcher 
implements IEffectInstance
         
         //EffectManager.effectFinished(this);
     }
+    
+    //----------------------------------
+    //  triggerEvent
+    //----------------------------------
+    
+    /**
+     *  @private
+     *  Storage for the triggerEvent property. 
+     */
+    private var _triggerEvent:Event;
+
+    /**
+     *  @copy mx.effects.IEffectInstance#triggerEvent
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get triggerEvent():Event
+    {
+        return _triggerEvent;
+    }
+
+    /**
+     *  @private
+     */
+    public function set triggerEvent(value:Event):void
+    {
+        _triggerEvent = value;
+    }
+       
+       public function initEffect(event:Event):void
+    {
+        triggerEvent = event;
+        
+        switch (event.type)
+        {
+            case "resizeStart":
+            case "resizeEnd":
+            {
+                if (!durationExplicitlySet)
+                    duration = 250;
+                break;
+            }
+            
+            case FlexEvent.HIDE:
+            {
+                target.setVisible(true, true);
+                hideOnEffectEnd = true;     
+                // If somebody else shows us, then cancel the hide when the 
effect ends
+                target.addEventListener(FlexEvent.SHOW, eventHandler);      
+                break;
+            }
+        }
+    }
+       
+       mx_internal function eventHandler(event:Event):void
+    {
+        if (event.type == FlexEvent.SHOW && hideOnEffectEnd == true)
+        {
+            hideOnEffectEnd = false;
+            event.target.removeEventListener(FlexEvent.SHOW, eventHandler);
+        }
+    }
 
 }
 

Reply via email to