ADOBE FLEX Action Script Basics. MXML. Language Basics Action Script 3.0.

Slides:



Advertisements
Similar presentations
Overloading Having more than one method with the same name is known as overloading. Overloading is legal in Java as long as each version takes different.
Advertisements

JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Intro to Javascript CS Client Side Scripting CS380 2.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# Language &.NET Platform 12 th -13 th Lecture Pavel Ježek.
Intro to JavaScript. JavaScript History Client (generally browser-side) language invented at Netscape under the name LiveScript around 1995 Netscape wanted.
C# Language Report By Trevor Adams. Language History Developed by Microsoft Developed by Microsoft Principal Software Architect Principal Software Architect.
Strings in Java 1. strings in java are handled by two classes String &
1 Working with String Duo Wei CS110A_ Empty Strings An empty string has no characters; its length is 0. Not to be confused with an uninitialized.
Written by: Dr. JJ Shepherd
Inheritance. Extending Classes It’s possible to create a class by using another as a starting point  i.e. Start with the original class then add methods,
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Advanced Object-Oriented Programming Features
Cosc 4755 Phone programming: GUI Concepts & Threads.
Programming in Scala Chapter 1. Scala: both object-oriented and functional Scala blends –object-oriented and –functional programming in a –statically.
Review CSC 171 FALL 2004 LECTURE 21. Topics Objects and Classes Fundamental Types Graphics and Applets Decisions Iteration Designing Classes Testing and.
2.3 Cool features in C# academy.zariba.com 1. Lecture Content 1.Extension Methods 2.Anonymous Types 3.Delegates 4.Action and Func 5.Events 6.Lambda Expressions.
8.1 Classes & Inheritance Inheritance Objects are created to model ‘things’ Sometimes, ‘things’ may be different, but still have many attributes.
JAVASCRIPT Introduction Kenny Lam. What is Javascript?  Client-side scripting language that can manipulate elements in the DOM  Event-driven language.
OOP Languages: Java vs C++
Programming Languages and Paradigms Object-Oriented Programming.
Classes, Objects, Arrays, Collections and Autoboxing Dr. Andrew Wallace PhD BEng(hons) EurIng
Scripting Languages.
BIM313 – Advanced Programming Techniques Object-Oriented Programming 1.
School of Computing and Information Systems CS 371 Web Application Programming PHP - Basics Serving up web pages.
M IMIC : Computing Models for Opaque Code Stefan Heule, Manu Sridharan, Satish Chandra Stanford University, Samsung Research America September 4, 2015;
Java Tutorial. Object-Oriented Programming Concepts Object –a representation of some item state  fields/members and should be encapsulated behavior 
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
Programming Languages and Paradigms Object-Oriented Programming (Part II)
1 Software Construction Lab 4 Classes and Objects in Java Basics of Classes in Java.
CSE 154 LECTURE 17: JAVASCRIPT. Client-side scripting client-side script: code runs in browser after page is sent back from server often this code manipulates.
Inheritance in the Java programming language J. W. Rider.
VB and C# Programming Basics. Overview Basic operations String processing Date processing Control structures Functions and subroutines.
ILM Proprietary and Confidential -
String Manipulation Chapter 15 This chapter explains the String facilities. You have already seen some of the main methods of the String class.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Created by Terri Street Copyright, 2000  1,000,0001,000,000  500,000500,000  250,000250,000  125,000125,000  64,00064,000  32,00032,000  16,00016,000.
Even-Driven Programming and basic Graphical User Interface.
Object-Oriented Design CSC 212. Announcements This course is speeding up and we are starting new material. Please see me if you feel this is going too.
Applications Development
Project 1: Using Arrays and Manipulating Strings Essentials for Design JavaScript Level Two Michael Brooks.
1 Review of Java Basic Concepts –Names and Reserved Words –Expressions and Precedence of Operators –Flow of Control – conditional statements –Flow of Control.
Inheritance Dr. Andrew Wallace PhD BEng(hons) EurIng
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
QT Programming QT Programming Ruku Roychowdhury. Background QT is a cross platform application framework. Widely used to develop GUI applications. Originally.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming strings.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 Chapter 15 Event-Driven Programming and.
A cannon game ?. Simple version angle from command line, one shot only Coordinate system is “upside-down”: Use dy(int) method to transform y coordinate:
CSE 154 Lecture 6: Javascript.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 Chapter 15 Event-Driven Programming and.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Written by: Dr. JJ Shepherd
Event-Driven Programming F Procedural programming is executed in procedural order. F In event-driven programming, code is executed upon activation of events.
Lecture10 Exception Handling Jaeki Song. Introduction Categories of errors –Compilation error The rules of language have not been followed –Runtime error.
OOP Basics Classes & Methods (c) IDMS/SQL News
Programming in AS3. AS3 vs MXML MXML is content/structure AS3 ties in with the MXML to create the a functioning program.
Features of.net Language independent Object oriented program Multi threading Exception handling Drag and drop Linq
Basic Objects. Math Object  Math.cos( x ), x in radians  Math.sqrt ( x )  Math.pow ( x, y )  Math.ceil( x )  etc.
Chapter 4 Java Script – Part2. 2 Location object Properties Properties href – whole path will be displayed. ex: window.location.href ( see example 11)
© A+ Computer Science - Magpie Magpie is a lab that focuses on classes, randomness, and Strings. This lab will make sure that you.
Introduction to Calculated Columns Variables, Conditionals, and String Manipulation PRESENTER: Cameron Blashka| Informer Implementation Specialist| April.
Inheritance and Polymorphism
null, true, and false are also reserved.
University of Kurdistan
Constructors, GUI’s(Using Swing) and ActionListner
CS2011 Introduction to Programming I Strings
FINAL EXAM Final Exam Wednesday, Dec 14: 8: :00 AM (Frny G140)
Object-Oriented Java Programming
CS3220 Web and Internet Programming JavaScript Basics
Chengyu Sun California State University, Los Angeles
FINAL EXAM Final Exam Tuesday, May 3: 1:00 - 3:00 PM (Phys 112)
Presentation transcript:

