0

每个人。我希望有人可以帮助我。我正在做一个 AIR 应用程序项目,需要嵌入一个由 Encore 生成的 swf 文件,该文件又嵌入一个视频 (F4V) 文件。使用 Loader 对象加载它时出现以下错误:

 TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.managers::FocusManager/activate()
    at spark.components::Application/initManagers()
    at spark.components::Application/initialize()
    at EncoreSWF/initialize()
    at mx.managers.systemClasses::ChildManager/childAdded()
    at mx.managers.systemClasses::ChildManager/initializeTopLevelWindow()
    at mx.managers::SystemManager/initializeTopLevelWindow()
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/timerHandler()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

我非常了解 Flash Professional,但完全不了解 Flash Builder。以下是我的代码:

    import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;

var showBusinessPlay:Loader = new Loader;
showBusinessPlay.x = 0;
showBusinessPlay.y = 0;
showBusinessPlay.width = 1024;
showBusinessPlay.height = 768;
showBusinessPlay.visible = true;
showBusinessPlay.load(new URLRequest("TestFlash/flashdvd.swf"));
showBusinessPlay.addEventListener(Event.COMPLETE,addToStage);
function addToStage(event:Event):void{
    stage.addChild(showBusinessPlay);
}

如果有任何方法可以做到这一点,我知道会有,请帮助我。如果需要使用 Flash Builder 和 swc 文件来完成,请告诉我必须遵循哪些步骤来执行此操作。

大流士

4

1 回答 1

0

我不认为这与 SWF 有任何关系。你能告诉我们更多的代码吗?

这条线是不正确的:

var showBusinessPlay:Loader = new Loader;

它需要是

var showBusinessPlay:Loader = new Loader();
于 2013-05-30T04:52:39.590 回答