Flash 8 drawing tutorial

March 29, 2010

Actionscript 3.0 Tutorial

If you want to delete, press  Delete or Backspace key (on the keyboard).

Download source: drawing.zip

Step 1

  • Create a new flash document, press Ctrl+J on the keyboard (Document Properties)
  • Set Width to 350 and Height to 250px.
  • Set Frame rate  to 24fps (Frames per Second).

Step 2

  • Take the Line Tool (N), and draw a “pencil”, see fig 1.

Fig 1

Step 3

  • Select the “pencil” (Ctrl+A)
  • Press F8 on the keyboard (Convert to Symbol) to convert it into a Movie Clip, see fig 2.

Fig 2

Step 4

The new made Movie Clip (“pencil”) is still selected, open the Properties Panel (Ctrl+F3) and under <Instance Name> type pencil, see fig 3


Fig 3

Step 5

Last step, now click on the first frame, open the Action Script Panel (F9), and paste this script:

this.attachMovie(“cursor_id”, “cursor_mc”, this.getNextHighestDepth(),
{_x:_xmouse, _y:_ymouse});
Mouse.hide();
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
pencil._x = _xmouse;
pencil._y = _ymouse;
updateAfterEvent();
};

Mouse.addListener(mouseListener);

this.createEmptyMovieClip(“drawing_mc”, this.getNextHighestDepth());
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
this.drawing = true;
drawing_mc.moveTo(_xmouse, _ymouse);
drawing_mc.lineStyle(3, 0x99CC00, 100);
};

mouseListener.onMouseUp = function() {
this.drawing = false;
};

mouseListener.onMouseMove = function() {
if (this.drawing) {
drawing_mc.lineTo(_xmouse, _ymouse);
}
updateAfterEvent();
};

Mouse.addListener(mouseListener);

var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.DELETEKEY) || Key.isDown(Key.BACKSPACE)) {
drawing_mc.clear();
}
};

Key.addListener(keyListener);

, , , , , ,

Subscribe

Subscribe to our e-mail newsletter to receive updates.

5 Responses to “Flash 8 drawing tutorial”

  1. Web Design Doncaster Says:

    Love this tutorial it realy helped me get a better understanding

Trackbacks/Pingbacks

  1. 3D text in Illustrator | Tutorialicious.info - March 29, 2010

    [...] Flash 8 drawing tutorial | Flash tutorials | Flash video tutorials … [...]

  2. vi/vim Graphical Cheat Sheet & Tutorial | Tutorialicious.info - March 29, 2010

    [...] Flash 8 drawing tutorial | Flash tutorials | Flash video tutorials … [...]

  3.   Flash 8 drawing tutorial | Flash tutorials | Flash video tutorials … by Flash Designers - March 30, 2010

    [...] Read more:  Flash 8 drawing tutorial | Flash tutorials | Flash video tutorials … [...]

  4. I need help creating a website? | Host Rage - April 3, 2010

    [...] Flash 8 drawing tutorial | Flash tutorials | Flash video tutorials | Flash actionscript | flash anim… [...]

Leave a Reply