• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

Guest
Jun 17, 2011 Jun 17, 2011

Copy link to clipboard

Copied

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.

Views

569

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 17, 2011 Jun 17, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines