Adobe Photoshop パネル (Flex 3 を使用) には、次のような数値入力を受け取るテキスト フィールドがいくつかあります。
<mx:TextInput x="90" y="10" width="50" height="20" restrict="0-9" id="myInput"/>
ユーザーが数字以外を入力できないようにしてrestrict="0-9"
いますが、範囲を1〜100に制限したいと思います。
AS3 で変更イベント ハンドラーを使用して自分で実装する必要がありますか、それとも Flex がもたらすより良い解決策はありますか?
私はこれを試しました:
<fx:Declarations>
<mx:NumberValidator source="{myInput}" property="text" integerError="Enter Integer value"
minValue="1" maxValue="100" domain="int"
trigger="{myInput}" triggerEvent="change"
invalid="myInput='50';"/>
</fx:Declarations>
しかし、私は得るError: Could not resolve <fx:Declarations> to a component implementation.