ADOBE FLEX Action Script Basics. MXML

Language Basics Action Script 3.0

Data Types  Primitive types var i:int = -1; var u:uint = 0;  Boolean, String  References var o:Object; var c:Class = String; var s:String = new c; var x:* = …

Action Script 3.0 Type System  Non-Strict typing vs Strict Typing var o:Object = …; var x:* = …  Classes are Objects (Array is Object) == true (int is Object) == true (Object is Object) == true (Class is Object) == true  Name of class x.className  Class from name var c:Class = getDefinitionByName(“Array”) as Class;

Action Script 3.0 Objects are Dynamic  Dynamic fields var o:Object = {name:"John", lname:"Smith"}; o.age = 23; o[“address”] = “New York”;  Dictionary vs Object as dictionary var d:Dictionary = new Dictionaty; var o:Object = new Object; d[“hello”] = 1; o[“hello”] = 1; d[o] = 2; o[o] = 2;

Action Script 3.0 Other Basic Types  Array var a:Array = new Array; var b:Array = [1,2,3];  concat, filter, for each, map, indexOf, length, pop, push, reverse, slice, sort, splice, shift, unshift  Array Collection  addItem, addItemAt, getItemAt, contains, setItemAt, toArray  Boolean  String

Action Script 3.0 Other Basic Types  String: the way we want it, but confusing sometimes  ==  …  length, indexOf, lastIndexOf, match, replace, slice, split, substr, charAr, charCodeAt, concat, search, toLowerCase, toUpperCase

Action Script 3.0 Basic Statements  if-then-else if ( ) else  for, while  for (var i:int = 0; i  for each (var o:Object in SomeArray)  for each (var t:SomeType in SomeArray)  Switch, break, try-catch, return, etc.

Action Script 3.0 Classes and methods  Classes class MyClass : extends yourClass { public function myMethod (i:int,j:int):int { return 0; } public override function yourFunction ():void {} }  No method overloading  Explicit overriding  super keyword, this keyword  public constructor

Action Script 3.0 Properties class MyClass { private var _myNumber:Number = 0; public function set myNumber (n:Number):void { _myNymber = n; //do something else } public function get myNumber ():Number { //do something else return _myNumber; }  Usage { var my:MyClass = new MyClass; my.myNumber = 5; }

Action Script 3.0 Static Methods class MyClass { private static var count:Number = 0; public static function getCount ():Number { return count++; } //… MyClass.getCount () == MyClass.getCount() + 1

Action Script 3.0 Inheritance  Single inheritance only  Multiple inheritance with Interfaces interface IMyInterface { public function myMethod ():Number; } class myClass extends YourClass implements IMyInterface, IYourInterface { //… }

Action Script 3.0 Tracing & Output  Integrated debugger  trace (…) function  Alert.show (…) method

Action Script 3.0 & XML var xml:XML = Ivan 2 Petyr 2 Stefan 2 Ivan ; trace(xml.student[0].name); trace(xml.student.length());

Execution Applications

Console application Program logic time Synchronous Input

Messages sent from Objects to Objects Events User Event (Button Click) Event Queue Dispatch event Internal Event (Timer) Registered Listener (Window) Handle event

Message Pump Program Logic External Events Internal Events

Frames Per Second Execution Time Limit Flex Application Execution Model time fames Function execution Manual dispatch Hander A Hander B Hander C Events

XML? Action Script? MXML

Motivation  Markup languages are common  Easier Maintenance of the Layout  Designers can work on the UI  Simplified access of language features

MXML What Happens  MyMXLExample.mxml: <mx:TextArea id=“myText” width = “100” height = “100”/>  This code is transformed to Action Script code class MyMXMLExample extends Application { public var myText:TextArea; //… some method { myText = new TextArea; myText.width = 100; myText.height = 100; }

Thank you!