10 Replies Latest reply on May 18, 2006 2:00 AM by norrisoft

    LoadVars -- want to access mc without _root

    nicknameforme Level 1
      Below is the code I''m using. In a nutshell, I'm trying to load some HTML text from a php page. I want to divide the text into a number of textfields which are inside a movieclip called articles_panel. I can access articles_panel if I use _root.articles_panel, but since I might insert this SWF into another movie I'm trying to avoid using _root. However _parent doesn't work. How can I access the textfields inside this movie clip?

      var article_news_raw:LoadVars = new LoadVars();
      article_news_raw.onData = function(src:String):Void {
      if (src != undefined) {

      article_array = src.split(",,");

      //********************************************
      //CREATE Array of Textboxes
      //
      //var article_array:Array = ["testing one", "testing two", "testing three"];

      for (i in article_array) {
      var article_name = "article_"+i;
      _root.articles_panel.createTextField(article_name, _root.articles_panel.getNextHighestDepth(), 300+(150*i), 230, 150, 300);

      _root.articles_panel[article_name].border = true;
      _root.articles_panel[article_name].multiline = true;
      _root.articles_panel[article_name].wordWrap = true;
      _root.articles_panel[article_name].html = true;

      _root.articles_panel[article_name].text = article_array ;

      }



      }
      else {
      my_txt.text = "Unable to load external file.";
      }
      };