dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Button inside a moive clip... Please help

  1. #1
    Member
    Join Date
    Apr 2002
    Posts
    56

    Smile

    Ok I have an intro scene and first thing that comes up in it a movie clip with a warning and the skip intro button, i just want to know how to make it so when i press the skip button in the moive clip to skip to scene 2 and play frame 1. Any help would be greatly appreciated.

    Thanks in advance

  2. #2
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    I dunno why but flash is very wierd about this...as it's very difficult to refer to the main timeline...and it's impossible to redirect to other scenes (directly)...
    I once tryed with a variable passing that communicated the target scene name to a function in the first frame of the first scene, so that it could work, but it wasn't prof.

    Anyway here is the trik:

    create a function a frame of the timeline where the movieclip with the button exists:
    Code:
    function redirect() {
        this.gotoAndStop("myScene", 1);
    }
    and then activate the function from the button (you can place the code directly in the same place as the previous code..)
    Code:
    myMovieClipLabel.myButtonLabe.onPress = function() {
        redirect();
    };
    if you are placing the code directly in the button actions you must compile it like this:
    Code:
    on(press) {
        _root.redirect();
    }
    hope this helps!

  3. #3
    Member
    Join Date
    Apr 2002
    Posts
    56
    Hey thanks alot man!!, i was going nuts trying to figure that out. I really appreciate you replying

  4. #4
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    this is the was this fantastic community works

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