Week 7: Flash Interactivity

Learning Intention

I will learn how to use an If Statement to control an object

Success Criteria

To understand how an If Statement works.

To an IF Statement in ActionScript

To use IF Statements to search for Key Down events and control an object (Angry Bird)

Introduction

Learn.code.org

https://www.youtube.com/watch?v=bQilo5ecSX4#t=77

IF Statement video
https://www.youtube.com/watch?v=m2Ux2PnJe6E

If statement game.
http://learn.code.org/s/1/level/15

Activities

Play / Build these games on Learn.Code.Org
http://learn.code.org/s/1/level/4 UP to 14. Skip some games.

Download and open this Flash Movie.

angrybirdTrial.fla

Copy and paste code to make angry bird go left/right up/down

_root.onEnterFrame = function() {

home.onRelease = function()  {
gotoAndStop(“home”);
};

if (Key.isDown(Key.RIGHT))  {
RightBird_MC._x = RightBird_MC._x + 3;
}
};

Challenge
Create an Angry Bird icon and movie and add a section of your Phone UI that plays Angry Bird.

Reflection

What did you learn today about IF Statements and coding in ActionScript?

 

Leave a Reply

Your email address will not be published. Required fields are marked *