03.05.2013 Views

Tutorial: Jigsaw using ActionScript 3.0.

Tutorial: Jigsaw using ActionScript 3.0.

Tutorial: Jigsaw using ActionScript 3.0.

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Click on the actions layer and Window/Actions to open up the Actions panel. Write as<br />

the first line:<br />

import jigsaw.*;<br />

These are instructions to the Flash environment to import everything in the jigsaw<br />

package. Since there is only one thing, one class, the Piece class, this statement has the<br />

same effect as writing<br />

Import jigsaw.Piece;<br />

You will see later how to let Flash know where to find this package.<br />

The next part of the code is setting up the objects that hold the offset information and a<br />

reference to the movie clip instance. I haven't told you the specifics of Piece yet, but it<br />

will be available (in the jigsaw package). Here is my code for the lizard puzzle. The<br />

numbers here are the numbers you wrote down from the Info panel for each piece.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!