Presentation is loading. Please wait.

Presentation is loading. Please wait.

Datatypes, Variables, Constants Flash Class. What Does ActionScript Do? Automates Examples: – Tells animation what to do button is clicked – Turn off.

Similar presentations


Presentation on theme: "Datatypes, Variables, Constants Flash Class. What Does ActionScript Do? Automates Examples: – Tells animation what to do button is clicked – Turn off."— Presentation transcript:

1 Datatypes, Variables, Constants Flash Class

2 What Does ActionScript Do? Automates Examples: – Tells animation what to do button is clicked – Turn off sound Designer “scripts” different parts of the animation Examples: tell the animation to load a Web page upon clicking a link

3

4 Building Blocks Flash Flash animations made up of: – Drawings – Text – Frames (hold drawings, text) – Timelines (hold frames) ActionScript 3 ActionScript made up of: – Numbers – Strings Building blocks for more complicated data containers

5 ActionScript Building Blocks Numbers Strings Arrays

6 Numbers Numbers are an important data-building block So important there are three types: – number – int (integer) – uint (unsigned integer)

7 Review Terms Integer: in computer science, an integer is used to refer to a data type which represents some finite subset of the mathematical integers. These are also known as integral data types. In programming languages a data type is an attribute of a datum which tells the computer (and the programmer) something about the kind of datum it is. This involves setting constraints on the datum, such as what values it can take and what operations may be performed upon it. Common data types may include: integers, floating-point numbers (decimals), and alphanumeric strings.

8 Numbers: Number In ActionScript, a number can be any type of number, including fractions Example: 2.5

9 int The int datatype can represent any number from -2,147,483,648 to 2,147,483,648 It cannot represent fractions. Use Number.

10 uint Unsigned integer Can represent numbers from 0 to 4,294,967,295 Use if you need a negative number Useful when identifying colors, especially since colors are always positive whole numbers

11 Using Operators Examples of Operators + - * / > < >= Examples of Operators <= == != = See Operators at Adobe.Operators For more.more.

12 Strings Strings are sequential lists of letters, numbers, and symbols. Identify strings by placing them inside single or double quotes. Example: myCar + “Stutz Bearcat”

13 Strings and Operators Can’t do math with strings Concatenation (looks like string addition) Example: carModel = “Stutz” + “ “ + “Bearcat”;

14 Differences in Equality Operator (==) and Assignment Operator (=) Equality Operators Used to make a statement: The data on the right side of the equality operator is equal to the data on the left Statement may be true or false Assignment Operator Changes the value of the variable on the left

15 Boolean Definition: Boolean has one of two values, true or false Used when programs test conditions, then report back


Download ppt "Datatypes, Variables, Constants Flash Class. What Does ActionScript Do? Automates Examples: – Tells animation what to do button is clicked – Turn off."

Similar presentations


Ads by Google