A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Custom Typing in packages gives autoformat errors

  1. #1
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560

    Custom Typing in packages gives autoformat errors

    Flash8/MX2004

    When using custom typing like var xyz:SpecialItem; and you are inside
    a package with the custom typing containing class, you'll get an error, when using autoformat (ctrl-shift-f). "Check Syntax" and compiling give no errors.

    Example :
    Code:
    class com.mcusher.SpecialItem
    {
    	function SpecialItem ()
    	{
    	}
    }
    In my Main class in the same package i try to use it:
    Code:
    import com.mcusher.SpecialItem;
    class com.mcusher.Main
    {
    	private var item:SpecialItem;
    	function Main ()
    	{
    	}
    }
    Autoformat says: "Syntax error" but there is none. (Syntax check is fine, and compiling as well).


    If the import statement is omitted (as both classes are in the same package) or in FlashMX2004 pressing autoformat, the compiler shows the following error:
    **Error** D:\Projekte\Weidmueller\testproject\com\mcusher\Sp ecialItem.as: Line 2: The class being compiled, 'com.mcusher.SpecialItem', does not match the class that was imported, 'SpecialItem'.
    {
    According to our Java ppl, i am doing everything ok...
    Is it a flash bug?

    It is not about deleting ASO files!
    My letters on the F1 key have faded, how are yours today?

  2. #2
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Hmmm...I've never had that problem...

    K.

  3. #3
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    It happens only _within_ packages...
    Currently i am trying FDT, as for complex projects the MM Flash Authoring is really unhandy anyways...
    My letters on the F1 key have faded, how are yours today?

  4. #4
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Quote Originally Posted by McUsher
    It happens only _within_ packages...
    Yeah, I use classes in packages, exactly the same way you have in your example above, without problems...

    K.

  5. #5
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    And you are using Ctrl-Shift-F for autoformat?
    My letters on the F1 key have faded, how are yours today?

  6. #6
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Quote Originally Posted by McUsher
    And you are using Ctrl-Shift-F for autoformat?
    Yeah, no errors...tested it in both MX2004 Pro and 8...

    K

  7. #7
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    I somehow don't get it...
    I have the same problem @ home and @ work.

    Would you be so kind to test my exact project:
    (Syntax check ok, error only on Autoformat in Main.as)
    Attached Files Attached Files
    My letters on the F1 key have faded, how are yours today?

  8. #8
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    looks like a bug to me, i get the same error.

    Doesn't bother me though as I never write any classes with the Flash interface. Use another editor, Flash is a poor code editor.
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  9. #9
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    Thanx Lex.
    I am currently testing FDT... much more fun programming classes/packages with it...
    AS3 will have an Eclipse Plugin as Authoring tool, if i remember correctly..
    So i would have to get used to it some time anyways
    My letters on the F1 key have faded, how are yours today?

  10. #10
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    I think it might be just a classpath thing...when I tried autoformatting the Main.as file directly from the zip file you provided, I got the AutoFormat error you descibe - but I also got a syntax error that the SpecialItem class could not be loaded...

    Once I moved the files into a directory recognized by Flash as my classpath, I got no errors at all..

    K.

  11. #11
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    Huh did you open the flp (project file)?
    As that one defines the relative classpath.. (if no fla given)

    I won't use any fix classpath as that will conflict with different versions of the same classfile in different projects..


    But thanks for checking.. seems as this bug only appears for relative classpaths..
    Last edited by McUsher; 12-15-2005 at 03:38 PM.
    My letters on the F1 key have faded, how are yours today?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center