Class 如何在Flex中将自定义类导入mxml文件?(动作脚本3)

Class 如何在Flex中将自定义类导入mxml文件?(动作脚本3),class,actionscript,import,Class,Actionscript,Import,我需要将我自己的类导入到mxml文件中,但总会出现一个错误,即类不能嵌套。我不知道如何使用我的类(例如:NetConn.as)。你能帮我吗 <!--language:actionscript3> <?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

我需要将我自己的类导入到mxml文件中,但总会出现一个错误,即类不能嵌套。我不知道如何使用我的类(例如:NetConn.as)。你能帮我吗

<!--language:actionscript3>
<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                            xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.eazyRadioHomeView">
    <fx:Style source="eazyRadio.css"/>
    <fx:Script>
        <![CDATA[

            include "NetConn.as";

            import myNetConn;
            var easy=new NetConnectionEx();
        ]]>
    </fx:Script>

    <fx:Declarations>
        <!-- Platzieren Sie nichtvisuelle Elemente (z. B. Dienste, Wertobjekte) hier -->

    </fx:Declarations>
</s:ViewNavigatorApplication>
-->

-->
您需要

import com.yournamespace.NetConn;
而不是

include "NetConn.as"