将带有外部视频的Adobe Encore生成的.swf文件嵌入到使用Flash Pro的Adobe AIR应用程序中

时间:2013-05-29 19:19:27

标签: air flash embed loader

大家。我希望有人可以帮助我。我正在做一个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文件,请告诉我必须遵循的步骤。

大流士

1 个答案:

答案 0 :(得分:0)

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

这条线不正确:

var showBusinessPlay:Loader = new Loader;

它需要

var showBusinessPlay:Loader = new Loader();