//Circle
var mc2:MovieClip= new MovieClip();
mc2.graphics.beginFill (0xFF3399FF);
mc2.graphics.drawCircle(0,0,100);
mc2.graphics.endFill();
mc2.x=100;
mc2.y=100;
addChild(mc2);
//Square
var mc:MovieClip= new MovieClip();
mc.graphics.beginFill (0xFF999999);
mc.graphics.drawRect(-25,-25,200,100);
mc.graphics.endFill();
mc.x=60;
mc.y=60;
addChild(mc);
//Drag and Drop
mc.addEventListener(MouseEvent.MOUSE_DOWN, pickupObject);
mc.addEventListener(MouseEvent.MOUSE_UP, dropObject);
mc2.addEventListener(MouseEvent.MOUSE_DOWN, pickupObject);
mc2.addEventListener(MouseEvent.MOUSE_UP, dropObject);
function pickupObject(event:MouseEvent):void {
event.target.startDrag(true);
}
function dropObject(event:MouseEvent):void {
event.target.stopDrag();
}
//Import image
var ym:YourMum = new YourMum(100,100);
var myImage:Bitmap = new Bitmap(ym);
addChild(myImage);
setChildIndex(myImage,0);
//Scale down
//myImage.scaleX = 0.5;
//myImage.scaleY = 0.5;
//Import MovieClip
var Tt:Test = new Test;
addChild(Tt);
- Just something we did today.
No comments:
Post a Comment