A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Simple button not working! Help

  1. #1
    Member
    Join Date
    May 2004
    Posts
    71

    Simple button not working! Help

    Alright: I have two layers, on the lower layer I have a simple circle with a heavy stroke. This circle is a movie clip set to flash on and off (first frame is the circle, next two frames are blank- when the clip loops it gives the effect that the circle is flashing on/off).

    On the layer above that, I have a button the size of the entire stage- with the circle cut out. I assigned up/over/hit/down keyframes for it, actionscript is:

    on (release) {
    gotoAndPlay(2);
    }

    So, essentially, because the button is on the layer above the flashing circle and it encompasses the entire stage- if you click anywhere on the stage it should take you to frame two. The button, however, isn't working. No matter where you click, it just continues to loop the movieclip- but the button is inactive. Why? Within flash, if I "enable simple buttons" and click the button it works as it should. But when the movie is previewed, I simply get the flashing circle, with my mouse flipping back and forth between the finger pointer (which is usually present when over a button) and the regular black arrow.

    Any ideas?

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try a different approach -
    make a button with stage size shape in HIT frame only
    place on stage in layer above circle movieclip
    give the button an instance name - btn_invisible
    add code to the main timeline -

    stop();
    btn_invisible.onRelease = function(){
    _root.gotoAndStop(2);
    }

    does this work for you ?

  3. #3
    Senior Member
    Join Date
    Jan 2006
    Posts
    137
    how long is your movie?
    Are you sure the layer with the invisible btn(the one that takes up the hole stage but the circle) is on every frame of your movie? seems to me like it's only in one frame...

  4. #4
    Member
    Join Date
    May 2004
    Posts
    71
    Quote Originally Posted by a_modified_dog
    try a different approach -
    make a button with stage size shape in HIT frame only
    place on stage in layer above circle movieclip
    give the button an instance name - btn_invisible
    add code to the main timeline -

    stop();
    btn_invisible.onRelease = function(){
    _root.gotoAndStop(2);
    }

    does this work for you ?
    Yep, that worked thanks.

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