我正在尝试将 Flex SWF 加载到我的 Flash SWF 中,但它不起作用。我收到此错误:
Error: Error #2136: The SWF file file:///C|/Program%20Files/Adobe/Adobe%20Fireworks%20CS6/Configuration/Command%20Panels/Texture Panel.swf contains invalid data.
at _Main_mx_managers_SystemManager/create()
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 SWF 代码:
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.text.*;
import adobe.utils.*;
import flash.external.ExternalInterface;
import flash.display.Loader;
import flash.net.URLRequest;
public class Main extends Sprite
{
public function Main():void
{
if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
var myLoader:Loader = new Loader(); addChild(myLoader);
function systemManagerHandler(event:Event):Boolean { event.preventDefault(); return false; }
myLoader.addEventListener("mx.managers.SystemManager.isBootstrapRoot", systemManagerHandler);
myLoader.addEventListener("mx.managers.SystemManager.isStageRoot", systemManagerHandler);
myLoader.load(new URLRequest("Texture Panel.swf"));
}
}
}
我很乐意为此提供任何帮助。提前致谢!