A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Simple goto and play question

  1. #1
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304

    Simple goto and play question

    I am trying to use the goto and play action. I want the goto and play at frame 2 but for some reason the error that I don't have it within and on handler. What am I doing wrong.. I am not sure what I am missing. I am using the actions pallet to do this. I have Flash MX 2004.. The error reads below.


    **Error** Scene=Scene 1, layer=black team button, frame=1:Line 2: Statement must appear within on handler
    gotoAndPlay(2);

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Apparently you want your action on a button, so you'd need the button's event handler.
    on (release) {
    _root.gotoAndPlay(2);
    }

    gparis

  3. #3
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    I have tried what you have sent.. and yes this is a button.. But it keeps saying the same error. ugghh

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    then you didn't put that code ON the button, but ON a frame

    You can also use the MX method, specifying the instance name of the button, and that will go ON a frame:

    _root.myButton.onRelease = function() {
    _root.gotoAndPlay(2);
    };

    gparis

  5. #5
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    I am a bonehead.. I did get it to work.. I appreciate all your help.. I totally was stumped.. Back in Flash 5 all you did was click on the action and add your frame number.. I like flash mx but sometimes seems more difficult..


    thanks again for your help...

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