Point

Code Actionscript 2.0

Frame action

createEmptyMovieClip("drawing", 1);
point(100, 100);
function point(px, py) {
drawing.beginFill(0xFFFFFF, 100);
drawing.moveTo(px, py);
drawing.lineTo(px + 1, py);
drawing.lineTo(px + 1, py + 1);
drawing.lineTo(px, py + 1);
drawing.endFill();
}

Code Actionscript 3.0

var drawing = new MovieClip(); drawing.graphics.lineStyle(0, 0x000000, 0); point(100, 100); this.addChild(drawing); function point(px:int, py:int) { drawing.graphics.beginFill(0xFFFFFF, 1); drawing.graphics.moveTo(px, py); drawing.graphics.lineTo(px + 1, py); drawing.graphics.lineTo(px + 1, py + 1); drawing.graphics.lineTo(px, py + 1); drawing.graphics.endFill(); }

Description

In Actionscript 2, there is no direct way of drawing pixels. In this workaround, a 1x1 pixel region is drawn, instead of a pixel. This script only draws a singular point. Can you see it?

related to: Pixel

Download

Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File


Share