A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: using on(release) more than once in a movie/game

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    23

    Question using on(release) more than once in a movie/game

    Hello,

    I am making a game in Actionscript 2 where I need to open another "window" by pressing a button. The window is just a movie clip with some stuff on it, and a red X to "X" the window out.

    It all works out until I "X" out the window, and try to re-open it with the button.



    This is the actionscript code in my button:


    Code:
    on(release){
    	_root.window.gotoAndStop(2)
    }


    Thanks in advance!

  2. #2
    Senior Member
    Join Date
    Sep 2010
    Posts
    324
    First off I would suggest that you do not put any AS on any buttons. Give all the buttons an instance name and use that in the AS.
    Put all the ActionScript in an "Actions" layer in the main timeline. Address all the button actions there.
    Just remember that if you send the playhead to
    Code:
    gotoAndStop(2)
    you may need a new Key frame, Actions layer, with a new action, which will:
    Code:
    open_btn.onRelease = function() {
    	open window or whatever;
    }
    Video Man

  3. #3
    Junior Member
    Join Date
    May 2010
    Posts
    23

    resolved thanks

    thanks i didnt even think of putting the actionscript in the timeline

    i tried using a movieclip with the code too, but that had the same effect.

    thanks again!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center