Dot-to-Dot Puzzles
Step 1:
Create three layers. Call one layer Actions and the other layers Dots and Picture. Lock the dots and
Actions layers.
Step 2:
On the picture layer, draw out your shape. Lock the Picture layer when you are done.
Step 3:
Unlock the dots layer and click on frame 1 and paint on the dots using the paint brush tool and then
select the text tool and add your numbers.
Step 4:
Lock all the layers and then click on frame 1 of the actions layer.
Open the actions box and type in the following code:
_root.createEmptyMovieClip("myLine", 0);
_root.onMouseDown = function() {
myLine.moveTo(_xmouse, _ymouse);
myLine.lineStyle(2, 0xff0000, 100);
_root.onMouseMove = function() {
myLine.lineTo(_xmouse, _ymouse);
}
}
_root.onMouseUp = function() {
_root.onMouseMove = noLine;
}
Step 5:
Delete the picture layer.
Press CTRL+Enter to test your puzzle.
Then pen will draw a red line to join the dots.
Step 6:
To change the colour of the line you need to modify the code slightly.
Look for the bit of code that reads: myLine.lineStyle(2, 0xff0000, 100);
The bit of code you need to change is the colour code which, in this example, starts after 0x.
For example, the code for red lines is ff0000. Black lines are 000000.
If you want to know what your colour code is you can use the colour picker.
Select your colour using the main colour picker. Then use the slide bar to display the colour code.
Using the code from above you would change the code like this:
myLine.lineStyle(2, 0xff0000, 100);
changes to:
myLine.lineStyle(2, 0x 67C925, 100);