A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [RESOLVED] [F8] Button not working?

  1. #1
    Junior Member
    Join Date
    Mar 2007
    Posts
    27

    [RESOLVED] [F8] Button not working?

    For some reason, a button of mine that is on a seperate layer won't work. I turned it into a button, and added this code to it-

    on(press){
    gotoandStop(60);
    }

    When I roll-over the button, the cursor changes into a hand, as if it's a button, but when I click it, nothing happens.

    Thanks in advance to any help. =]

  2. #2
    Wait- what now? tidenburg's Avatar
    Join Date
    Dec 2005
    Posts
    1,471
    gotoAndStop
    you must capitalise the A

  3. #3
    Junior Member
    Join Date
    Mar 2007
    Posts
    27
    Oh.. it is capitilized, I just checked...

  4. #4
    Junior Member
    Join Date
    Jun 2007
    Posts
    9
    This code is on the button, correct? You are telling the button to go to frame 60 - is this correct?

    Try giving the button an instance name (such as forwardBtn), then using this code in a separate layer called ACTIONS (first frame):

    var forwardBtn:Button;

    forwardBtn.onPress = function():Void {
    gotoAndStop(60);
    }

  5. #5
    [Horse Thief] gotoAndCrash's Avatar
    Join Date
    May 2007
    Location
    NW, USA
    Posts
    576
    are you navigating to frame 60 on your _root, or inside the button?
    as in : _root.gotoAndStop(60);
    OR : this.gotoAndStop(60);
    1 Infinite Loop, Cupertino is a portal of Hell.

  6. #6
    Junior Member
    Join Date
    Mar 2007
    Posts
    27
    In the _root, gotoAndCrash.

  7. #7
    [Horse Thief] gotoAndCrash's Avatar
    Join Date
    May 2007
    Location
    NW, USA
    Posts
    576
    & using :

    on(press){
    _root.gotoAndStop(60);
    }

    doesn't work?
    1 Infinite Loop, Cupertino is a portal of Hell.

  8. #8
    Junior Member
    Join Date
    Mar 2007
    Posts
    27
    No, that isn't working. I've uploaded the .fla to my website, I can't get it to attach to this post, it's too large.

    http://www.tiffanydavisphotography.c...ertinytots.fla

    It's the "photographer" button on the "photographer" layer. It's the same as all the other buttons, so I can't figure out why it isn't working like all the rest.

  9. #9
    [Horse Thief] gotoAndCrash's Avatar
    Join Date
    May 2007
    Location
    NW, USA
    Posts
    576
    found it - your photography button is a button in a button in a button!
    so all you need to do is click on your photography button to select it & press (on a mac) command + B, which is Break Apart - whatever the equivelent is on a PC (if that's what you're on).
    So do Break Apart two times, not just once - twice.
    1 Infinite Loop, Cupertino is a portal of Hell.

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