facebook_btn.addEventListener(MouseEvent.MOUSE_DOWN, linktofacebook);
function linktofacebook(event:MouseEvent):void
{
var request:URLRequest=new URLRequest("http://facebook.com");
navigateToURL(request,"blank");
}
The following script is a "frame script"
this.createEmptyMovieClip("video_mc", 1);
video_mc._x = 324
video_mc._y = 200
this.video_mc.loadMovie("http://www.youtube.com/v/Yo3F6ciKXuA&hl=en&fs=1&");
stop();
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();
stage.addChild(loaded_clip1);
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): http://www.ilike2flash.com/2009/11/load-external-swf-in-as3.html
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.
my_Loader.load(my_url);
//This function adds the external SWF to the stage.
function finishLoading(loadEvent:Event) {
addChild(loadEvent.currentTarget.content);
}
//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 http://www.smithmediafusion.com/blog/?p=436
Combining Instance names with counter variables: _level0["f" + i]
For more information about the YouTube ActionScript 3.0 Player, click here
This script is a "button script"
on (release) {
fscommand ("quit");
}
http://www.actionscript.org/resources/articles/52/1/Building-games-in-flash/Page1.html
http://pelfusion.com/tutorials/35-flash-game-development-tutorials-fla-files/
http://www.flash-design-marketing.com/tutorials/free-fla-files/flash-games.shtml
http://www.strille.net/tutorials/
Flash PushButton Game Engine for CS4
Creating a Small Shooting Game
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)
Create a Flash Racing Game Tutorial
Use this Online Step-by-Step guide:
http://www.adobe.com/devnet/flash/quickstart/embedding_fonts/
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.