ActionScript Error #1093: Syntax error.
Update 2/25/2008
Description:
This is one of the least descriptive descriptions that Flash/Flex will provide you. It can be given for a number of reasons. Some that I have run into I have not found the reason for, but instead I just rewrite the entire line of code that it reports. One reason that I have found that is duplicate-able is copying code from the web and pasting it into Flash. Most especially code with quotes.
Fix 1:
Delete the line of rogue line of code and retype it from scratch.
Again I had this error and even after commenting the line of code out entirely I still received this error. Once more I deleted the code and retyped and it worked just fine. Below is the line of code commented out. Don’t beat your head on this one. Just delete and retype. I believe that this error has something to do with the copy and paste functionality within the IDE.
Bad/Good Code 1: (this code actually works after being retyped)
/*//stage.removeEventListener(Event.ENTER_FRAME, moveCar);*/
Fix 2:
Delete the quotes from the code that you copied from the web and replace them with regular quotes.
Bad Code 2:
this.thePlayer.videoSource = “main_video.flv“;
Good code 2:
this.thePlayer.videoSource = “main_video.flv”;
Fix 3:
Delete the #(pound symbol) before the color value.
Bad Code 3:
graphics.lineStyle(1, #FFFFFF);
Good code 3:
graphics.lineStyle(1, 0xFFFFFF);
Thanks to grildcheese who left a comment about Fix3 above.
Fix 4:
Do not use #include in ActionScript 3 instead use import.
Bad Code 4:
package
{
#include “myClass.as”
Bad Code 4:
package
{
import myClass;
I will continue to post reasons for AS3 error 1093 as I find them and hopefully it will help you out.
As Always, Happy Flashing
THANKS! for me fix #4 did the trick!
Hi! I found out solution to the issue I posted all we have to do was remove those 2 lines of code and it worked. Hope this helps some one!
Hi! Thanks for the solutions but I have found an error not mentioned in your list. I am getting 1093: Syntax error for #initclip. I am converting as2 to as3, pls. let me know the solution.
Thanks & Regards,
Sagar S. Ranpise
Very good! Flex and AS3 are very fussy about arguments and your fix 1 worked for me. It is just a case of sitting back and pausing sometimes.
Great! The quotes fix did it for me. Thanks a lot for providing help with this mysterious problem. It did save me a lot of time.
‘0x’ + colour.toString(16).toUpperCase()
Hi i also got this error, and i thought i would share the reasons and the fix
reason: adding a dynamicly added HEX code to a string, without the quotes around th 0x. I came accros this error when someone told me this code but forgot to mention the quotes
I have created a flash animation and I am calling this swf in flex with the following code.
It is giving error of 1093. I had added xmlFlash1.swf in src folder where mxml file exists. Can you tell me reason behind this? I have used flash action scriot 2.0 to create this animation.
Pingback: curtismorley.com » New info on ActionScript Error #1093
Your Good Code and Bad Code seem to be backwards here. I see “smart” quotes in the Good Code and normal quotes in the Bad Code.
If you use the wrong prefix for the hexadecimal numerals in the color input for lineStyle(), or beginFill() you can get the 1093 syntax error also. Ox is correct, # will give a 1093 error. Probably common knowledge but I thought I would share.