0 Replies Latest reply on Jun 18, 2012 2:07 AM by REY MONTAGNE

    data problem between Views

    REY MONTAGNE

      Hi,

      I have a problem to work with data between views:

       

      First views with a list populate by loading a XML file:

       

      <s:HTTPService id="srv" url="http://........liste.xml" result="resultat(event)" resultFormat="e4x"/>


                <s:List id="scrollerList" change="navigator.pushView(ActivityDetails, scrollerList.selectedItem)" left="5" right="5" top="50" height="200"

                                    dataProvider="{new XMLListCollection(new XMLList(srv.lastResult.image))}"

                                    contentBackgroundColor="#A81A1C" selectedIndex="0">

        <s:itemRenderer>

        <fx:Component>

                                              <s:IconItemRenderer label="{data.title}" messageFunction="getMessage"

                                                                                                alternatingItemColors="[0xA81A1C,0xA81A1C]"

                                                                                                color="0xA81A1C" downColor="0xffffff"

                                                                                                iconFunction="myIconFunction" verticalAlign="middle" horizontalCenter="center">

        <fx:Script>

                                                                  <![CDATA[

       

                                                                            private function getMessage(item:Object):Object{

                                                                                      return data.@title;

                                                                            }

                                                                            private function myIconFunction(item:Object):String{

                                                                                      return data.@url;

                                                                            }

                                                                  ]]>

        </fx:Script>

        </s:IconItemRenderer>

        </fx:Component>

        </s:itemRenderer>

        </s:List>


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

      <gallery>

      <image title="TEST" url="http://www.awebsites/images/piou.png">

                          <description>

                          <![CDATA[a long text here .................... ]]>

                          </description>

      </image>

      </gallery>

      In my next view, if I trace this:

       

                                                        trace( data.@url.toString() );

                                                        trace( data.@title.toString() );

                                                        trace( data.@description.toString() );

       

      It's OK for  url and title

      But description, no: surly because  <![CDATA[     but I have'nt solution .........  

       

      I need some help

       

      Many thanks