A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Button trouble

  1. #1
    Junior Member
    Join Date
    Oct 2006
    Posts
    25

    Button trouble

    I was wondering if someone could tell me how to properly set a button so that when it's clicked an instance of an image or movie loop plays and stays on screen. I've tried to figure it out myself but the most I can get is for the image to show up when the button is clicked, but as soon as the button is released it disappears. I also need to make it so that the instance can appear more than once at the same time if the button is clicked a second time, a third time, etc.

    I also need to trigger multiple instances at the same time when the button is clicked. And if it's not possible to do that or to duplicate the instance as the button is continuously pressed, should I just make multiple buttons for multiple instances or what?

    Any help would be much appreciated,
    Thank you,
    Art

  2. #2
    I'm not sure if I understand but how about this?
    1 Make a movie clip on your stage that does whatever you want.
    2 Make the first keyframe blank
    3 Add stop actions to the first and last frame of the movie
    4 Give the movie an instance name "movie1"
    5 Then on the stage add a button (not in the movieclip, on the same level)
    6 Add this script:

    on (press) {
    with (_root.movie1) {
    gotoAndPlay(2);
    }
    }

  3. #3
    Junior Member
    Join Date
    Oct 2006
    Posts
    25
    It didn't work. The movie instance appears on screen and for a split second (the first, blank, keyframe) it disappears then reappears and the button doesn't seem to be linked to it properly. Whenever I click it I get this message: Error: A 'with' action failed because the specified object did not exist.

    So the object is there but basically completely seperate from the button.

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