Action script 101

8
Object Oriented Programming Action Script 3.0

description

A basic introduction to Action Script 3.0 for Adobe Flash Professional

Transcript of Action script 101

Page 1: Action script 101

Object Oriented Programming

Action Script 3.0

Page 2: Action script 101

Interactive wish list for our projectNavigating from scene to scene

Launching a website from a button

Sending an email

Peace on Earth

Page 3: Action script 101

function name of function ():void{    (reusable code block goes here)   }

FUNCTIONa task, such as navigating from scene to scene

Page 4: Action script 101

Events and Event Handlers

function name of function (event:MouseEvent):void{    (reusable code block goes here)   }

Page 5: Action script 101

Event listener

function name of function (event:MouseEvent):void{    (reusable code block goes here)   }instance name of button.addEventListener(MouseEvent.CLICK,name of function);

Page 6: Action script 101

Parameters

or specific instructions

function name of function (event:MouseEvent):void{        gotoAndStop (frame number, “name of Scene”)}

instancenameofButton.addEventListener(MouseEvent.CLICK, name of function);

Page 7: Action script 101

VariableName used for storage

var coh_request:URLRequest = new URLRequest (“http://www.cityofhenderson.com”);        function coh (event:MouseEvent):void{        navigateToURL(coh_request, “_blank”);}cohBTN.addEventListener(MouseEvent.CLICK, coh);

Page 8: Action script 101

var mail_request:URLRequest = new URLRequest(“mailto:[email protected]”);

function mail (event:MouseEvent):void{navigateToURL(mail_request, “_blank”);}

mailBTN.addEventListener(MouseEvent.CLICK, mail);