1 / 15

Datatypes , Variables, Constants

Datatypes , Variables, Constants. Flash Class. 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.

oriel
Télécharger la présentation

Datatypes , Variables, Constants

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. Building Blocks Flash ActionScript 3 ActionScript made up of: Numbers Strings Building blocks for more complicated data containers • Flash animations made up of: • Drawings • Text • Frames (hold drawings, text) • Timelines (hold frames)

  4. ActionScript Building Blocks • Numbers • Strings • Arrays

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

  6. 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.

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

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

  9. 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

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

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

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

  13. Differences in Equality Operator (==) and Assignment Operator (=) Equality Operators Assignment Operator Changes the value of the variable on the left • 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

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

More Related