sqDrag

(download)

DRAG the SQUARE anywhere on the stage.

deciided to practice variables and if statements.

var speed:Number = 5;
square.addEventListener(Event.ENTER_FRAME , sqAnimation);
function sqAnimation(event:Event):void{
    square.y = square.y + speed;
    square.x = square.x + 0.3;
   
    if (square.y > 350){
        speed = speed * -1;
    }
    if (square.y < 50){
        speed = speed * -1;
    }
}

square.addEventListener(MouseEvent.MOUSE_DOWN , sqPressed );
function sqPressed(event:MouseEvent):void{
    square.startDrag();
    square.removeEventListener(Event.ENTER_FRAME , sqAnimation);
}

square.addEventListener(MouseEvent.MOUSE_UP, sqReleased );
function sqReleased(event:MouseEvent):void{
    square.stopDrag();
    square.addEventListener(Event.ENTER_FRAME , sqAnimation);
}

click2z

(download)

CLICK the SQUARE until it disappears onto its z axis.

var myOrangeBox:MovieClip;
stage.addEventListener(MouseEvent.CLICK, boxMove, false, 0, true);
function boxMove(evt:MouseEvent):void {
    myBox.rotation += 10;
    myBox.rotationY += 15;
    myBox.x += 5;
    myBox.y -= 5;
    myBox.z += 50;
    myBox.alpha -= .045;
}

Mouse.hide();
addEventListener(Event.ENTER_FRAME, onLoop);
function onLoop(evt:Event):void {
    hand.x = mouseX;
    hand.y = mouseY;
}

sirius

(download)

DRAG the STAR over on the right hand side of the stage or on the MOON and back again.

The affect is that the star fades out when placed over on the right hand side of the stage or placed of the moon itself and when dragged back to the left hand side of the stage the star is bright again.

star.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
star.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
star.buttonMode = true;
function mouseDown(evt:MouseEvent):void {
    star.startDrag();
    star.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
}

function mouseUp(evt:MouseEvent):void {
    star.stopDrag();
    star.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
}

function mouseMove(evt:MouseEvent):void {
    if (star.x > moon.x) {
        star.alpha = 0.4;
    } else {
        star.alpha = 1;
    }
}

                   

addCirc

(download)

The purpose of this project was to add as many addChild to the stage. Although I've instructed the user to click the button "5X", the addChild can actually extend more than this but can't seem to make the addChild skip to the next row. Will have to work on this. Based on chapter 4.

btn.txt.mouseEnabled = false;
var inc:uint = 0;
stage.addEventListener(MouseEvent.CLICK, circAnim, false, 0, true);
function circAnim(evt:MouseEvent):void {
    var c:MovieClip = new AddCirc();
    c.y = 200 + inc
    c.x = 60 + inc * (c.width + 50);
    c.x = 55 + inc * (c.height + 50);
    addChildAt(c, 0);
    inc++;
}

snoBdr

(download)

 

HOW TO PLAY:

1) download the file to view full screen

2) click on screen with the mouse

3) use your ARROW KEYS to navigate the SNOW BOARDER towards the MOON but avoiding SNOW FLAKES

TO REPLAY:

just re-fresh your browser.

sorry, can't get my reset button to work-will try and fix it.