flex4:如何在类中创建视图状态(代码范围)



根据本文档的adobe创建和应用视图状态是 <s:State/>是状态对象。如何在Code-Behind ActionScript类中创建视图状态?

我找到了一个简单的解决方案,我不必使用皮肤体系结构声明状态。我什至没有在我的应用程序级中声明窗口挂起的状态。解决方案是:仅在main.mxml中声明状态,并以正确的名称空间的方式声明,在我的情况下,它应该是"自定义"。这是main.mxml:

<?xml version="1.0" encoding="utf-8"?>
<custom:ApplicationClass xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark"
                         xmlns:mx="library://ns.adobe.com/flex/mx"
                         xmlns:custom="components.*">
    <custom:states>  
        <s:State name="loginState"/> 
        <s:State name="infoState"/>
    </custom:states>
    <s:Panel id="loginPanel" title="Login" includeIn="loginState" />
</custom:ApplicationClass>

我只想在不同的面板之间进行更改,因此此方法对我来说很好。当然还有其他情况,在剥皮中需要声明各州。我已经获得了此解决方案表格此链接:错误:无法解析到组件实现。

最新更新