Banner Trouble, Google Site Problem

The Loader Class is one of the most used class for me since its inception in 2.0 as MovieClipLoader Class. It can make great sites like 2Advanced.com which would hardly need a preloader at all even if it runs on 14.4 kbps. I make presentations using flash and the Loader Class. I got paid on one CD project about the hypothalamus using Flash and they were awed at its functionality. Recently I got commissioned to do a website but the banner had trouble loading on site! The banner had no trouble when you view it directly at the folder but when it’s embedded it just froze! This could be a problem with Google Sites, I don’t know. Single swf files with animation loads perfectly. But when I link them using the Loader Class and embed them, I probably get an error. Is there any way to know what error I could get while on site? I’ve pretty much given up. So I’ll  be loading a single SWF instead which could get really large and long to load. The following is a prototype version of the Banner.as that I wrote. I know it sucks but I’m going to improve it.

package{
import flash.display.Loader;
import flash.net.URLRequest;
import flash.display.MovieClip;
import flash.events.*;
import flash.utils.Timer;
public class Banner extends MovieClip{
private var url:String = “items_1.swf”;
private var myTimer:Timer = new Timer(10000, 3)
private var myLoader:Loader = new Loader;
private var slideNumber:Number = 1;
public function Banner(){
myLoader.load(new URLRequest(url));
trace (url);
trace (“loader works”);
addChild (myLoader);
configureListeners(myLoader.contentLoaderInfo);
myTimer.start();
}
private function configureListeners(dispatcher:IEventDispatcher):void{
dispatcher.addEventListener(Event.COMPLETE, startTimer);
}
public function startTimer(event:Event):void {
trace (“completed swf1”);
myTimer.addEventListener(TimerEvent.TIMER, switchMovie);
}
public function switchMovie(event:TimerEvent):void {
if (slideNumber < 3){
slideNumber ++;
trace (slideNumber);
url = “items_”+ slideNumber +”.swf”;
trace (url);
myLoader.load(new URLRequest(url));
addChild (myLoader);
} else if (slideNumber == 3) {
slideNumber = 0;
myTimer.reset();
trace (“Timer is reset”)
trace (slideNumber)
myTimer.start();
}
}
}
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s