Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 3 AS3 Programming. Introduction Algorithms + data structure =programs Why this formula relevant to application programs created in flash? The.

Similar presentations


Presentation on theme: "Chapter 3 AS3 Programming. Introduction Algorithms + data structure =programs Why this formula relevant to application programs created in flash? The."— Presentation transcript:

1 Chapter 3 AS3 Programming

2 Introduction Algorithms + data structure =programs Why this formula relevant to application programs created in flash? The short answer is that the foundation of object- oriented programming (OOP) languages, such as AS3,solidly rests on the principles and concepts of traditional programming. All programming languages are made up of at least two basic types of statements: 1- those that define or manage data structures 2- Those that together form an algorithm, the step-by- step solution to a problem.

3 The basic of designing and building an application A clear concept and a good flexible plan produce a better- quality application and help you to avoid unanticipated problems. The five phases of software application development : Phase 1: Problem analysis: Brainstorming an idea Phase 2: Storyboarding the visual design Phase 3: Algorithm Design Phase 4: Physically constructing the application Phase 5: Testing and Documentation

4 The basic of designing and building an application Phase 1: Problem analysis: Brainstorming an idea Phase 1 is concerned with understanding the objectives of the application and the users who will be using it General questions to ask are these: 1. Which information will be used and requested by the application? How is this information retrieved? 2. Which information will be produced by the application, and how will it be communicated to the user? 3. Which processing computations will be required?

5 The basic of designing and building an application Phase 2: Design Storyboards and navigation Maps for the visual Design Storyboarding, in essence, answers the questions related to how a visual design will promote interaction, how information will be communicated and how the visuals will affect playability and entertainment.

6 The basic of designing and building an application Phase 3: Algorithm design Designing algorithm means identifying the necessary steps, or tasks required, to solve the problem and arranging them in a logical order. Phase 4: Physically constructing the application Constructing the application will involve building the interactive and graphic components, constructing a flash timeline that represents the visual perspective of the user and coding the algorithm in AS3.

7 The basic of designing and building an application Phase 5: Testing and documentation Testing is concerned with checking that the application works correctly, works efficiently and is complete.

8 AS3 data type Data type is defined as a type of data and a set of operations that can be performed on that data. AS3 categorizes data types into one of two fundamental groupings: 1- A class data type: which referred to as a class, is a programmer-created data type. 2- A primitive data type: is one that is provided as an integral part of the AS3 language and requiers no external code. The main primitive data types in AS3 are: int, uint, number, string and Boolean.

9 AS3 data type 1- The int data type : The int is used to store whole numbers, which are known as integers. Exp : 1 2 199 -4 78 Exp of invalid int values are: $5.0 21.0 3,14 2- The uint data type : The uint data type is used for storing and working with positive whole numbers. The uint values are similar to the int values in that they cannot contain decimal points, commas or special symbol. The range of integers that can be represented by the uint data type goes from 0 to 4294967295

10 AS3 data type 3- The Number data type : A floating-point number, which is also called a real number, can be the number zero or any positive or negative number that contains a decimal point. Exp of number values : 3.0 -3,456 6,0001 Exp of invalid values: 2,345.99 $455,99 4- The string data type : The string data type is used to store textual information. Contains the letter of the alphabet, the ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9, and special symbols such as @,$, !, ?, *, # string values must be enclosed in double quotation marks. “ the sky is blues” “543” “hello!”

11 AS3 data type 5- The Boolean data type: A Boolean data type can hold only one of two values: True or False. AS3 treats the number zero (0)as False and any nonzero number value as True.

12 AS3 Programming Basics 1- variable and constant declarations: A declaration statement has a general format that requires the name of the data object and the specification of its data type. For a variable data object, the declaration format is : var identifierName:Datatype ; For a constant data object, the declaration format is : const identifierName:Datatype ; For example : Var hits:uint; Var atBats:uint; Const daysperweek.uint = 7;

13 AS3 Programming Basics 1- variable and constant declarations: Identifiers : are the name we assign to the data object, which must adhere to the following rules: Rule1: Identifiers must start with a letter of the alphabet or an underscore (_). Rule 2: Identifiers must consist of only letters, digits and underscore.

14 AS3 Programming Basics 2- Reading input from a text field: When values are placed in a dynamic text field, the.text notation is used. For exp: the string “Hello!” placed in the text field output. output.text = “Hello!”

15 AS3 Programming Basics 3- Statements and calculations: The operations in AS3: Exp : 2+7 2 * (4+5) Operations operator Addition+ Subtraction- Multiplication* Division/

16 AS3 Programming Basics 4- Comments and code documentation: Often programmers will insert comments at the top of a program to gives a brief explanation of the program and can also include comments before each important step in the code to provide a brief description explaining the purpose of instructions

17 AS3 Programming Basics 4- Comments and code documentation: Two types of comments :  Single line comments begin with two forward-learning slashes (//)  Multiple line comments are enclosed between /* and /*. Exp single line comment: Exp multiple line comments

18 AS3 Programming Basics 5- Testing Testing an application should be done early and often. Program correctness: An application may be correct for some scenarios, but not for others Application robustness: Programmed must be tested for stability under as many conditions as possible. User’s experience: User testing will demonstrate the effectiveness of the interface.


Download ppt "Chapter 3 AS3 Programming. Introduction Algorithms + data structure =programs Why this formula relevant to application programs created in flash? The."

Similar presentations


Ads by Google