PDA

Volledige versie bekijken : mx:AddChild


cool4cools
%Europe/Berlin %770 %2007, 18:29
<mx:State name="Register">

<mx:AddChild id="test" relativeTo="{pan1}" position="lastChild">
<mx:VBox id="LoginBox2" verticalAlign="top" scroll="false" cornerRadius="20" horizontalAlign="center" bottom="0" top="117" right="10" left="10">
<mx:Panel width="364" height="213" layout="vertical" title="Register" horizontalAlign="center">
<mx:HRule height="20" width="95%"/>
<mx:FormItem id="userform" label="Username: " required="true" fontSize="10">
<mx:TextInput id="UserNamesInput"/>
</mx:FormItem>
</mx:Panel>

</mx:VBox>
</mx:AddChild>
<mx:SetProperty target="{UserNamesInput}"/>

<utils:UserValidator id="userCheck" source="{UserNamesInput}" property="text" triggerEvent=""/>


okeej wat er fout gaat is dat ik de UserNamesInput niet kan vinden omdat het onderdeel uit maakt van de AddChild denk ik enig idee hoe ik dit oploas of verkeerd doe?


flex zegt:
1120: Access of undefined property UserNamesInput.

TheDutch
%Europe/Berlin %802 %2007, 19:15
De State moet op het moment van validatie wel op "Register" staan anders is het TextInput component "UserNamesInput" inderdaad niet aanwezig :).

// EDIT: Verder zie ik geen </mx: State> tag.

Emveedee
%Europe/Berlin %802 %2007, 19:15
Je pad is niet in orde.

Hij zoekt naar UserNamesInput, maar die staat niet in zijn scope,
wel in this.AddChild.VBox.Panel.FormItem.TextInput,
ik weet niet of dit de goede notatie voor het pad is.
(weet niet hoe paden werken in flex, heb geen flex nl. :P).

Je zou het iig kunnen proberen :)

cool4cools
%Europe/Berlin %282 %2007, 06:46
thx

heb het opgelost een apart mxml gemaakt :D :P