views:

108

answers:

1

I put some modules in a module folder. How do I import classes with the import statement when I'm in a sub folder?

This won't work, not like classes which are in packages.
modules/SomeModule.mxml

<?xml version="1.0"?>
<mx:Module>
    <mx:Script>
        <![CDATA[
        import Fruit.Apple;
        ]]>
    </mx:Script>
</mx:Module>

Directory:

.
|-- Fruit
    |-- Apple.as
|-- Modules
    |-- SomeModule.mxml
`-- application.mxml
A: 

This should work as long as the src folder is set to the above directory and the Apple class has the correct package declaration (package Fruit { ... })

ilikeorangutans
The SomeModule.mxml class isn't in the "above folder", it's in the sub folder modules.
Tom
Do you have an error message? Because your code looks correct, so I don't really know where this thing breaks.
ilikeorangutans