Error #2136: The SWF file

I am trying to learn how to use classes.The book i am using gave me this example.
In Vechile.as
package{
            import flash.display.MovieClip;
            import flash.events.Event;
            public class Vehicle extends MovieClip{
                        public var _gasMileage:Number;
                        public var _fuelAvailable:Number;
                        public var _milesTraveled:Number =0;
                        public var _go:Boolean;
                        public function Vehicle(mpg:Number=21, fuel:Number=18.5){
                                    _gasMileage=mpg;
                                    _fuelAvailable = fuel;
                                    this.addEventListener(Event.ENTER_FRAME, onLoop, false,
                                    0, true);
            public function onLoop (evt:Event):void{
                        if (_go){
                                    _fuelAvailable--;
                                    _milesTraveled+=_gasMileage;
                                    if (_fuelAvailable < 1){
                                                this.removeEventListener(Event.ENTER_FRAME,
                                                onLoop);
                                    trace(this, _milesTraveled,_fuelAvailable);
                                    this.x=_milesTraveled;
            public function go():void{
                        _go = true;
In the main.fla
In frame 1
var vehicle:Vehicle = new Vehicle(21,18.5);
addChild(vehicle);
vehicle.go();
when I compile it gives an output error.
Error #2136: The SWF file file:///C|/Users/Ravenwind/Documents/Main.swf contains invalid data.
                at Vehicle/frame1()
I am stumped

" I then assign Vehicle to document class box in the property box" Do not assign the Vehicle as the document class... remove it from there. 
In the main file, if you didn't already create one, create a movieclip symbol (just draw a shape in it for now).  Right click the symbol in the library and select the Linkage option.   In the interface that appears, select the option to Export for Actionscript, and assign it the Class name "Vehicle" in the field labeled "Class"
Make sure you save the Vehicle.as file after you put the code into it and have that file in the same folder as your Main.fla file.
If you do the things I just described you should see an instance of the movieclip moving across the stage when you run the file.

Similar Messages

  • Error while importing swf file in to Crystal Xcelsius Designer 4.5

    help me...., Error while importing swf file in to Crystal Xcelsius Designer 4.5

    I read in the book called "CRYSTAL XCELSIUS for DUMMIES" on page 243 under topic called Nesting a Dashboard within another Dashboard.
    sorry i used the wrong word embed, here i am importing the swf using image component.
    My requirement is somethis like this parent child dependency menu.
    eg: i have to two tabs 1)alphabets 2) Numerics  First levet menu
    if you click alphabets tab then the following menu A/B/C/D/..... Z i have diff charts.. under each alphabet.
    If you click numberic tab then the follwing menu should one/two/three/.......ten  here also i have diff charts under number
    in over to avoid complexity in dynamic visibility i divided the into 3 dashboards.  1- alphabets 2- number and 3 -importing both swfs.. everything works fine except first tab and last tab under alphabets and numerics.
    If some one help me with some alernative ... would be great.
    Thanks

  • How to create the SWF file which was included surrogate pairs.

    I would like to make sure how to create the SWF file which are included surrogate pairs.
    The error of outside the scope of unicode occurred when I compiled(mxmlc) the as file which was set surrogate pairs to 'Unicoderange'.
    Ex, I set the '  '(UTF-16 is '20B9F') to 'Unicoderange'.
    However, I cannot add the surrogate pairs.
    The error of outside the scope of Unicode occurred when I compiled the AS file.
    The reason of error was that the Unicode(UTF-16) of surrogate pairs is invalid.
    Then, I read the following pages.
    These pages are written that unicode-range supported surrogate pairs.
    http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_07.html
    http://www.w3.org/TR/1998/REC-CSS2-19980512/fonts.html#descdef-unicode -range
    So please let me know how to create the SWF file which are included surrogate pairs.
    Environment
    - Flex3.5a
    - TTC: meiryo(ver6.02), msgothic(ver2.50), mspgothic(ver2.50)
    Thanks,
    Takeshi Ishihara.

    I've been able to create project jar files in Eclipse by selecting Export from the File menu, then choose Java - Jar file - and provide the required information, name, destination folder etc. But when I do this, I do not export other jars on the build path this way nor do I expect to do this. I am only concerned with creating a jar file of my own work. A jar file does not "contain" other jar files. If the jar file contains the main method, and requires other jars for it's execution, then you may wish to include a reference to required jars on the class path entry of the Manifest file of the jar file you create. I'm not sure how to create a Manifest file in eclipse though..

  • Error #2046: The loaded file did not have a valid signature in flex 4

    As part of our CI build, the ant script that builds the client side (flex 4) projects also runs a set of FlexUnit4 tests on the deployed project. Most of the tests work but a few fail with this error
    RSL
    http://local.foo.com/bar/com/blah/components/someComponent/framework_4.1.0.16076.swz failed to load.
    Error #2046: The loaded file did not have a valid signature.
    The build machine is running Ununtu 10.10 with Firefox 3.6 and Flashplayer 10.2. If I run  the exact same set of tasks, accessed from the same URL in windows everything passes with no problem. After some searching I did run across this thread: http://forums.adobe.com/message/2747415#2747415 but when I went looking for the libflashsupport.so file mentioned, the Ubuntu docs seemed to indicate that it was no longer needed.
    I'm at my wits end here. Is libflashsupport.so actually needed in Ubuntu 10.10 and if so where would I find it? If not does anyone know of another issue that could be responsible for this?

    hello,
    I have the same issue, Ubuntu 10.10, flashplayer 10.3rc1
    mxmlc SimplePrj.mxml -debug=true -benchmark=true --target-player=10 -output ../deploy/SimplePrj.swf
    mxlc verbose:
    Loading configuration file /home/.../flex-config.xml
    Initial setup: 79ms
    start loading swcs 9ms Running Total: 88ms
    Loaded 34 SWCs: 740ms
    precompile: 1062ms
    Required RSLs:
        http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/framework_4.5.0.20967.swz with 1 failover.
        http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz with 1 failover.
        http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/spark_4.5.0.20967.swz with 1 failover.
        http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/sparkskins_4.5.0.20967.swz with 1 failover.
        http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/mx_4.5.0.20967.swz with 1 failover.
    Files: 540 Time: 3380ms
    Linking... 27ms
    SWF Encoding... 18ms
    /.../SimplePrj/deploy/SimplePrj.swf (80059 bytes)
    postcompile: 45ms
    Total time: 4259ms
    Peak memory usage: 81 MB (Heap: 62, Non-Heap: 19)
    I had to copy the swz to deploy folder since failovers are not yet available.
    * accessing from windows machines it loads swz without complaints.
    Jaco

  • Error #2046: The loaded file did not have a valid signature.

    I have three different applications which suddenly stopped working with this error
    Error #2046: The loaded file did not have a valid signature.
    None of the sites has been touched in Months, I assumed they would keep working the way they had.
    I wonder how many other sites are experiencing this and how many PO'd customers there are out there??
    This is really bad business practice, what is causing it?
    Dan Pride
    Note: the three were developed around the same time, one domain went down for a few days and was then renewed????

    Daniel... have you found a solution to your problem?
    I am also having the same problem. I was googling with no avail, when I noticed you added this post just yesterday,
    so I am thinking that adobe has done something to the swz files hosted on thier servers.
    Can someone from Adobe confirm if anything was done to either swz files or the crossdomain files on their end?
    I am in the same boat as you... no changes on our side, but the application has suddenly stopped working.
    We were building against a beta build of flex 4 (4.0.0.10485)
    I wonder which sdk version you are using?
    Here is what I see through the debugger...
    Warning: Ignoring 'secure' attribute in policy file from http://fpdownload.adobe.com/pub/swz/crossdomain.xml. The 'secure' attribute is only permitted in HTTPS and socket policy files. See http://www.adobe.com/go/strict_policy_files for details.
    [SWF] C:\Inetpub\wwwdata\xxxxxxxxx_Application.swf - 847,661 bytes after decompression
    Error #2046: The loaded file did not have a valid signature.
    Failed to load RSL http://fpdownload.adobe.com/pub/swz/flex/4.0.0.10485/framework_4.0.0.10485.swz
    Failing over to RSL framework_4.0.0.10485.swz
    Error #2046: The loaded file did not have a valid signature.
    PS... I have tried multple PCs (XP, Vista, Server 2008) with different versions of flash player (10.0.45.2, 10.0.22.87)
    Any help appreciated.

  • Anyone know what is Error #2046: The loaded file did not have a valid signature

    can anyone help me solve this issue? when i try to run project or make swf file
    Error #2046: The loaded file did not have a valid signature
    show up. how do i get a valid signature? or it show up because it is a trial version?
    please help me!!

    Hi Ryan,
    Please see this recent post: http://forums.adobe.com/message/3277736#3277736
    Your best option is to open your project in the shipping version of Flash Catalyst CS5 and re-publish it.  Catalyst CS5 can open projects that were created with the beta 2 release (October 2009) or newer.
    If your project won't open, then it was probably created in an earlier beta/alpha version of Catalyst.  If you know how to write Flex code, with some work you can upgrade these old projects by hand: import the project into Flash Builder 4 and then resolve any problems you encounter with compiling and running the project.
    Sorry for the trouble -- hope this info helps,
    - Peter

  • Publishing the swf file in Captivate 8: videos unable to load

    This is my first time using Captivate. I am still using the free version of Captivate 8 from a Mac. I have created an online module for my college e-Learning course but, I can't get it to upload right anywhere! I am trying to upload the swf. file to Google Sites but the videos display a connection error message and never play. I have read everything I could online but nothing is working for me. I tried uploading a SCORM zip file to Coursesites and got an error message as well. I am not sure what I'm doing wrong...

    I have not upgraded at this time, but I can if that will fix the issues I'm having with the published files.
    To clarify, my project is NOT a responsive project. I'm just selecting HTML5 on the publish. And I am testing it locally, on our company server, and online. The drag and drop does not work in any instance of the index.html any of these locations.

  • XML Fetch Error. The XML file assigned in the configuration.xml is either wrong or corrupted.

    1.Some web pages give "XML Fetch Error. The XML file assigned in the configuration.xml is either wrong or corrupted".
    2.Youtube gives, after pressing start button, message"An error occurred. Please try again later.
    Opening same youtube page with IE, there is no problems.
    3.Scrolling on Mozilla firefox pages works only with sidebar not with mouse wheel.
    Other user accounts on this computer doesn't have these problems.
    BR, Juha

    This can be caused by a recent Flash 11.3 update.
    See:
    *https://support.mozilla.org/kb/flash-113-doesnt-load-video-firefox

  • Adobe Acrobat gives an error message "The key file is missing, canceled"

    Hi,
    Adobe Acrobat gives an error message "The key file is missing, canceled" this is a direct translation of the Finnish error message. Acrobat is already re-installed. The operating system is Windows Server 2008 R2, and there is also installed Adobe Reader X.
    BR
    Heikki

    Please let us know do you see this error on every launch of Acrobat?
    Recommended is to have latest version of Acrobat and Reader. i.e. 10.1.8
    Try updating application and then see if you still encounter the error.

  • HT1848 I cannot authorize my computer, I'm having this error message The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed." please hel

    cannot authorize my computer, I'm having this error message The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed." please help me

    Doublechecking. In the course of your troubleshooting to date, have you worked through the instructions from the following document?
    iTunes: Missing folder or incorrect permissions may prevent authorization

  • HT1933 I bought six songs using my itunes gift card in February but I cannot play the songs or downlaod them to my ipod because I get an error saying the original file could not be found.  I have used the gift card previously with no issue.  How do I fix

    I bought six songs using my itunes gift card in February but I cannot play the songs or downlaod them to my ipod because I get an error saying the original file could not be found.  I have used the gift card previously with no issue.  How do I fix it?

    Have you moved or deleted those tracks on your computer (the gift card has got nothing to do with it) ?
    You might be able to re-download them via the Purchased link under Quick Links on the right-hand side of the iTunes store home page on your computer's iTunes (re-downloading isn't possible in all countries) - if those songs appear there then delete the entries from your iTunes library (where you are clicking on them to play them and gettinf the 'original file' error), and they should then get a cloud symbol against them for re-downloading.
    If they don't appear in that link then have you got them on, for example, an external drive ?

  • Detect end of the .swf file from captivate

    Hi,
    I've a .swf file sent by our clients. They want to put that .swf file on the webpage. The .swf file is published from captivate.
    Now they want to display a submit button on end of the .swf (video). I don't know how to detect end of the video.
    Need help...!!!
    Thank you,
    Himadri

    Welcome to our community
    Within Captivate you are able to choose different actions to occur when the Captivate movie completes play. Of course if you don't have Captivate and the project file you are pretty much stuck with what you have. If you *DO* have access to the source, you would then configure the end action to be what you like. Perhaps execute some JavaScript, load a different page, etc.
    If you don't have access to the source file, you may be better off asking whomever provided the SWF to you to make a small change to the end action. They would then compile a new SWF and provide that to you to use.
    You just said a "Submit" button should appear after the video plays. What exactly is this button supposed to do?
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • [Flex SDK in Linux] Errors running a .swf file

    Hi! Trying to set up flash development on my linux machine. Using FDT in Eclipse. The version of Flex sdk I have is 4.6.0.23201-2.
    I have in the first place had problems running the project. It gets terminated instantly and I get this output in my terminal:
    [Info] Listening to port 7935.
    Using Flex SDK 4.5 Debugger Adapter.
    [Info] Could not connect to the player, will try to connect for the next 72000 ms
    [Info] Listening to port 7935.
    [...etc etc...]
    [Info] Could not connect to the player, will try to connect for the next 8000 ms
    [Info] Listening to port 7935.
    [Info] Could not connect to the player, debug session stopped. Maybe you do not have the Debug Flash Player installed.
    Does "the Debug Flash Player" here mean Flex?
    And this is what happens when I run the .swf file that is compiled by FDT (Using Flex..), in Flex: http://justpaste.it/dlr3
    Any idea what could be the problem? Thanks!

    Hey Mark,
    Thanks for replying.  It's a standalone swf.  I'm still stuck on this issue.  It seems like it would be simple but it's baffling me.

  • It was found an error in the OPF file: The file is not stored in Cover guide . To ensure the navigation on Kindle devices, you should correct that.

    Hi,
    I have found errors when uploading the ePub 3 fixed layout classic ebooks on Apple.
    It was found an error in the OPF file: The file is not stored in Cover <guide>. To ensure the navigation on Kindle devices, you should correct that.
    Please help me?
    Thanks,
    CK

    Thank you but please help me solve this problem.
    Kindly look at the below error:
    It was found an error in the OPF file: The file is not stored in Cover <guide>. To ensure the navigation on Kindle devices, you should correct that.
    Please let me know how it will solve.
    Thanks,
    CK

  • It was found an error in the OPF file: The file is not stored in Cover guide .

    Hi,
    I have found errors when uploading the ePub 3 fixed layout classic ebooks on Apple.
    It was found an error in the OPF file: The file is not stored in Cover <guide>. To ensure the navigation on Kindle devices, you should correct that.
    Please help me?
    Thanks,
    CK

    Thank you but please help me solve this problem.
    Kindly look at the below error:
    It was found an error in the OPF file: The file is not stored in Cover <guide>. To ensure the navigation on Kindle devices, you should correct that.
    Please let me know how it will solve.
    Thanks,
    CK

Maybe you are looking for