Skip to main content
Known Participant
June 14, 2013
Question

on release

  • June 14, 2013
  • 1 reply
  • 518 views

My script is not working from within a movie clip.... what should i do for this please help me...

my script is--

on(release){

    gotoAndPlay(5);

}

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
June 14, 2013

What is the script supposed to be doing that it is not doing - which timeline is supposed to go to frame 5 and play?

You should avoid placing code "on" objects and put it in the timeline instead.  The timeline version of the code would be...

objectName.onRelease = function(){

      gotoAndPlay(5);

}

where objectName is replaced with the instance name of whatever object is being clicked.

Known Participant
June 14, 2013

"statement must appear within on handler" error occurs

Ned Murphy
Legend
June 14, 2013

That indicates you are trying to place the code on the object.  The code I provided goes in the timeline where it is easier to find.  Select the frame in the timeline and enter the code in the Actions panel.

You should answer the questions I asked in case the code needs adjusting anyways.