Archive for the 'ActionScript2' Category

Full Browser Flash Website

Jeff August 30th, 2007

I was looking through my Flash files the other day and found this. It is a full page flash website, meaning that the flash fills the entire page regardless of the size of the user’s browser. It is written in AS2 and isnt coded the best as I wrote it awhile ago but is a great introduction to using tween classes. (This one uses MC Tween).

Demo

Full Browser Code

MovieClipLoaderClass - AS2

Jeff August 21st, 2007

I have been reading a lot of questions about how to properly load movies in projects using actionscript2. This is how I do it:

var my_mcl:MovieClipLoader = new MovieClipLoader(); //Used to load the image

button1_mc.onPress = function() {
my_mcl.loadClip(movie1.swf, container_mc); //loading a movie into a container movie clip (just an empty mc on the stage)
};

button2_mc.onPress = function() {
my_mcl.loadClip(movie2.swf, container_mc); //loading a movie into a container movie clip (just an empty mc on the stage)
};

var mclListener:Object = new Object();
my_mcl.addListener(mclListener);

//the three listeners below are optional
mclListener.onLoadStart = function(container_mc:MovieClip) {
//The listener tells this function that downloading the image has begun and to perform whatever code you put here
};
mclListener.onLoadError = function(container_mc:MovieClip, errorCode:String, httpStatus:Number) {
// this function fires if there is an error in loading the movie
trace(”loadListener.onLoadError()”);
trace(”==========================”);
trace(”errorCode: ” + errorCode);
trace(”httpStatus: ” + httpStatus);
}
mclListener.onLoadComplete = function(container_mc:MovieClip) {
//The listener tells this function that downloading the image has completed and to play whatever code is here
}