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

Slides:



Advertisements
Similar presentations
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 3: Primitive Data Types.
Advertisements

© 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5/e Starting Out with C++: Early Objects 5 th Edition Chapter 2 Introduction.
Data types and variables
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to Python Programming Outline 2.1 Introduction 2.2 First Program in Python: Printing.
Chapter 2 Data Types, Declarations, and Displays
Chapter 2: Introduction to C++.
JavaScript, Third Edition
Chapter 1 Program Design
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
1 Chapter Two Using Data. 2 Objectives Learn about variable types and how to declare variables Learn how to display variable values Learn about the integral.
Chapter 2 Data Types, Declarations, and Displays.
Objectives You should be able to describe: Data Types
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
CSC 125 Introduction to C++ Programming Chapter 2 Introduction to C++
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2: Introduction to C++ Starting Out with C++ Early Objects Seventh.
A Variable is symbolic name that can be given different values. Variables are stored in particular places in the computer ‘s memory. When a variable is.
Chapter 2: Basic Elements of Java J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
2440: 211 Interactive Web Programming Expressions & Operators.
Chapter 2 Basic Elements of Java. Chapter Objectives Become familiar with the basic components of a Java program, including methods, special symbols,
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
Input, Output, and Processing
Copyright 1999 by Larry Fuhrer. Pascal Programming Getting Started...
Chapter 2: Using Data.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
CPS120: Introduction to Computer Science
Lecture #5 Introduction to C++
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Java Programming: From Problem Analysis to Program Design, 5e Chapter 2 Basic Elements of Java.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 2: Introduction to C++
CSCI 3133 Programming with C Instructor: Bindra Shrestha University of Houston – Clear Lake.
Chapter 2 Variables.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
CPS120: Introduction to Computer Science Variables and Constants.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
1 09/03/04CS150 Introduction to Computer Science 1 What Data Do We Have.
 Variables can store data of different types, and different data types can do different things.  PHP supports the following data types:  String  Integer.
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to C++
Java Programming: From Problem Analysis to Program Design, Second Edition 1 Lecture 1 Objectives  Become familiar with the basic components of a Java.
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
2.1 The Part of a C++ Program. The Parts of a C++ Program // sample C++ program #include using namespace std; int main() { cout
Java Programming: Guided Learning with Early Objects Chapter 1 Basic Elements of Java.
Chapter 2 Variables.
Topics Designing a Program Input, Processing, and Output
Chapter 2: Introduction to C++
BASIC ELEMENTS OF A COMPUTER PROGRAM
Java Programming: From Problem Analysis to Program Design, 4e
Chapter 2: Introduction to C++
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 2 Applications and Data.
2.1 Parts of a C++ Program.
Introduction to C++ Programming
Chapter 2: Basic Elements of Java
Chapter 2 Variables.
Chapter 2: Introduction to C++.
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Chapter 2 Variables.
Variables and Constants
Presentation transcript:

Chapter 3 AS3 Programming

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.

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

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?

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.

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.

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.

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.

AS3 data type 1- The int data type : The int is used to store whole numbers, which are known as integers. Exp : Exp of invalid int values are: $ ,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

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 : ,456 6,0001 Exp of invalid values: 2, $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 !, ?, *, # string values must be enclosed in double quotation marks. “ the sky is blues” “543” “hello!”

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.

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;

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.

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!”

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

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

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

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.