A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [MX04] going to menu

  1. #1
    Member
    Join Date
    May 2008
    Posts
    48

    [MX04] going to menu

    i made it so when you hit a fan you goto and stop and in the frames i made his head falling of then at the end i put goto and stop(1) (witch was the menu) but it just turns him alive so i need help please...

  2. #2
    Wait- what now? tidenburg's Avatar
    Join Date
    Dec 2005
    Posts
    1,471
    _root.gotoAndStop(1);

    At the moment I'm going to assume the code is in the movieclip. This means you're not refering to the main timeline. Adding _root points the swf in the right direction.

    So far your posts are very unspecific. Try adding more detail about where the code is perhaps? Also "Can someone help me?" is much politer than "I need help please", which isn't just assuming, it makes us seem like some kind of service

    Hope that works
    "I'd only told them the truth. Was that so selfish? Our integrity sells for so little, but it is all we really have. It is the very last inch of us, but within that inch, we are free."

  3. #3
    Member
    Join Date
    May 2008
    Posts
    48
    Originally Posted by askentoyou
    the code is

    onClipEvent (load) {
    yvel=0
    falling = false;
    dir = 1;
    gravity = 3;
    jumpamount = 20;
    x = _xscale;
    speed = 8;
    onfloor = true;
    facing = "right";
    function scroll() {

    gotoAndStop(2);
    if (!_root.bg.hitTest(_x-xvel-(_width/2), _y-40, true)) {
    if (facing == "left") {


    _x -= speed;

    }
    }
    if (!_root.bg.hitTest(_x+xvel+(_width/2), _y-40, true)) {
    if (facing == "right") {

    _x += speed;

    }
    }
    }
    }


    onClipEvent (enterFrame) {
    if (Key.isDown(Key.UP) and onfloor ) {
    jump = true;
    onfloor = false;
    yvel = -jumpamount;
    gotoAndStop(3);
    }

    if (Key.isDown(Key.LEFT)) {
    _xscale = -x;
    xvel = -speed;
    facing = "left";
    dir = 2;
    scroll();
    } else if (Key.isDown(Key.RIGHT)) {
    _xscale = x;
    xvel = speed;
    facing = "right";
    scroll();
    dir = 1;
    }


    _y += yvel;

    if (!_root.bg.hitTest(_x, _y+1, true)) {
    yvel += gravity;
    }
    while (_root.bg.hitTest(_x, _y+1, true)) {
    this._y -= 1;
    onfloor = true;
    yvel = 0;

    }
    if (!_root.bg.hitTest(_x, _y+5, true)) {
    onfloor = false;
    }

    }

    onClipEvent (enterFrame) {
    if (!Key.isDown(Key.LEFT) and !Key.isDown(Key.RIGHT) and onfloor) {
    this.gotoAndStop(1);
    }
    }
    onClipEvent (enterFrame) {
    if (this.hitTest(_root.fan)) {
    _root.gotoAndStop(3);
    }
    }

    now look at the fan hitest it goes to frame three which i edited in the

    charecter then i made a frame put the code stop(); and converted it in to a

    symbol that i called die then when the movie got to the end. i placed a code

    gotoAndStop(1); wich didnt realy work.and _root.GotoAndStop(1);and

    _root.man.GotoAndStop(1); man is the charecters instance name

    so i need some help by the experts please.
    Last edited by askentoyou; 06-07-2008 at 05:44 AM.

  4. #4
    Member
    Join Date
    May 2008
    Posts
    48
    it would mean alot if someone would help
    thank you alot.
    Last edited by askentoyou; 06-07-2008 at 05:45 AM.

  5. #5
    Member
    Join Date
    Jun 2007
    Posts
    67
    GotoAndStop should be gotoAndStop.
    when writing it in the actions panel it should turn into blue text if its right.

    eg:
    _root.gotoAndStop(1);
    _root.man.gotoAndStop(1);
    gotoAndStop(1);
    (Notice how the goto is not Goto).

    also if your trying to make the man movieclip goto frame 1, the second option will work (asuming you made his instance name man), and the 3rd will work if its placed within the man movieclips actions.

    EDIT: Im not quite following what bits of code are which, but if you have 2 onClipEvent(enterFrame)'s within the man on the same frame, the last one will overwrite the first im assuming.
    Last edited by ThrashBoy; 06-07-2008 at 07:03 AM.

  6. #6
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    So, all the code is on the man movie clip and the frame 3 is on the main timeline? Or is that frame inside "man" movie clip?

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