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

Import user defined actionscript classes in mxml

Explorer ,
Oct 16, 2010 Oct 16, 2010

Copy link to clipboard

Copied

Hi,

I have an mxml file -- A.mxml

I have an actionscript file asfile.as  This file has a class definition. Package name - 'MyPackage' Class name - 'asfile'

I want to import this class into A.mxml

So, I write "import MyPackage.asfile.*;" in the Script block of A.mxml. Please note that both A.mxml and asfile.as are part of the same FlashBuilder project and  are present at the same level (i.e. inside the same folder) in Package Explorer.

I get a compiler error "A file found in a source-path must have the same package structure '', as the definition's package, 'MyPackage'."

Please help me solve this issue.

Regards,

Pooja

Views

392

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

Copy link to clipboard

Copied

LATEST

It looks like you forgot to include asfile class in MyPackage package.

package MyPackage

{

public class asfile

{

}

}

Write import statement in MXML as 'import MyPackage.asfile;'

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