I'm using flash.display.Loader to load this example SWF as a use-case for loading SWFs that uses flex charting components in an application I'm working on.
This is the code I'm using to load the swf:
Main.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onCreationComplete(event);">
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
import myLoaderClass;
private function onCreationComplete( e:FlexEvent ):void
{
trace("Init!");
var l:myLoaderClass = new myLoaderClass();
this.addChild(l);
}
]]>
</mx:Script>
</mx:Application>
myLoaderClass:
package
{
import mx.core.UIComponent;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.Loader;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.text.TextFieldType;
import flash.utils.Dictionary;
public class JittRunner extends UIComponent
{
private var displayedObjects:Dictionary;
public function JittRunner():void
{
displayedObjects = new Dictionary();
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
var mLoader:Loader = new Loader();
var mRequest:URLRequest = new URLRequest('ChartSampler.swf');
mLoader.load(mRequest);
}
}
}
The thing is, the minute the swf is loaded I'm getting the following runtime error:
Error: Could not find resource bundle messaging
at mx.resources::ResourceBundle$/getResourceBundle()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\resources\ResourceBundle.as:143]
at mx.utils::Translator$cinit()
at global$init()
at mx.messaging.config::ServerConfig$cinit()
at global$init()
at _app_FlexInit$/init()
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3217]
at mx.managers::SystemManager/docFrameListener()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3069]
What am I doing wrong here?