08.13.07

Flash CS3 / Flex Error #2136: The SWF file file:///C|/Curtism/Flash/matchWordsGameTest.swf contains invalid data

Posted in Computers, errors, Flash, Flex at 8:37 pm by Curtis J. Morley

#2136: The SWF file file:///C|/Curtism/Flash/myFile.swf contains invalid data.

Fun error that you get when compiling the swf with an external AS file as your 'Document class'. Most Likely you will get this error if you are using a document class and also have code on your timeline.

Fix :

Remove the code from your timeline or remove the Document Class

As Always Happy Flashing

7 Comments »

  1. karthick said,

    February 21, 2008 at 8:45 am

    i get this error please send me the solution

  2. johnny said,

    November 11, 2008 at 4:17 am

    Ok, so I wanted to make a external class that would build a few shapes with different properties. I wanted to create a number of shapes equal to a number that the user inputs on the main stage. Thanks to you I found out that I can’t write var myShape:myCreatedClass=new myCreatedClass(number_of_shapes) on the main time line. Can u tell me how could I use the external class and the user interaction at the same time? 🙂
    You can post a comment here. 🙂

    P.S. I now that this kind of program doesn’t need external classes but I want to learn object oriented programming in as3.

  3. Jon said,

    January 21, 2009 at 5:34 pm

    All I can say is THANK YOU!

  4. Rich said,

    February 4, 2009 at 5:30 am

    As Curtis said, removing the Document class works (if you want to keep your code on the timeline).
    Being a noobie to AS3.0 and OOP, it took me a little while to work out that removing the Document class means clearing any text out of the Document class field where you can define the link, in the ‘Properties box’
    My understanding is that the Document class is automatically found by the compiler if it (and other classes) sit in the same directory as the .fla that uses the classes. Hope this helps someone.
    Cheers,
    R.

  5. Robb said,

    March 11, 2009 at 9:11 pm

    Thanks Curtis, great job at explaining the AS3 errors. Cheers! Cheerio.

  6. Structure said,

    October 13, 2009 at 3:34 am

    Adding my experience here in case it helps someone.

    I am learning AS3 and am using an external AS document for a new class that I use to call an object from my Library to the stage. I had my external AS document specified as the “Class” under the documents “Publish” settings. I called the object on the first frame of my timeline.

    The solution was to delete the AS class from the documents “Publish” settings and add it as the class for the object in my Library.

  7. dai said,

    May 26, 2010 at 3:37 am

    it also helps if you put an embedded image inside a movieclip and link to that rather than the image directly.

Leave a Comment