3 Replies Latest reply on Dec 27, 2009 6:38 PM by saisri2k2

    mx:String Compile Error



      I am new flex user. I am following the Learning Flex 3 book from Alric Cole.I am currently reading the data binding chapter and seem to have hit a small roadblock. In the example using mx:String tag to explain data binding. My instance of flexbuilder is not liking the tag. It is giving me errors for mx:String tag and asks me to link visual components with IUIComponent. The error message is

      "Component Declarations are not allowed here. (Note: visual children must implement mx.core.IUIComponent).


      Hope somebody can help with this. Also what is the best place to involve in flex platform and ask questions like this.





        • 1. Re: mx:String Compile Error
          Daverms Level 3

          Hi Ananth,


          Can you please post your code here?

          • 2. Re: mx:String Compile Error
            Ananthnarayan Level 1

            Hi Dave,

            Below is the code


            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" enabled="true" >
                <mx:Panel x="10" y="10" id="testPanel" layout="vertical" title="Howdy Ya'll" width="201" height="369" paddingLeft="5">
                    <mx:Label text="My name is:" fontWeight="bold" x="10" y="14"/>
                    <mx:TextInput id="userNameTI" x="5" y="41"/>
                    <mx:Label id="dbtestLbl" text="{userNameTI.text}" />
                    <mx:CheckBox label="I'm a Flex Expert!" x="10" y="71"/>
                    <mx:Label id="ageLabel" text="My Age is :" x="10" y="112"/>
                    <mx:NumericStepper id="ageNS" maximum="120" minimum="18"  x="106" y="110"/>





            • 3. Re: mx:String Compile Error
              saisri2k2 Level 4

              Yea this is true.. you cannot use String inside any containers.. so, remove the <mx:String></mx:String>  and paste it under the root element in the MXML. i.e., put it under the <mx:application


              <mx:String>hello</mx:String>  is same as saying String i = 'hello';


              if you want to display hello in that Panel component then use <mx:Text text='hello'/>