开发者

Flex Import Class from a Module within a sub directory

开发者 https://www.devze.com 2022-12-27 13:54 出处:网络
I put some modules in a module folder. How do I import classes with the import statement when I\'m in a sub folder?

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


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 { ... })

0

精彩评论

暂无评论...
验证码 换一张
取 消