BKWLD

Author Archive

CDN and computeSpectrum function do not get along

By Max on February 26, 2008 at 11:10 am

For the soundwave360 site we decided to use Limelight to stream the audio. Once the audio was moved over to the Limelight CDN everything was streaming a lot faster. However there was one problem, flash was throwing a sandbox security error every time I used the computeSpectrum function to create the sound wave. (more…)

IE6 is bugalicious with AS3

By Max on November 29, 2007 at 10:52 pm

After recently launching a flash site developed in AS3, a stupid, stupid bug appeared that caused a slight amount of brain trauma. In InternetExplorer 6 the site loaded, and worked fine. But when you would navigate elsewhere and come back to the site, everything was all screwy. The alignment was off and the site wouldn’t initialize. Clear your cache, reload and everything was perfect. So, obviously its a cache problem, and it only occurred in IE6.

Here’s how I had my project set up:

index.fla contained all the site library instances and all instances were set for export, but not on the first frame. The second frame of index.fla contained all the instances placed on the stage and the third frame was blank. MainController.as was set as the document class for index.fla. MainController.as was set up to load the site somewhat like this:

public function MainController():void {
         this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
         this.loaderInfo.addEventListener(Even.COMPLETE, onLoadComplete);
}

private function onLoadProgress(event:ProgressEvent):void {
         var bLoaded:Number = this.loaderInfo.bytesLoaded;
}

private function onLoadComplete(event:ProgressEvent):void {
        this.gotoAndStop(3);
        //load and initialize your shell file here
}

Eventually I ran across this post: http://pixelfumes.blogspot.com/2007/07/ie6-as3-preloader-events-failing.html

So what was happening is that the progess event and complete event would never fire for the load of the site once the site was cached in IE6. Also, my alignment of objects that were added to the stage before the load, like the site loader instance, were not properly aligned because I was positioning them based on stage.stageWidth/2 and stage.stageHeight/2, and for some odd reason, after being cached, in IE6 it wasn’t able to access the stage properties.

So here is a good work around. index.swf loads a new swf file, main.swf, which contains all the library instances set for export on the first frame, and initializes the site. So, index.fla contains just the instances for loading, like your loader graphics, and has a document class, maybe called MainLoader.as. MainLoader.as (index.swf’s doument class) loads main.swf. main.fla has a document class called MainController.as. MainController.as initializes your site.

There are three great advantages to this method. First, no IE6 bugs. This bug will most likely never go away, Microsoft sure as hell isn’t going to be doing anything about it, and why would Adobe want to target their application for IE6? SECOND, all your classes will be initialized in the MainController.as. So, not only will MainLoader.as load all the library instances set for export in main.fla, but it will also load all the class files for your site. BOOYAH! THIRD, no timeline, at all. It’s use was minimal with the original method, just adding 3 frames, but with this one there is no need to touch the timeline.

Sure, its a pain to have two fla’s and two document classes, but this method is the best that I have come across since it loads both the library and classes. The only other workaround would be to start a global anti-IE6 campaign. Which I am honestly thinking about doing.

Flash Equalizer, Easy Peasy.

By Max on November 24, 2007 at 4:59 pm

So, my thanksgiving break consisted of 4 days of leftovers and HBO On Demand. I also decided to make this nice little thingy. I have been talking about the new SoundMixer class introduced in AS3 for some time now, but I never utilized it. Well, I decided to create an equalizer using the new SoundMixer, Graphics and ByteArray classes introduced in AS3. It’s not too hard and can be implemented in soooo many ways.
http://www.maxrox.com/expirements/equalizer/
Source Code

Taking it one step further, I decided to include a little papervision3d magic. The result ended up looking very cool. It didn’t require an insane amount of code and runs fairly smooth.
http://www.maxrox.com/expirements/3dequalizer/
Source Code

Cool Tool!

By Max on November 6, 2007 at 1:44 pm

Just wanted to share a simple widget that is very handy when developing: http://www.apple.com/downloads/dashboard/developer/cicero.html It simply copies random lines of Lorum Ipsum text.