Welcome, Guest
  • Author Topic: ListEvent and CloseEvent  (Read 2843 times)

    wearHD

    • Server what's that
    • *
    • Posts: 42
      • View Profile
      • Say it Green! - Organic, Fair Trade, Custom Printed Apparel
    ListEvent and CloseEvent
    « on: 08/14/07, 01:19 »
    Hi all,

    Anybody had trouble with ListEvents and CloseEvents giving the compile error: "1046: Type was not found or was not a compile-time constant: ListEvent."?  (or CloseEvent)

    As far as I can tell I have imported the package correctly ("fl.events.*").  Wondering if this is a bug of some sort?

    Also, does anyone know for sure if the Alert component is supported in AS3?  I see references to it in the AS3 documentation so I assume yes, but I'm getting this 1046 error for my CloseEvent events also (which is the event used in the AS3 documentation examples involving Alert components - see documentation "Programming ActionScript 3.0 --> Handling errors --> Example: CustomErrors application" for an example).  However, there is no reference to the Alert component as a class in the rest of the documentation, which has me a little concerned.

    If anyone has run into this compile error please let me know.  Otherwise I will keep plugging away!

    Thanks,

    Andy
    Andy Hultgren
    Say it Green!
    www.sayitgreen.com
    Organic, Fair Trade, Custom Printed Apparel

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: ListEvent and CloseEvent
    « Reply #1 on: 08/14/07, 01:42 »
    1046 is a general error that means: something is not defined. Something could be a variable, an event or an instance itself. I usually comment all my lines code, and enable one by one until I find the one where the value is missing. Alert is not an AS3 class nor a component

    Jorge

    wearHD

    • Server what's that
    • *
    • Posts: 42
      • View Profile
      • Say it Green! - Organic, Fair Trade, Custom Printed Apparel
    Re: ListEvent and CloseEvent
    « Reply #2 on: 08/14/07, 23:21 »
    Hi Jorge,

    As always, thanks so much for your help!!!  I'll try commenting lines out and see if I can locate the issue.


    Quote
    Alert is not an AS3 class nor a component

    Does that mean that Alert is not supported in AS3?  Sorry, I just want to be sure I understand correctly.  If Alert is not supported, is there a suggested replacement?  (I can't find one in the documentation).

    Andy
    Andy Hultgren
    Say it Green!
    www.sayitgreen.com
    Organic, Fair Trade, Custom Printed Apparel

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: ListEvent and CloseEvent
    « Reply #3 on: 08/15/07, 02:32 »
    Adobe choice to move all the components to Flex, leaving in Flash just a minimal set. So the Alert component and the possible replacement, the Window component have been moved to Flex. So you should build your own or stick with AS2 and Flash 8 components

    Jorge

    wearHD

    • Server what's that
    • *
    • Posts: 42
      • View Profile
      • Say it Green! - Organic, Fair Trade, Custom Printed Apparel
    Re: ListEvent and CloseEvent
    « Reply #4 on: 08/15/07, 23:33 »
    Ohhhh... that's what happened.  That also explains how an Alert component made it into the AS3 documentation.

    bummer.   :(

    AS2 isn't an option, so it looks like I have some building to do.

    Well, it's good to know. I was having trouble figuring out what was going on.  Thanks Jorge for clarifying the situation: now I know what I need to focus on!

    Andy
    Andy Hultgren
    Say it Green!
    www.sayitgreen.com
    Organic, Fair Trade, Custom Printed Apparel

    wearHD

    • Server what's that
    • *
    • Posts: 42
      • View Profile
      • Say it Green! - Organic, Fair Trade, Custom Printed Apparel
    Re: ListEvent and CloseEvent
    « Reply #5 on: 08/15/07, 23:37 »
    Oh, by the way, if anyone gets one of those 1046 errors and can't find anything wrong with their ActionScript, check the version of your components.  I was getting a 1046 error on the ListEvent associated with my combobox, and finally realized that there wasn't anything wrong with my code, it just that I had a Flash8/AS2 combobox on the stage instead of an AS3 combobox.  Oops!

    Andy
    Andy Hultgren
    Say it Green!
    www.sayitgreen.com
    Organic, Fair Trade, Custom Printed Apparel

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: ListEvent and CloseEvent
    « Reply #6 on: 08/16/07, 01:26 »
    Error 1046 means: something is not defined. Could ve a variable or a call to an undefined method, is the most common error in AS3

    Jorge