08.25.07

Flash CS3 / Flex 2 AS3 Error #1093

Posted in Flash, Flex, errors, quicktip at 5:42 am by Curtis J. Morley

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

3 Comments »

  1. grildcheese said,

    September 18, 2007 at 4:07 pm

    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.

  2. Jeremy Gibson said,

    November 1, 2007 at 11:28 pm

    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.

  3. curtismorley.com » New info on ActionScript Error #1093 said,

    February 26, 2008 at 2:54 pm

    [...] have posted new 2 more fixes for ActionScript Error #1093.  Thanks to grildCheese for leaving the comment about fix #3.  You can view AS3 Error #1093 here. [...]

Leave a Comment