ActionScript Programming Help

Slides:



Advertisements
Similar presentations
Chapter 9 Interactive Multimedia Authoring with Flash Introduction to Programming 1.
Advertisements

Programming Languages and Paradigms
Conditional statements and Boolean expressions. The if-statement in Java (1) The if-statement is a conditional statement The statement is executed only.
Javascript Client-side scripting. Up to now  We've seen a little about how to control  content with HTML  presentation with CSS  Javascript is a language.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 5 Selection Statements Primitive Type boolean.
ASP.NET Programming with C# and SQL Server First Edition
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 5 Selection Statements Primitive Type boolean.
Chapter 9 Interactive Multimedia Authoring with Flash - Introduction to Programming “Computers and Creativity” Richard D. Webster, COSC 109 Instructor.
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Programming Languages and Paradigms Object-Oriented Programming.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
CISC474 - JavaScript 03/02/2011. Some Background… Great JavaScript Guides: –
An Overview of ActionScript The Powerful Scripting Language of Macromedia Flash.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
JavaScript, Fourth Edition
The Java Programming Language
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
Functions & Objects Flash ActionScript 3.0 Introduction to Thomas Lövgren, Flash developer
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Introduction to Java Java Translation Program Structure
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
JAVA Programming (Session 2) “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Introduction to Javascript. What is javascript?  The most popular web scripting language in the world  Used to produce rich thin client web applications.
Java and C# - Some Commonalities Compile into machine-independent, language- independent code which runs in a managed execution environment Garbage Collection.
PHP using MySQL Database for Web Development (part II)
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
>> Introduction to JavaScript
Chapter 10 Programming Fundamentals with JavaScript
The Machine Model Memory
“Under the hood”: Angry Birds Maze
Learning to Program D is for Digital.
Chapter 4 Client-Side Programming: the JavaScript Language
Java Primer 1: Types, Classes and Operators
Chapter 3: Using Methods, Classes, and Objects
CNIT 133 Interactive Web Pags – JavaScript and AJAX
Scope, Objects, Strings, Numbers
JavaScript Syntax and Semantics
PHP Introduction.
Expressions and Control Flow in JavaScript
JavaScript.
Primitive Types Vs. Reference Types, Strings, Enumerations
Chapter 19 JavaScript.
11/10/2018.
JavaScript and Ajax (Expression and Operators)
JavaScript an introduction.
Chapter 10 Programming Fundamentals with JavaScript
Chapter 3 Introduction to Classes, Objects Methods and Strings
Interface Programming 2 Week 1
PHP.
Sridhar Narayan Java Basics Sridhar Narayan
Intro to PHP.
JavaScript CS 4640 Programming Languages for Web Applications
Tutorial 10: Programming with javascript
PHP an introduction.
Chap 2. Identifiers, Keywords, and Types
CIS 136 Building Mobile Apps
CS3220 Web and Internet Programming JavaScript Basics
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

ActionScript Programming Help

Introduction ActionScript is an object-oriented programming language originally developed by Macromedia Inc. (now owned by Adobe Systems). It is a dialect of ECMAScript (meaning it is a superset of the syntax and semantics of the language more widely known as JavaScript), and is used primarily for the development of websites and software targeting the Adobe Flash Player platform, used on Web pages in the form of embedded SWF files.

Advantages of ActionScript ActionScript goes beyond the scripting capabilities of previous versions of ActionScript. It is designed to facilitate the creation of highly complex applications with large data sets and object oriented, reusable code bases. ActionScript is not required for content that runs in Adobe Flash Player, it opens the door to performance improvements that are only available with the AVM2, the new virtual machine.

Objects And Classes In ActionScript, every object is defined by a class. A class can be thought of as a template or a blueprint for a type of object. Class definitions can include variables and constants, which hold data values, and methods, which are functions that encapsulate behavior bound to the class. The values stored in properties can be primitive values or other objects. Primitive values are numbers, strings, or Boolean values. ActionScript contains a number of built-in classes that are part of the core language. Some of these built-in classes, such as Number, Boolean and String, represent the primitive values available in ActionScript. Others, such as the Array, Math, and XML classes, define more complex objects.

Variables Variables allow you to store values that use in your program. To declare a variable, you must use the var statement with the variable name. var i; To associate a variable with data type you must do so when you declare a variable without designating the variable’s type is legal, but will generate a compiler warning in strict mode. You designate a variable’s type by appending the variable name with a colon(;) followed by the variable’s type. var i:int;

Data types A data type defines a set of value. For example, the Boolean data type is the set of exactly two values: true and false. In addition to the Boolean data type, ActionScript defines several more commonly used data types, such as String, Number and Array. You can define your own data types by using classes or interfaces to define a custom set of values. All values in ActionScript 3.0, whether they are primitive or complex, are objects. A primitive value is a value that belongs to one of the following data types: Boolean, int, Number, String, and uint. Working with primitive values is usually faster than working with complex values, because ActionScript stores primitive values in a special way that makes memory and speed optimizations possible.

Syntax  The syntax of a language defines a set of rules that must be followed when writing executable code. Case sensitivity var num1:int; var Num1:int;  Dot syntax  Slash syntax 17 “hello” Null Undefined True False

Operators Operators are special functions that take one or more operands and return a value. An operand is a value—usually a literal, a variable, or an expression— that an op For example, in the following code, the addition(+) and multiplication(*) operators are used with three literal operands(2, 3 and 4) to return a value. This value is then used by the assignment(=) operator to assign the returned value, 14, to the variable sumNumber. var sumNumber:unit = 2+3*4; // unit=14 14, to the variable sumNumber.

Conditionals ActionScript provides three basic conditional statements that you can use to control program flow. if..else If(x>20) { Trace(“x is > 20”); } else { Trace(“x is <= 20”); }

if..else if If (x > 20) { trace(“x is > 20”); } else if (x < 0) { trace(“x is negative”); }

Switch var dayNum:uint = someDate.getDay(); switch(dayNum) { case 0: trace("Sunday"); break; { case 1: trace(“Monday"); break; { case 2: trace(“Tuesday"); break; default: trace("Out of range"); break; }

Functions Functions are blocks of code that carry out specific tasks and can be reused in your program. There are two types of functions in ActionScript 3.0: methods and function closures. Whether a function is a called a method or a function closure depends on the context in which the function is defined. A function is called a method if you define it as part of a class definition or attach it to an instance of an object. A function is called a function closure if it is defined in any other way. Functions have always been extremely important in ActionScript. In ActionScript for example, the class keyword did not exist, so “classes” were defined by constructor functions.

QUERY