A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Button action

  1. #1
    Senior Member
    Join Date
    Oct 2002
    Location
    Norway
    Posts
    126

    Button action

    I have made a movie. In frame 91 (instace name: News) I have added a MC. When pressing a button on the main stage I want it to start playing frame 91.

    I have used the following actions:

    on (release) {
    gotoAndPlay(News,91);
    }

    The problem is that is wont start playing frame 91. Do u see anything wrong?
    Last edited by CoReX; 12-19-2002 at 02:32 PM.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    on (release) {
    News.gotoAndPlay(91);
    }

    Its better and safer to use framelabels.

    on (release) {
    News.gotoAndPlay("myFrameLabel");
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Senior Member
    Join Date
    Oct 2002
    Location
    Norway
    Posts
    126
    I cant get it to work. Does it matter if the buttons is in a MC?

    Made a layer called Menu. In this layer I got two frames called
    Home(frame 90) and News(frame 91). When pressing the button I what it to jump one frame forward at play the MC that's in it.
    Last edited by CoReX; 12-19-2002 at 03:01 PM.

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Makes a huge difference. If button is in a MC you have to reference the _root .

    So in your main timeline at frame 91, theres an MC.

    Should be as simple as.. (if button is in a MC).

    on (release) {
    _root.gotoAndPlay(91);
    }

    If there isnt a Stop action in the MC it should start to play automatically.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Senior Member
    Join Date
    Oct 2002
    Location
    Norway
    Posts
    126
    U shouldn't know how to make this effect?

    http://www.flashkit.com/movies/Effec...7876/index.php

    I could need a tutorial..

  6. #6
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Shure its simple.(rather).

    You make a movieclip with all your images inside .
    Put this code ON the movieclip.

    onClipEvent (enterFrame) {
    var speed = 8;
    var viscosity = 1.5;
    xpos = _root.xpos;
    //X Pos
    difference = xpos-this._x;
    xvelocity = (xvelocity+(difference)/speed)/viscosity;
    this._x += xvelocity;
    }

    Now on your buttons just put a xpos variable that tells the MC where to scroll.

    on(release){
    xpos=350;
    }

    Try it and youll soon get hang of it.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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