FLASH 101

This section is to help people start learning about flash and general interactive application development.

Computer Science is a science, these people call them selves scientists and engineers, they have big words defining complex concepts, and they always use convoluted sentence structures.

The vocabulary is important, here are some of the terms that define complex interactions in applications and ofcourse general Computer Science.

General Concepts found in Computer Science.

Classes

Classes are blueprints on which action script objects are based. By default code in a given class can be used by that class or imported by another class. Classes are used to clump code together in manageable parts.

In AS3.0 Classes are defined in packages

package packageName {
 public class ClassName {
  //Class Code
 }
} 

Understanding MVC

No it doesnt stand for Motor Vehicle Commission, at least not here, No it doesnt stand for Multi-Variable-Chains, at least not yet.

MVC stands for Model View Controller. The Model View Controller software programming pattern is intended to help with design and development of applications. The concept is applied to the separation of business logic and display logic in forms for example. It becomes really helpful to keep in mind that changes and tweaks at a later time to an application will are easier to implement if the code that controls either business logic or the display and interactivity of a user interface are kept separate from each other. A good application would utilize the concept of a Model View Controller to a modular degree allowing classes to assist in creating easily customizable applications.



Strong Typing

In AS3 strong typing is integral to improving the performance of an application, by telling the compiler the specific variable type that is used by a specific variable the compiler if able to better take over the management of that variable while it is being used. Allowing for faster retrieval of data as well as quicker calculation.

var userName:String = "Karnei";

Strong Datatyping occurs after variable name definition preceeded by a colon:



Inheritance

Yes, if your grandpa was Bold, your most likely to be bold as well. Similarly in Action Script 3.0 if a class inherits or “extends” another class, some things are repeated.

For Example:

public class GrandPa {
  public var bold:String = "Yup";
}


In Another Class:

public class Kid extends GrandPa{
  //Nothin here
}


Then later when we are instantiating a variable

var kidInstance:Kid = new Kid();
trace(kidInstance.bold) //print Yup 
// he's Bold alright, (yes I know how Bold 
// is spelled, no Im not in denial;

Inheritance is great when creating complex applications that are made up of similar and at the same time custom more advanced parts.


Abstraction

The concept of abstraction is practiced in ActionScript by pulling apart a complex problem in to a sum of its small simple parts. Much as Picasso utilized simple shapes to create complex renderings of our reality.

For Example:

public class Checkout {
  public static var UnitPrice:Number = 25; //
  public var NumberOfItems:Number;
  
  public function subTotal():Number
  {
     return NumberOfItems * UnitPrice;
  }

  public function calculateTax(total:Number):Number
  {
  }



}

Encapsulation

A Design pattern of hiding the internal mechanisms and data structures behind an interface. This works great with flash because this design patter allows for design of complex applications with clear structure of location of user interaction code.

For example a Phone application could be instantiating a dialer class for dialing numbers. The benefit comes when a developer of the Phone application needs not to know of button states, rollover and mouseout button interactions of the dialer would then be handled by the Dialer class, releaving the developer to focus on more complex objectives.

Polymorphism

A basic feature of most object oriented languages that allows for a subclass, in actionscript extends, to be used in any situation where the super class is specified.

Object Oriented ActionScript 3.0 By Peter Elst, Sas Jacobs, Todd Yard, does a great job boiling down this subject.

See GoogleBook for more info.

 
flash101.txt · Last modified: 2009/10/26 12:41 by root · [Old revisions]
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki