2 Replies Latest reply on Jun 20, 2011 6:57 AM by Echysttas

    Flash Builder 4.5 Doesn't Know How To Cast?!

    Echysttas

      I just upgraded from FB 3 and I am starting to feel very disappointed. Fonts look horrible (antialising-wise) and code which worked perfectly now acts weird. Case in question:

       

      Dirt simple: I got a class called G3Widget with a property named Text.

       

      trace(G3Widget(sender).Text);

       

      This code COMPILES and RUNS successfully. HOWEVER:

       

      1. I get a warning on it: Access of undefined property Text

      2. I get no code assist: when I hit the . (dot) after the (sender) I get no code assist with properties of the Widget Class.

       

      What's wrong? I can't believe that FB 4.5 doesn't do what FB3 did.

        • 1. Re: Flash Builder 4.5 Doesn't Know How To Cast?!
          Echysttas Level 1

          Oh, and I forgot to mention that I get the same stupid error for this code which worked perfectly in FB3:

           

          for (var key: Object in Event_MouseDown_Callbacks) (key as Function)(sender == null ? this : sender, flashEvent, Event_MouseDown_Callbacks[key]);

           

          I get the error for (key as Function). This code is within a Function of mine.

           

          As for my original post, I just re-tested that issue in FB3 and there, when I hit . (dot) after the cast, it CORRECTLY LISTS all the members of the G3Widget Class.

           

          I've looked in the options of Flash Builder 4.5 for an hour trying to see why it behaves like it does. No luck. And it's probably not an option. It's just that, by default, it doesn't list the members of the type after you cast it, which, in my opinion, is a HORRIBLE mistake. I'm going back to FB 3.

          • 2. Re: Flash Builder 4.5 Doesn't Know How To Cast?!
            Echysttas Level 1

            I found why the nasty behavior above was happening ::- D.

             

            I usually design my classes in Enterprise Architect. Since this is a rather large project, started from of about 30 classes, I did the entire architecture in EA, then, generated the code.

             

            But, EA has poor AS3 support. And as a consequence, it has a few issues, such as the way it generates CONSTRUCTORS:

             

            public function G3Widget (name: String, parent: IG3Parent = null): void
            {
            }

             

            Spot the mistake ::- D.