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.
It looks like you forgot to include asfile class in MyPackage package.
public class asfile
Write import statement in MXML as 'import MyPackage.asfile;'