Category Archives: Actionscript Examples

Framework Profiling Robotlegs Vs PureMVC

Following up from A post on the Robotlegs forum

The Results:

The Test Applications:

Sources: (Flex SDK 4.1 & AIR 2.5 for TV) (Flex SDK 4.5 & AIR 2.6 for Mobile) – change .zip extension to .fxpl

The AIR Wrappers: – change .zip extension to .air (Flex SDK 4.1 & AIR 2.5 for TV) – change .zip extension to .air (Flex SDK 4.5 & AIR 2.6 for Mobile) – change .zip extension to .apk (Flex SDK 4.5 & AIR 2.6 for Mobile)


Just A Couple Of Useful Posts

I read then as is usually the case i forget and do it the long way… so for future reference:

I call this one SWFObject IE-EI-OH!

All i wanted was for a swf to talk to javascript and back using our friend ExternalInterface. As with almost everything i publish SwfObject was mandatory. Within about 20 minutes it worked… or did it hmmm. As always mr IE stepped in to prevent me (and he did so with much rage and anger).

Anyways here is my SWFObject solution it is ‘simples…’

I hope this zip helps.

Preloading in Actionscript 3 with 2 swf’s

Here’s an example document class that belongs to a preloading swf that loads in my main application swf.

package com.deceptiveresolution.demo.swf.preloading
import flash.text.TextField;
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;

public class PreloadingContainer extends MovieClip

private var __container:Sprite;
private var __preloader:Loader;
public var percent_txt:TextField;
private static const __APP_URL:String = “TextChat.swf”;

public function PreloadingContainer()
__preloader = new Loader();
__preloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, _onPreloadProgress, false, 0, true);
__preloader.contentLoaderInfo.addEventListener(Event.INIT, _onPreloadInit, false, 0, true);
__preloader.contentLoaderInfo.addEventListener(Event.COMPLETE, _onPreloadComplete, false, 0, true);
__preloader.load(new URLRequest(__APP_URL));

private function _onPreloadProgress(e:ProgressEvent):void
var percentage:Number = e.bytesLoaded / e.bytesTotal;
percent_txt.text = String(Math.ceil(percentage * 100));

private function _onPreloadInit(e:Event):void
percent_txt.text = “100″;

private function _onPreloadComplete(e:Event):void
percent_txt = null;
__container = Sprite(__preloader.content);
__preloader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, _onPreloadProgress);
__preloader.contentLoaderInfo.removeEventListener(Event.INIT, _onPreloadInit);
__preloader.contentLoaderInfo.removeEventListener(Event.COMPLETE, _onPreloadComplete);
__preloader = null;