-A +A

 

Flash ActionScript 3.0

Emergency Update

Flash doesn't work the way it used to

ActionScript 3.0 is not an enhanced ActionScript 2.0

Why? God Knows

There's an explanation here, but I don't buy it.

The Old Way in ActionScript 2.0

The Old Way to write an event-driven script:

  • You could attach a script to the button and write:
on(release){
	doSomething( );
}
  • Or, you could name the button 'button_btn' and write:
button_btn.onRelease = function( ) {
	doSomething( );
}

The New Way in ActionScript 3.0

Now there is only one way

  • Buttons and movieClips cannot have scripts attached to them. Scripts can only live in the timeline or in a separate file
function functionName(event:MouseEvent) {
	doSomething();
}
button_btn.addEventListener(MouseEvent.MOUSE_UP, functionName);

Other Tragedies

You must now declare variables

var myThing1 = 1; 	// Legal

myThing2 = 1; 		// Illegal!

A great big ugly horrible GOTCHA!

myThing2 = 1; 			

Validates as OK when you check syntax – when it is not OK

This changes sound behavior buttons. Behaviors don't work with ActionScript 3.0

Flash Video

Two Styles

Embedded

  • Best for small clips
  • Becomes part of the timeline
  • File size can get BIG
  • Video over 10 seconds tends to loose audio sync
  • File won't play until it is entirely downloaded
  • To Embed
    • File: Import: Import Video

Linked F4V file with Adobe Media Encoder and Video Component in timeline