Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member paultechdocs's Avatar
    Join Date
    Feb 2010
    Location
    Barcelona
    Posts
    7
    Member #
    21251
    hey i just want to know,how can i do when i rollover a buton on cs4 to play a scene.
    i have this code from 2.0,but i dont know on 3.0.

    on (rollOver)
    {
    gotoAndPlay(1);
    }

    thank you

  2.  

  3. #2
    Junior Member
    Join Date
    Apr 2010
    Location
    Albany, Ny
    Posts
    2
    Member #
    21658
    you need to first name the button giving it an instance name in the poperties panel. So let's say its submit_btn. The code for a button in AS 3 is

    submit_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
    want the button to do here;
    }

    so basically you are listening for the click of submit_btn and then running a function called mouseDownHandler. Then after that line of code you action write out what the function mouseDownHandler will do when you click the button. Hope this helps!

    I believe that gotoAndPlay(); still works in AS3. So just stick that code between the curly brackets and change the name of the button to whatever you named your button in flash and it should jump to that frame.]

  4. #3
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    gotoAndPlay(1) will go to frame 1 of the current scene.

    gotoAndPlay("scene1") should play scene "scene1" (iirc).

  5. #4
    Junior Member System's Avatar
    Join Date
    Apr 2010
    Posts
    20
    Member #
    21778
    you need to first name the button giving it an instance name in the poperties panel. So let's say its submit_btn. The code for a button in AS 3 is

    submit_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
    want the button to do here;
    }
    Paultechdocs asked for a rollover, not the mouse down.
    So basically its the same code, except you change the MouseEvent to MOUSE_OVER

    Code:
    submit_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
    want the button to do here;
    }

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    true true... but odd user interaction to change a scene on mouseover....


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

actionscript 3 on rollover gotoandplay

,
flash click to go to scene and play
Click on a term to search for related topics.
All times are GMT -6. The time now is 07:49 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com