#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
it also helps if you put an embedded image inside a movieclip and link to that rather than the image directly.
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.
Thanks Curtis, great job at explaining the AS3 errors. Cheers! Cheerio.
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.
All I can say is THANK YOU!
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.
i get this error please send me the solution