A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [Help]Multiple instances of button won't work

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    20

    [Help]Multiple instances of button won't work

    I have a set of two buttons on frame 1. I am attempting to use the same set of buttons on frame 5. I copied the buttons with instance names from the first frame and placed them on the fifth frame, but they are not performing the designated actions. The buttons work fine on the first frame, so I know the buttons are functional. Can anyone offer any insight? Thank you.

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Post FLA file
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    20
    I am unable to post my fla because it is a work document and I can't upload files to an outside source. This is the code from the first frame though.

    stop();
    how_to_btn.addEventListener(MouseEvent.CLICK, onHowClick, false, 0, true);
    play_btn.addEventListener(MouseEvent.CLICK, onPlayClick, false, 0, true);


    function onHowClick(evt:MouseEvent):void {
    gotoAndPlay(2);
    }
    function onPlayClick(evt:MouseEvent):void {
    gotoAndPlay(3);
    }

    All of the other code is in external AS files. I have tried copying and pasting the buttons directly on to the stage, and even writing new functions, but it just does not seem to be working.

  4. #4
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Then simply make a new FLA file with a similar problem and post it here - because I can't seem to solve your problem!
    Last edited by Nig 13; 09-07-2011 at 10:10 AM.
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  5. #5
    Junior Member
    Join Date
    Aug 2011
    Posts
    20
    Actually, the issue is that the game I am working on keeps looping. Essentially the game is still playing when the triggers move to the new frames. I managed to get the timer stopped that made the enemies come down. Now I am working to get the bullets to stop firing when I click the mouse. I will be sure to post the results when I get there. Thanks for your response.

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