Tuesday, December 1, 2009
Your Tenth and Final Blog Post
Tuesday, November 17, 2009
PRELOADER CODE:
//Import the required assets
import flash.display.*;
//Stop the playhead while loading occurs
this.stop();
//Create a listener to call the loading function as the movie loads
this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING);
/*This is the main function, basically it grabs the total and loaded bytes,
calculates a percentage, and displays it by stretching the bar and adjusting
the textfield display. If your bar/textbox instancenames are NOT lbar/lpc,
you'll need to adjust this code to match your instance names*/
function PL_LOADING(event:ProgressEvent):void {
var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
//Stretch the bar
lbar.scaleX=pcent/100;
//Display the % loaded in textfield
lpc.text=int(pcent)+"%";
//If the movie is fully loaded, kick to the next frame on the main timeline
//You may wish to change the gotoAndStop(2) to a gotoAndPlay(2)
if(pcent==100){
this.gotoAndStop(2);
}
}
Tuesday, November 3, 2009
Addition to Your Index Pages:
UNLOAD that EXTERNAL FILE
LOADING External FLASH Files
CODE to LINK from FLASH Project to an External URL
function mouseClickHandler1(event:MouseEvent):void {
var pixelcolaURL:URLRequest = new
URLRequest("http://pixelcola.net");
navigateToURL(pixelcolaURL); }