A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: gotoAndPlay isn't working

  1. #1
    Junior Member
    Join Date
    Mar 2004
    Posts
    6

    gotoAndPlay isn't working

    Using Flash MX... trying to nake different mcs play depending on what key you press... right now only the 1 and 2 keys are set up... when i tried this:

    onClipEvent (enterFrame) {
    if (Key.isDown(Key.getCode(49))) {
    Play();
    }
    }

    it played both the answer_1_hidden and answer_2_hidden clips, so i tried changing the code to target each movie clip specifically but it doesn't do anything now:

    onClipEvent (enterFrame) {
    if (Key.isDown(Key.getCode(49))) {
    _root.answer_1_hidden.gotoAndPlay();
    }
    }

    Any ideas?

    Thanks
    _DracoLord_
    Attached Files Attached Files

  2. #2
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    gotoAndPlay requires something to be passed to it in the brackets, either the number of the frame
    code:

    _root.answer_1_hidden.gotoAndPlay(2);



    or a frame label

    code:

    _root.answer_1_hidden.gotoAndPlay("start");


  3. #3
    Aasta La Vista Baby ashlaz's Avatar
    Join Date
    Mar 2002
    Location
    India
    Posts
    115
    Did this solve the problem?
    only stupid people look for logic in the chambers of the human heart

  4. #4
    Junior Member
    Join Date
    Mar 2004
    Posts
    6
    i tried adding frames and frame labels but both ways it plays both mcs, not just the one thats supposed to

    Thanks
    _DracoLord_

  5. #5
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    your code needs amending slightly
    code:

    if (Key.isDown(49)) {
    _root.answer_1_hidden.gotoAndPlay(2);
    }


  6. #6
    Junior Member
    Join Date
    Mar 2004
    Posts
    6
    works perfectly! thanks for the help!

    _DracoLord_

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