0 Replies Latest reply on May 16, 2007 2:01 PM by xrum

    XML - one to many

    xrum Level 2
      hi, my xml consists of the following:
      category - each category may have 1 title and mutlipe links (link name, and url)
      below is my code.
      the problem is this: when i populate my list, it works just find, but when i click on a value,if there is more than 1 title, the gotoURL gets confused, and gives me an error.... the error makes me think that it tries to go to all 3 urls in that category, instead of just the one selected.

      any ideas on how to fix it?


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientColors="[#7dacf9, #ffffff]">

      import mx.controls.Label;
      import flash.net.navigateToURL;

      private var MyCat:XML =
      <category ID="0">
      <title>Administrative Groups</title>
      <linkTitle>Administrative Groups</linkTitle>
      <linkURL> http://www.sadf.com/isadf.pdf</linkURL>

      <category ID="1">
      <title>AO Forum Minutes</title>
      <linkTitle>AO Forums 2007</linkTitle>
      <linkURL> http://www.test.com/forums%202007.pdf</linkURL>
      <linkTitle>AO Forum Minutes 030507</linkTitle>
      <linkURL> http://www.test.com/asfa f20030507.pdf</linkURL>
      <linkTitle>AO Forum Minutes 011807</linkTitle>
      <linkURL> http://www.test.com/1807.pdf</linkURL>

      <mx:Panel width="60%" height="60%" layout="absolute" horizontalCenter="0" verticalCenter="-7.5">
      <mx:HBox width="100%" height="32" horizontalAlign="center" verticalAlign="middle" top="10" horizontalCenter="0">
      <mx:Label text="AO Hotspot Category:" fontWeight="bold"/>
      <mx:ComboBox id="cmbbooks" dataProvider="{MyCat.category.title}" />
      <mx:List width="60%" height="132" horizontalCenter="0.5" dataProvider="{MyCat.category.(@ID==cmbbooks.selectedIndex).link.linkTitle}" verticalCenter="1"
      click="navigateToURL(new URLRequest(MyCat.category.(@ID==cmbbooks.selectedIndex).link.linkURL ), '_blank')" />

      <mx:Label text="maintained by ASD" color="#7dacf9" bottom="10" horizontalCenter="0"/>