IT 621: Multimedia Authoring and Scripting

Useful Scripts and Links:

Linking to a URL with AS 3.0:

facebook_btn.addEventListener(MouseEvent.MOUSE_DOWN, linktofacebook);

function linktofacebook(event:MouseEvent):void
var request:URLRequest=new URLRequest("");

Displaying a Flash Movie (*.swf) in a web page (.html):

Embedding a video from YouTube (AS 2.0):

The following script is a "frame script"

this.createEmptyMovieClip("video_mc", 1);
video_mc._x = 324
video_mc._y = 200

Embedding a video from YouTube (AS 3.0):

See the following .fla files:

Chromeless (no controls) embedding YouTube video into Flash CS3 AS3

Chromed (with controls) embedding YouTube video into Flash CS3 AS3

Putting Multiple Videos on the stage at once:

Step 1: Export .swf file with video playing at full stage size (pick your desired Width and Height).

Step 2: Check out the following .fla file which integrates those .swfs You'll insert the following code actionscript code in the timeline as layer.

var loaded_clip1:Loader = new Loader();

loaded_clip1.contentLoaderInfo.addEventListener( Event.INIT, handleInit);
loaded_clip1.load( new URLRequest( "Youtube with controls 480x385.swf" ) );

function handleInit(evt:Event):void {
var extMovie:* = loaded_clip1.content;
extMovie.x = 400;
extMovie.y = 320;

Load external .swf file (useful for chunking your project into smaller parts):

Here is the full code:
//This creates a new instance of the loader object.
var my_Loader:Loader = new Loader();

//This creates a new instance of the URLRequest object that contains the
//path to the external SWF.
var my_url:URLRequest=new URLRequest("example.swf");

//These listeners detect when the file has finished loading, and if the
//correct file is loaded.
my_Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading);
my_Loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);

//The load method then loads the SWF file into the loader object.

//This function adds the external SWF to the stage.
function finishLoading(loadEvent:Event) {

//This function displays a message if the file is not found.
function errorHandler(errorEvent:Event):void {
trace("file missing");

Global Variables in Action Script 3.0

Combining Instance names with counter variables: _level0["f" + i]

For more information about the YouTube ActionScript 3.0 Player, click here

Quit Button (note: this script only works when the exported .swf file is loaded in Flash Player)

This script is a "button script"

on (release) {
fscommand ("quit");

"The Saga of the Three Little Pigs" Source Code

Final Project Drafts, IT 621 Fall 2009

Useful Game Development Script Sources:

Flash Game Tutorial 101

Flash PushButton Game Engine for CS4

Creating a Platform Game

Creating a Small Shooting Game

Kaboom Game and Flash File

Create a Hit Counter

20 Free Tutorials to Create Your Own Flash Game

Create a Survival Horror Game in Flash Tutorial

CS3 Game Tutorials Roundup (AS2 and AS3)

Shooting Game Intro

Create a Flash Racing Game Tutorial

Use this Online Step-by-Step guide:



Circle Clicker Game Design Challenge

Circle Clicker Full Version (Three Pigs)

This page created 9/29/09 by Anthony Betrus. Last updated 11/8/09.