You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2019/10/25 05:14:31 UTC

[GitHub] [royale-asjs] aharui commented on issue #485: StatesWithTransitionsImpl : When 2 components should have transition only one is triggerred (source file attached)

aharui commented on issue #485: StatesWithTransitionsImpl : When 2 components should have transition only one is triggerred (source file attached)
URL: https://github.com/apache/royale-asjs/issues/485#issuecomment-546203811
 
 
   There might still be a separate issue with transitions on objects that are being removed from the state.
   
   This version more easily shows that two transitions are now running.
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   
   <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" 
                   xmlns="*"
                   pageTitle="RoyaleStore">
   
       <fx:Script>
           <![CDATA[   
               import org.apache.royale.core.ValuesManager;
   
   
               private function headHome():void
               {
                       if ( myview.currentState == "HomeState") return;
                       myview.currentState = "HomeState";
               }
   
               private function headProducts():void
               {
                       if ( myview.currentState == "ProductState") return;
                       myview.currentState = "ProductState";                    
               }
   
               private function ev_stateChangeComplete():void
               {
                   trace ("currentState:" + myview.currentState);
               }
   
   
   
           ]]>
       </fx:Script>
   
       <fx:Style source="main.css"/>
   
       <js:valuesImpl>
           <js:SimpleCSSValuesImpl />
       </js:valuesImpl>
       <js:beads>
           <js:ApplicationDataBinding />
       </js:beads>
   
       <js:initialView>
           <js:View  localId="myview"  stateChangeComplete="ev_stateChangeComplete()">
   
               <js:beads>
                   <js:VerticalLayout />
                   <!-- if you comment out this section and comment <fx:Style source="main.css"/> then it isn't working -->
                       <!--  <core:StatesWithTransitionsImpl/>
                       <utils:EffectTimer/>-->
               </js:beads>
   
               <js:states>
                   <js:State name="HomeState"  />
                   <js:State name="ProductState"  />
               </js:states>
   
               <js:transitions>
                   <js:Transition fromState="HomeState" toState="*">
                       <js:Fade target="homeView" alphaFrom="1" alphaTo="0.2" duration="1000" />
                   </js:Transition>
                   <js:Transition fromState="*" toState="HomeState">
                        <js:Fade target="homeView" alphaFrom="0.2" alphaTo="1" duration="1000" />
                   </js:Transition>
                   <js:Transition fromState="ProductState" toState="*">
                       <js:Fade target="productView" alphaFrom="1" alphaTo="0.2" duration="1000" />
                   </js:Transition>
                   <js:Transition fromState="*" toState="ProductState">
                       <js:Fade target="productView" alphaFrom="0.2" alphaTo="1" duration="1000" />
                   </js:Transition>
               </js:transitions>
   
   
               <js:Group>
                   <js:beads>
                       <js:HorizontalLayout />
                   </js:beads>
                   <js:TextButton text="Home" click="headHome()" />
                   <js:TextButton text="Products" click="headProducts()"/>
               </js:Group>
   
               <js:Group>
                    <js:Label id="productView" text="productView" alpha.ProductState="1" alpha.HomeState="0.2"  />
                    <js:Label id="homeView" text="homeView" alpha.HomeState="1" alpha.ProductState="0.2" />
               </js:Group>
   
           </js:View>        
       </js:initialView>    
   </js:Application>
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services