0 Replies Latest reply on Jan 10, 2008 5:19 PM by molandim

    Problem with xml

    molandim Level 1
      Hello there. I am another flash developer trying to get in Flex.

      I did a component, simple one like that:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="400" height="300" >
      <mx:Script>
      <![CDATA[
      [Bindable]
      public var dataObject:Object;
      ]]>
      </mx:Script>
      <mx:VBox x="10" y="10" width="380" height="249">
      <mx:RadioButtonGroup id="radioGroup"/>
      <mx:Canvas width="380" height="68">
      <mx:Text width="359" text="{dataObject.quiz}" fontSize="15" x="10" y="10" height="48"/>
      </mx:Canvas>
      <mx:RadioButton label="{dataObject.answer1}" groupName="radioGroup"/>
      <mx:RadioButton label="{dataObject.answer2}" groupName="radioGroup"/>
      <mx:RadioButton label="{dataObject.answer3}" groupName="radioGroup"/>
      <mx:RadioButton label="{dataObject.answer4}" groupName="radioGroup"/>
      <mx:RadioButton label="{dataObject.answer5}" groupName="radioGroup"/>
      </mx:VBox>

      </mx:Canvas>


      Then I create I main application that render that component on a Repeater tag, getting the data from an xml

      <main.mxml:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" horizontalAlign="center" verticalAlign="middle" width="100%" height="100%" xmlns="*" creationComplete="questionData.send()">
      <mx:Script>
      <![CDATA[
      public var numberQuestion:Number = 5;
      public var totalQuestion:Number = 5;

      ]]>
      </mx:Script>
      <mx:HTTPService id="questionData" url="assets/questions.xml"/>
      <mx:VBox id="mainWindow" width="100%" height="100%" horizontalCenter="0" verticalCenter="0" horizontalAlign="center" verticalAlign="middle">
      <mx:Panel x="0" y="25" width="480" height="431" layout="absolute" verticalAlign="middle" horizontalAlign="center" title="Teste Actionscript v.1">
      <mx:ViewStack x="10" y="44" id="viewstack1" width="440" height="297">
      <mx:Repeater id="rp" dataProvider="{questionData.lastResult.questions}">
      <question dataObject="{questionData.lastResult.questions[rp.count]}"/>
      </mx:Repeater>
      </mx:ViewStack>
      </mx:Panel>
      </mx:VBox>

      </mx:Application>


      this is the xml:

      <questions>
      <question>
      <quiz>Qual classe mais usada para o envio de informa´┐Żoes?</quiz>
      <answer1>VarNum</answer1>
      <answer2>LoadVars</answer2>
      <answer3>XML</answer3>
      <answer4>SenderVars</answer4>
      <answer5>Connector</answer5>
      </question>
      </questions>

      The problem that the text from the xml doen't appear on the bloody component.

      Thanks