7 Replies Latest reply on Nov 13, 2009 1:23 PM by kglad

    probleme changing the value of a variable in movieclip from my scene

    savagestudio

      Hello,
      i have a probleme changing the value of a variable in movieclip from my scene. i explain: I have combobox on my scene containing categories, and in the scene i load an xml file containing links to php files that work with the combobox.
      Also on the scene i have a movieclip "filmstrip", inside this movieclip on the first frame i have a script loading the php file selected in the scene . i use a load() function with a variable "theUrl" inside like this : T.load(theUrl);.
      In my scene i want to change the value of "theUrl" inside the movieClip filmstrip. I tried filmstrip.theUrl = url; But it doesnt work

       

      the xml file
      <?xml version="1.0" encoding="ISO-8859-1"?>
      <slideshow>
      <area title1="10 Last updated" link1="link1.php"/>
      <area title1="special" link1="link2.php"/>
      </slideshow>

       

      here is the code on my scene:

       

      var link1:Array = new Array();
      var LINK:String;
      var url:String;
      var whoOn:Number;
      whoOn=0;
      var x:XML = new XML();
      x.ignoreWhite = true;
      x.onLoad = function(success) {
      var photos:Array = this.firstChild.childNodes;
      for (i=0; i<photos.length; i++) {
      _root.link1.push(photos[i].attributes.link1);
      }
      url=link1[whoOn];
      filmstrip.theUrl=url;//<<--HERE
      };
      x.load("category.xml");
      
      var cbListener:Object = new Object();
      cbListener.change = function(event_obj:Object) {
      trace(select.selectedItem.label);
      if (select.selectedItem.label == "Last updated") {
      whoOn=0;
      } else if (select.selectedItem.label == "Special") {
      whoOn=1;
      }
      url=link1[whoOn];
      filmstrip.theUrl=url; //<<-----HERE   
      };
      select.addEventListener("change",cbListener);
      
      

      here is the code inside the movie clip "filmstrip"

      var T:XML = new XML();
      T.ignoreWhite = true;
      T.onLoad = function(xml) { 
      etc etc etc }
      
      T.load(theUrl);    //<<---HERE it still undefined