2011-10-29 21 views
0

私は素晴らしいWebappを持っています。私は今私たちの内部使用のためにデスクトップ版を作ろうとしています。私はそれを変換し、タグを "WindowedApplication"に変更しました。 Airアプリケーションを実行しようとすると、エラーが表示されます。ArgumentError:未定義の状態 'normalAndInactive'

ArgumentError: Undefined state 'normalAndInactive'. 
at mx.core::UIComponent/getState()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:10596] 
at mx.core::UIComponent/findCommonBaseState()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:10616] 
at mx.core::UIComponent/commitCurrentState()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:10370] 
at mx.core::UIComponent/commitProperties()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:8294] 
at spark.components.supportClasses::GroupBase/commitProperties()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\supportClasses\GroupBase.as:1128] 
at spark.components::Group/commitProperties()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\Group.as:886] 
at mx.core::UIComponent/validateProperties()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:8209] 
at spark.components::Group/validateProperties()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\Group.as:864] 
at mx.managers::LayoutManager/validateProperties()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:597] 
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:783] 
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180] 

私のアプリには「normalAndInactive」状態はありません。私は自分のアプリケーションに1つ入れてみましたが、何もしませんでした。私は間違って何をしていますか?

EDIT:もう少し詳しい情報が見つかりました。デバッグモードでは、エラーは次のようである私のカスタムの背景スキン、を指している:

<?xml version="1.0" encoding="utf-8"?> 
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    xmlns:s="library://ns.adobe.com/flex/spark"> 

<fx:Metadata> 
    [HostComponent("spark.components.Application")] 
</fx:Metadata> 

<s:states> 
    <s:State name="normal" /> 
    <s:State name="disabled" /> 
</s:states> 

<!-- Define a gradient fill for the background of the Application container. -->  
<s:Rect id="backgroundRect" left="0" right="0" top="0" bottom="0"> 
    <s:fill> 
     <s:SolidColor color="#FFFFFF" alpha=".25" /> 
    </s:fill> 

</s:Rect> 

<s:Group id="contentGroup" left="0" right="0" top="0" bottom="0" /> 
</s:Skin> 

答えて

3

コンポーネントのスキンクラスを作成する場合(この場合には、WindowedApplication)お肌のクラスがあること、すべての状態を実装する必要があります。コンポーネントクラスは予期しています。この場合、disabledAndInactiveとnormalAndInactiveは、実装していない2つです。 See the full list

は、お肌のクラスにそれらの状態を追加することによって、エラーを修正:

<s:states> 
    <s:State name="normal" /> 
    <s:State name="disabled" /> 
    <s:State name="normalAndInactive " /> 
    <s:State name="disabledAndInactive " /> 
</s:states> 

状態のいずれか複数が実装されているかはあまり重要ではありませんかどうか。

+0

THX!面白いことに、デスクトップアプリケーションを作成するとエラーが出るだけです。 –

+0

@ user522962ウェブアプリでは、最上位レベルのアプリケーションは、通常、normalAndInactiveまたはdisabledAndInactiveのスキン状態を定義していないApplicationタグです。したがって、これらの状態が定義されていない場合、Webアプリケーションはエラーをスローしません。 – JeffryHouser

0

使用この1代わりに

<s:states> <s:State name="normal" /> 
    <s:State name="disabled" stateGroups="disabledGroup" /> 
    <s:State name="normalAndInactive" stateGroups="inactiveGroup" /> 
    <s:State name="disabledAndInactive" stateGroups="disabledGroup, inactiveGroup" /> 
</s:states> 
+0

これは何を達成するでしょうか? – JeffryHouser

関連する問題