Tuesday, 22 September 2009

the gotoAndPlay statment

Goto statement: To move from one scene to another or from one frame to another frame, Goto statement is used.


Example:
On (press)
{
Goto and play (5);
}

(Or) on (press)
{
Goto and stop (1);
}

We cannot have Goto statement alone in the script. It is always clubbed with Play or Stop statement.

PLAY & STOP

Using these actions, the movie can be played or stopped.

The play and stop are vital commands of action script. If we uncheck the play button, it automatically becomes stop. Goto, play and stop statements are always combined.

Play and stop statements can be added separately, but goto statement cannot be separated.


Example:

Like this, we can have script

On (press)
{
Play ( );
}
On (release)
{
Stop ( );
}



And not like this:

On (press)
{
Goto;
}

have fun!

No comments: