ActiveDen

DrawField Class

DrawField Class scripted in AS3.

DrawField Class allows to create a drawboard application easily.

Features:

  • Draw or erase with mouse.
  • Clear all.
  • Line color.
  • Line size.
  • Background color.
  • Easy implementation.
  • Commented functions.

How to use:

  1. Import DrawField.
    e.g. import com.Utils.DrawField;
  2. Create the DrawField using new operator:
    var drawField:DrawField = new DrawField(W, H, backgroundColor, X, Y);
  3. Add to stage or any other parent
    stage.addChild(drawField);
  4. Add Mouse Events
    drawField.addEvents();

DrawField.as has only 7kb!

by
by
by
by
by