2 Replies Latest reply on Feb 3, 2011 1:02 AM by alvanh

    On clic execute action then go to url

    alvanh Level 1

      Hello

      I'm lloking for now something who look very simple but I cant solve it.

       

      I have a button. I have an interaction who said: On click go to page 2 and when the animation on gage 2 is done  go to URL

      Look so simple but it's not for me.

       

      What I tryed to do is to put an "set component state: state2 in the timeline after the page 2 animation and put a condidional in the mouse order "when in state2".

       

      I tryed to change any of the states in the mous action. "on mouse down" for exemple.

       

      I hope I'm clear

       

      thank you

       

      alex

        • 1. Re: On clic execute action then go to url
          Chris W. Griffith Adobe Community Professional

          If I understand correctly, you want the user to click a button, have a state to state transition occur THEN trigger a Go To Url action (I assume this is set as in a new window).

           

          I don't know of a what to do this completely with Flash Catalyst. You can apply several actions together, but they will executed at basically the same time, thus not giving you the desired effect. Unfortunately this is not something that you could use an Action Sequence on either.

           

          There is a solution, but it requires using Flash Builder and adding some ActionScript.

           

          Here is the outline of the solution:

          Import the Flash Catalyst project into Flash Builder (note if you are use 1.0 this is a one way trip)

          Locate the Main.mxml file in the Package Explorer and open it.

          Now locate the <s:transitions> section, then find <s:Transition fromState="Page1" toState="Page2"  (Page1 and Page2 should be the names of the states that you used in the project).

           

          The next line will be the tag that contains the set of transitions, <s:Parallel> for example. WIthin this tag add this attribute:

          effectEnd="effectEndHandler(event)"

           

          Now locate the <fx:Script> tag (toward the top of the file)

          just after the <![CDATA[

          add this:

          import mx.events.EffectEvent;

          then with the script block, add this function:

           

          protected function effectEndHandler(event:EffectEvent):void

          {

             navigateToURL( new URLRequest( encodeURI("http://adobe.com")), "_blank");

          }

           

          replace the actual url with the one you want. You will also need to locate the original navigateToUrl call and remove it. Otherwise, two new browser windows will open.

           

          I have attached the FlashBuilder FXP so you can reference the final version.

           

          Chris

          • 2. Re: On clic execute action then go to url
            alvanh Level 1

            Thank you for you help. Ididn't test yet if it's working here but I'm sure it will.

            But in a second time I can't understand why a so simple thing to do became so complex to do.

             

            bye

            alex