I am extremely new to actionscript (or any code for that matter) and am having some trouble undertsanding why my code wont work. I am trying to create a small drawing application using BitmapData - there are no errors when I run the code but it doesn't do anything at all.
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
var canvas:BitmapData = new BitmapData(100, 100, false, 0x009900);
stage.addEventListener(MouseEvent.MOUSE_DOWN,draw)
function draw(){
canvas.setPixel(mouseX, mouseY, 0x000000);
}
Hopefully this isn't too silly of a question - but if someone can guide me through why this wouldn't work or give me a working example (would be even better) I would be very grateful