5 Replies Latest reply on May 6, 2011 4:40 PM by kglad

    Access to XML Object

    juresti Level 1

      In order to have accees to the parsed XML does all my code that needs access to it have to be within the displayResources function?? I'm trying to load some XML outside f the function and it aint workinnnnn.

       

      XMLParser.load("Q_data/string_assets/string01.xml", onFinish, null, false, true)

       

      function onFinish($success:Boolean, $parsedObject:Object, $xml:XML) { //This function gets called as soon as the XML loads and gets parsed.
          if ($success) {
              displayResources($parsedObject);
              //showImage($parsedObject);
              //trace($parsedObject.tool);
          } else {
              trace("FAILED to load XML");
          }
      }

       

      var lo:Object=new Object();
          lo.onLoadInit=function(target:MovieClip){
          target.forceSmoothing=true;
             
          holder_mc0.onPress = function() {
          holder_mc0.startDrag(false);

       

          holder_mc0.lineStyle(3,0xcccccc,100);
          holder_mc0.lineTo(_root.myWidth,0);
          holder_mc0.lineTo(_root.myWidth,_root.myHeight);
          holder_mc0.lineTo(0,_root.myHeight);
          holder_mc0.lineTo(0,0);
         
          }
          holder_mc0.onRelease = function(){
          holder_mc0.stopDrag();
         
          if (this._droptarget == "/string02") {
          this.onTarget=true;
          _root.string02.gotoAndStop(2);
          this._visible = false;
          menu_txt0._visible = false;
          zoom0._visible = false;
          this.main_txt1.setNewTextFormat(mainText);
          this.main_txt1.text = $parsedObject.tool[0].name
         
          }else{
          this.onTarget=false;
          _root.targetCircle.gotoAndStop(1)
          }}