A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: stubborn button

Hybrid View

  1. #1
    Member
    Join Date
    Nov 2003
    Posts
    54

    stubborn button

    hey,

    i need help... I'm making a fighting game where you can move only left and right. With the script that i am using, it tells "legs" to gotoandplay "walkf" when the right key is pressed. In there is a movieclip that shows the legs moving. Heres my script:

    onClipEvent (enterFrame) {
    if (Key.isDown(key.RIGHT)) {
    this._x = this._x+3;
    _root.Inuyasha.legs.gotoAndPlay(walkf);
    _root.Inuyasha.legs.f.gotoAndPlay(NextFrame);
    } else if (Key.isDown(key.LEFT)) {
    _root.Inuyasha.legs.gotoAndPlay(walkf);
    this._x = this._x-3;
    _root.Inuyasha.legs.b.gotoAndPlay(NextFrame);
    } else {
    _root.Inuyasha.legs.gotoAndPlay("normal");
    }
    }


    Sometimes when you press the right key, it goes foward but the legs (Movieclip in the frame "walkf") dont move. Can I somehow stop that from happening?


    Thx!
    Merry Christmas!
    01001001001000000111011101101001011011000110110000 10000001110100011000010110101101100101001000000110 11110111011001100101011100100010000001110100011010 00011010010111001100100000011100000110000101110100 01101000011001010110010001101001011000110010000001 1101110110111101110010011011000110010000100001

  2. #2
    Senior Member studioqtopia's Avatar
    Join Date
    Nov 2003
    Location
    California
    Posts
    582
    make sure you have quotes around the frame label.

    gotoAndPlay("walkf");

  3. #3
    Member
    Join Date
    Nov 2003
    Posts
    54
    Thx!
    01001001001000000111011101101001011011000110110000 10000001110100011000010110101101100101001000000110 11110111011001100101011100100010000001110100011010 00011010010111001100100000011100000110000101110100 01101000011001010110010001101001011000110010000001 1101110110111101110010011011000110010000100001

  4. #4
    Member
    Join Date
    Nov 2003
    Posts
    54
    wait...
    srry that just makes it worse... it shakes now instead of playing...
    01001001001000000111011101101001011011000110110000 10000001110100011000010110101101100101001000000110 11110111011001100101011100100010000001110100011010 00011010010111001100100000011100000110000101110100 01101000011001010110010001101001011000110010000001 1101110110111101110010011011000110010000100001

  5. #5
    Senior Member studioqtopia's Avatar
    Join Date
    Nov 2003
    Location
    California
    Posts
    582
    is it possible to post your fla...
    it's hard to determine the problem without seeing it.

    sean

  6. #6
    Member
    Join Date
    Nov 2003
    Posts
    54
    here
    Attached Files Attached Files
    01001001001000000111011101101001011011000110110000 10000001110100011000010110101101100101001000000110 11110111011001100101011100100010000001110100011010 00011010010111001100100000011100000110000101110100 01101000011001010110010001101001011000110010000001 1101110110111101110010011011000110010000100001

  7. #7
    Senior Member studioqtopia's Avatar
    Join Date
    Nov 2003
    Location
    California
    Posts
    582
    i deleted the key frame actions inside the walkf and walkb cauz the clip will automatically play. i gave the mc clips the instance name of walkf and walkb. changed the action gotoAndPlay("walkf"); to gotoAndStop("walkf");. removed the sub frame label walkf and walkb.
    can't think of anything else... take a look at it and let me know if you have any questions about what i did.

    merry xmas,
    sean
    Attached Files Attached Files

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