5 Replies Latest reply on Feb 25, 2007 9:19 AM by kglad

    passing variable to a loaded movie

    David Mok Level 1
      Let's say, a movie
      loads an external MovieClip,
      using a MovieClipLoader, and locks
      the root, with code as the

      //I'd like to pass this variable
      var myVar = "Passed it to Shell";


      var lo:Object = new Object();
      lo.onLoadInit = function(target_mc){
      target_mc._lockroot = true;

      var mcl:MovieClipLoader = new MovieClipLoader();
      mcl.loadClip("ExternalMovie.swf", Shell);


      Now, once Shell is loaded, how
      do I access myVar?

      I tried _parent.myVar, which
      doesn't work. (Since Shell has
      the _root locked.)

      I changed the onLoadInit to

      lo.onLoadInit = function(target_mc){
      target_mc.myVar = myVar;
      target_mc._lockroot = true;

      and then tried to access inside
      Shell by this.myVar, which still
      doesn't work.

      I'd appreciate any suggestions.