swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] PDF2SWF - Flash 9 ActionScript 3 export


From: Rick Companje
Subject: [Swftools-common] PDF2SWF - Flash 9 ActionScript 3 export
Date: Tue, 29 May 2007 19:58:59 +0200

Hi Matthias,

I read your replies on related questions but I think there is still a problem in exporting to Flash 9, ActionScript 3 with PDF2SWF.

When I execute:

pdf2swf.exe --flashversion=9 "pdf1.pdf " -o "flash9.swf"

I get a SWF file with (swfVersion=9) but with (actionScriptVersion=2) instead of 3.

This means that it will be loaded in an AVM1Movie container by Flash 9 or Flex 2. I get the following error when I run my testcode in Flash 9:

   TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::AVM1Movie @10e71509 to flash.display.MovieClip. at LoaderInfoExample/::initHandler()

My testcode in Flash below.

Kind Regards,
Rick Companje




package {
    import flash.display.*;
    import flash.events.*;
    import flash.net.URLRequest;

    public class LoaderInfoExample extends Sprite {
        private var url:String = "swftools/flash9.swf";

        public function LoaderInfoExample() {
            var loader:Loader = new Loader();
            loader.contentLoaderInfo.addEventListener (Event.INIT, initHandler);
            loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            var request:URLRequest = new URLRequest(url);
            loader.load(request);
            addChild(loader);
        }

        private function initHandler(event:Event):void {
            var loader:Loader = Loader(event.target.loader);
            var info:LoaderInfo = LoaderInfo( loader.contentLoaderInfo);

            trace("url="" + info.url);
            trace("");
            trace("swfVersion=" + info.swfVersion);
            trace("actionScriptVersion=" + info.actionScriptVersion);
            trace("");
           
            MovieClip(loader.content).gotoAndStop(5);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
    }
}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]