开发者

Loading of external SWF results in a "Could not find resource bundle messaging" error

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:my开发者_StackOverflow社区LoaderClass = 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?


I don't think you're not doing anything wrong in the code you posted. I just pasted it into a new project (renamed JittRunner to myLoaderClass) and it compiled and ran fine (didn't do anything but no errors).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