title: Get a href from xml file into a flash button
body: <p>I have a flash file where I'm trying to change the value of the same button depending on the image that is clicked but I can't make it work with different values (I can only make it work with a static value).</p>
  
  <p>AS:</p>
  
  <pre><code>var weblinkXML:XML = new XML();
  weblinkXML.ignoreWhite = true;
  weblinkXML.load("xml/main.xml");
  weblinkXML.onLoad = function(success) {
      trace("success = "+success);
  for (var i:Number = 0; i&lt; weblinkXML.childNodes.length; i++) {
  PPTBUTTON.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_1);
          function fl_ClickToGoToWebPage_1(event:MouseEvent):void
          {
              navigateToURL(new URLRequest("test/test.html"), "_blank");
          }
      }
  }
  </code></pre>
  
  <p>my XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
  &lt;content&gt;
      &lt;!-- general vars --&gt;
      &lt;settings&gt;
          &lt;item name="copyright"&gt;&lt;![CDATA[&lt;font letterspacing="0.5"&gt;© 2012 | &lt;a href="event:privacy,0"&gt;PRIVACY POLICY&lt;/a&gt;&lt;/font&gt;]]&gt;&lt;/item&gt;
          &lt;item name="companyName"&gt;&lt;![CDATA[&lt;font letterspacing="-2"&gt;&lt;b&gt;TANITA&lt;/b&gt;&lt;/font&gt;]]&gt;&lt;/item&gt;
          &lt;item name="companySlogan"&gt;&lt;![CDATA[&lt;font letterspacing="1"&gt;PHOTO PORTFOLIO&lt;/font&gt;]]&gt;&lt;/item&gt;
          &lt;!--mp3Url srcUrl="music.mp3"/--&gt;
          &lt;imagesPage&gt;
              &lt;image imageUrl="images/tfile_splash_pic_main.jpg" /&gt;
          &lt;/imagesPage&gt;
      &lt;/settings&gt;
  
      &lt;!-- menu --&gt;
          &lt;menu&gt;
              &lt;button&gt;&lt;![CDATA[PORTFOLIO]]&gt;&lt;/button&gt;  
              &lt;button&gt;&lt;![CDATA[ABOUT]]&gt;&lt;/button&gt;  
              &lt;button&gt;&lt;![CDATA[NEWS]]&gt;&lt;/button&gt;   
              &lt;button&gt;&lt;![CDATA[CONTACTS]]&gt;&lt;/button&gt;   
          &lt;/menu&gt;
  
          &lt;gallery gallName="Crystal Cabin Awards 2012"&gt;
              &lt;image imageUrl="gallery/tfile_gall_small_01.jpg" imagesBig="gallery/tfile_gall_big_01.jpg" buttonName="PPTBUTTON" targ="_self" href="http://www.google.com"/&gt;
          &lt;image imageUrl="gallery/tfile_gall_small_02.jpg" imagesBig="gallery/tfile_gall_big_02.jpg" buttonName="PPTBUTTON" targ="_self" href="http://www.youtube.com"/&gt;
          &lt;image imageUrl="gallery/tfile_gall_small_03.jpg" imagesBig="gallery/tfile_gall_big_03.jpg" buttonName="PPTBUTTON" targ="_self" href="http://www.yahoo.com"/&gt;
              &lt;image imageUrl="gallery/tfile_gall_small_04.jpg" imagesBig="gallery/tfile_gall_big_04.jpg"/&gt;
              &lt;image imageUrl="gallery/tfile_gall_small_05.jpg" imagesBig="gallery/tfile_gall_big_05.jpg"/&gt;
              &lt;image imageUrl="gallery/tfile_gall_small_06.jpg" imagesBig="gallery/tfile_gall_big_06.jpg"/&gt;
              &lt;image imageUrl="gallery/tfile_gall_small_07.jpg" imagesBig="gallery/tfile_gall_big_07.jpg"/&gt;
              &lt;image imageUrl="gallery/tfile_gall_small_08.jpg" imagesBig="gallery/tfile_gall_big_08.jpg"/&gt;
          &lt;/gallery&gt;
  </code></pre>
  
  <p>I realize my xml is complex but it's being used through the entire flash. Maybe I could reduce it to a stand alone xml just like:</p>
  
  <pre><code>&lt;image imageUrl="gallery/tfile_gall_small_02.jpg" imagesBig="gallery/tfile_gall_big_02.jpg" buttonName="PPTBUTTON" targ="_self" href="http://www.youtube.com"/&gt;
  </code></pre>
  
  <p>my issue is that I've tried to get the href into a variable and use it instead of "test/test.html" but it never works. </p>
  
  <p>I also realize I have a method inside a for but at this point I've iterated so much over this code that I'm unsure how to proceed.</p>