1

我正在尝试将 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"));
        }

    }

}

我很乐意为此提供任何帮助。提前致谢!

4

1 回答 1

1

来自安迪摩尔的提示:

1) Flash:文件 > 新建 > Flash AS3.0 文件

2) 从旧 FLA 中复制整个“库”

3) 将整个“库”粘贴到新的 FLA

4)删除旧文件,这是神奇的毒药

于 2012-11-22T15:04:07.217 回答