Created
November 25, 2009 16:07
-
-
Save djdonovan/242809 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Calling a SWF's Library Class References - Application Domain Example | |
| import com.hydrotik.queueloader.QueueLoader; | |
| import com.hydrotik.queueloader.QueueLoaderEvent; | |
| var addedDefinitions:LoaderContext = new LoaderContext(); | |
| addedDefinitions.applicationDomain = ApplicationDomain.currentDomain; | |
| var _oLoader:QueueLoader = new QueueLoader(false, addedDefinitions, true, "testQueue"); | |
| _oLoader.addItem("../flashassets/swf/externalsounds.swf", this, {title:"SWF"}); | |
| _oLoader.addEventListener(QueueLoaderEvent.QUEUE_START, onQueueStart, false, 0, true); | |
| _oLoader.addEventListener(QueueLoaderEvent.QUEUE_PROGRESS, onQueueProgress, false, 0, true); | |
| _oLoader.addEventListener(QueueLoaderEvent.QUEUE_COMPLETE, onQueueComplete,false, 0, true); | |
| _oLoader.execute(); | |
| //Listener functions | |
| function onQueueStart(event:QueueLoaderEvent):void { | |
| trace("** "+event.type); | |
| } | |
| function onQueueProgress(event:QueueLoaderEvent):void { | |
| trace("\t>>onQueueProgress: "+event.queuepercentage); | |
| } | |
| function onQueueComplete(event:QueueLoaderEvent):void { | |
| trace("** "+event.type); | |
| var loop:Sound = new (getDefinitionByName("Loop1"))(); | |
| var soundChannel:SoundChannel = loop.play(0,999); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment