- art382 [interactive_media] sp2013 -

instructor : ryanSmith

Week #10

* Take Attendance *

MONDAY

hour#1
more with conditional statements

FLASH :

Basic usage of the if conditional AS 3.0 :

Look at:
BrokenRecord.fla | updated version | download


Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player



"Try it once, and not much happens.
Try it again, and fail.
Keep trying, and keep failing.
Start over, and eventually you will succeed.
Then you do it again."

//the code on frame 1:

stop();
var i:int;
i=0;
trace("i is" + i)
//////////code for the button/////
BTN1.addEventListener(MouseEvent.CLICK,test);
function test(evt:Object):void{
if (i==0){
gotoAndStop(2);
}else{
gotoAndStop(10);
}
i=i+1;
trace(i);
if (i==5){
gotoAndStop(3);
}
if (i>=7){
gotoAndPlay("youWin");
}
}

 

hour#2
student presentations (in front of the class)

*look at students' Mode Diagrams & Project B

Project C Examples: Chicken | Robot | Pet Monster | Telekinetic Helmet | Rocket | Missile Turret | Study Animation


Wednesday

hour#1
Review for TEST

if (exp) { statements }

• "conditional" statement
• exp is an expression that returns true or false
• if the expression returns true, the statements in the brackets are performed.

if (Math.random()>.9) { gotoAndPlay(3); }

• "Math" is an "object"
–a collection of functions and variables

• "random" is a function attached to "Math"
–returns a number between 0 and 1

• .034754372, .73583728, .937862612 ...
–different number every time

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player


Download Target.fla

EXAMPLES : peggysirota.com | art.umbc.edu

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player


Download Random.fla


MAKE A MOVIE CLIP A BUTTON

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player


box.buttonMode=true;
box.addEventListener(MouseEvent.CLICK, clickHandler);
box.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
box.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);

function clickHandler(evt:Object):void {
trace("You just clicked me!");
}
function mouseOverHandler(evt:Object):void {
box.gotoAndPlay(2);
}
function mouseOutHandler(evt:Object):void {
box.gotoAndPlay(10);
}


hour#2
more student presentations
----------------------------------------------

VIDEOS:

October 2009 : New robotic hand 'can feel'

2011 : human-like robot invented by Japanese engineers

TED talk video: ted.com/talks/john_maeda
"how_art_technology_and_design_inform_creative_leaders.html"


review : Variables & Data Types


review : CHUNKS: intro animation... then a looping (or idle) animation... end with an exit animation
Look at "Chunky"
Look at "Chunky_2013"


Home Work :

-Get started on Project C
Work on the code, and finish the coding before you animate your project.
Use Frame Lables, text, basic shapes, buttons, and/or trace frunctions.
Get your variables and conditional statements to work!!

-study for TEST