4 Replies Latest reply on Mar 20, 2010 12:27 PM by Flex harUI

    Can not understand why it is not working, plz help.

    alcaponis

      I am a student trying to understand flex builder 3, but it is very hard and when something is going wrong I think that I will never undersand how is it working.

      Hete is my program and do not see a problem. Maybe someone could help me?

       

      MAIN APLICATION :

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" horizontalAlign="left"

      xmlns:omp="components.*" themeColor="#444444"

      backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#686868, #111111]"

      initialize="klaseServ.send(),mokinysServ.send()"

      xmlns:comp="components.*">

       

      <mx:Script>

      <![CDATA[

      import mx.collections.ArrayCollection;

      import mx.rpc.events.ResultEvent;

       

      [Bindable] private var klaseArray:ArrayCollection;

      [Bindable] private var mokinysArray:ArrayCollection;

      // PRIVATE -------------------------------------------------------------------------

      private function resultKl(event:ResultEvent):void{

      klaseArray=event.result.ROWSET.ROW;

      }

      private function resultMo(event:ResultEvent):void{

      mokinysArray=event.result.ROWSET.ROW;

      }

      // PUBLIC ---------------------------------------------------------------

       

      ]]>

      </mx:Script>


      <mx:HTTPService id="klaseServ"

      url="data/vkklase.xml"

      result="resultKl(event)" />

       

      <mx:HTTPService id="mokinysServ"

      url="data/vkmokinys.xml"

      result="resultMo(event)" />

       

       

      <mx:VBox x="0" y="0" width="100%" verticalGap="0">

      <mx:Canvas height="70" width="100%">

      <mx:Panel title="{horizontalList.selectedItem.PAVADINIMAS}"

      height="70" width="100%" layout="horizontal">

       

      <mx:HorizontalList id="horizontalList"

                          labelField="PAVADINIMAS"

                          dataProvider="{klaseArray}"

                          itemRenderer="icon"

                          columnCount="10"

                          columnWidth="30"

                          rowCount="1"

                          rowHeight="30"

                          horizontalScrollPolicy="on" />

       

      </mx:Panel>

      </mx:Canvas>

      <mx:VBox height="90" width="100%">

      <mx:Panel height="90" layout="horizontal" title="Asmuo" width="100%" backgroundAlpha="1.0">

      <mx:HorizontalList height="50" width="100%" dataProvider="mokinysArray"/>

      </mx:Panel>

      </mx:VBox>

      <mx:HBox height="15" color="#FFFFFF" width="100%" backgroundColor="#636161">

      <mx:Label id="vardasLab" text="Vardas" />

      <mx:Label id="pavardeLab" text="Pavardė" />

      <mx:Label id="amziusLab" text="Amžius" />

      </mx:HBox>

      <mx:HBox>

      <mx:VBox width="60" verticalGap="0">

      <mx:Image source="icons/photoIco.jpg" height="60" width="60"/>

      <mx:Image source="icons/photoIco.jpg" height="60" width="60"/>

      <mx:Image source="icons/photoIco.jpg" height="60" width="60"/>

      <mx:Image source="icons/photoIco.jpg" height="60" width="60"/>

      <mx:Image source="icons/photoIco.jpg" height="60" width="60"/>

      <mx:Image source="icons/photoIco.jpg" height="60" width="60"/>

      </mx:VBox>

      <mx:Canvas>

      </mx:Canvas>

      </mx:HBox>

      </mx:VBox>

       

      </mx:Application>

       

       

      ICON.MXML

       

      <?xml version="1.0" encoding="utf-8"?>

      <!-- http://blog.flexexamples.com/2008/02/15/creating-a-simple-image-gallery-with-the-flex-hori zontallist-control/ -->

      <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"

              horizontalAlign="center"

              verticalAlign="middle">

       

          <mx:Label text="{data.PAVADINIMAS}" />

          <mx:Label text="{data.KIEKMOKINIU}" />

       

      </mx:VBox>

       

       

      data/vkklase.xml

      <?xml  version="1.0" ?>
      - <ROWSET>
      - <ROW>
      <ID>2</ID>
      <PAVADINIMAS>7B</PAVADINIMAS>
      <KIEKMOKINIU>1</KIEKMOKINIU>
      </ROW>
      - <ROW>
      <ID>1</ID>
      <PAVADINIMAS>1A</PAVADINIMAS>
      <KIEKMOKINIU>2</KIEKMOKINIU>
      </ROW>
      - <ROW>
      <ID>3</ID>
      <PAVADINIMAS>7C</PAVADINIMAS>
      <KIEKMOKINIU>3</KIEKMOKINIU>
      </ROW>
      </ROWSET>
      data/vkmokinys.xml
      <?xml  version="1.0" ?>
      - <ROWSET>
      - <ROW>
      <ID>2</ID>
      <KLASE>1A</KLASE>
      <VARDAS>Paulius</VARDAS>
      <PAVARDE>Paulauskas</PAVARDE>
      <GIMMETAI>2002</GIMMETAI>
      <GIMMEN>12</GIMMEN>
      <GIMDIEN>20</GIMDIEN>
      </ROW>
      - <ROW>
      <ID>3</ID>
      <KLASE>1A</KLASE>
      <VARDAS>Saulius</VARDAS>
      <PAVARDE>Saulenas</PAVARDE>
      <GIMMETAI>2003</GIMMETAI>
      <GIMMEN>1</GIMMEN>
      <GIMDIEN>12</GIMDIEN>
      </ROW>
      - <ROW>
      <ID>1</ID>
      <KLASE>7B</KLASE>
      <VARDAS>Antanas</VARDAS>
      <PAVARDE>Antanavicius</PAVARDE>
      <GIMMETAI>1997</GIMMETAI>
      <GIMMEN>2</GIMMEN>
      <GIMDIEN>1</GIMDIEN>
      </ROW>
      - <ROW>
      <ID>5</ID>
      <KLASE>7C</KLASE>
      <VARDAS>Stasys</VARDAS>
      <PAVARDE>Stasevicius</PAVARDE>
      <GIMMETAI>1997</GIMMETAI>
      <GIMMEN>3</GIMMEN>
      <GIMDIEN>18</GIMDIEN>
      </ROW>
      - <ROW>
      <ID>6</ID>
      <KLASE>7C</KLASE>
      <VARDAS>Bronius</VARDAS>
      <PAVARDE>Broniavicius</PAVARDE>
      <GIMMETAI>1996</GIMMETAI>
      <GIMMEN>12</GIMMEN>
      <GIMDIEN>30</GIMDIEN>
      </ROW>
      - <ROW>
      <ID>4</ID>
      <KLASE>7C</KLASE>
      <VARDAS>Mantas</VARDAS>
      <PAVARDE>Mantavicius</PAVARDE>
      <GIMMETAI>1996</GIMMETAI>
      <GIMMEN>11</GIMMEN>
      <GIMDIEN>3</GIMDIEN>
      </ROW>
      </ROWSET>