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

Compile error when using a class by fully-qualified name

Explorer ,
Oct 22, 2010 Oct 22, 2010

Copy link to clipboard

Copied

Hi... Is it an AS3 "feature" or a FB compiler bug that I cannot use a class without importing it?

I have a statement such as

if (de.codebank.util.StringUtilities.startsWith(status.name, phase.name+"_"))
{
     ...
}

which does not compile until I import the StringUtilities class, which is pointless, of course.

The compile error mentions an unknown property "util"

Views

405

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
Explorer ,
Oct 25, 2010 Oct 25, 2010

Copy link to clipboard

Copied

Knock, knock...

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
Oct 25, 2010 Oct 25, 2010

Copy link to clipboard

Copied

LATEST

I believe this is how AS3 works. Fully qualified class types require import statement.

You use fully qualified name whenever you want to avoid ambiguity.

However, when the code is like,

import mx.collections.XMLListCollection;

var arr:mx.collections.ArrayCollection;

It works since compiler now understands that "mx.collections" is a package.

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