3 Replies Latest reply on Jul 18, 2007 3:43 PM by nikos_golf

    why is       .parent  = this       useful?

      Hi, what is the purpose of

      text_lv.parent = this


      var text_lv = new LoadVars();
      //refer the parent of the object in a property so we can access some function that
      //the parent have and inaccessible by the text_lv object.
      text_lv.parent = this;

      the code continues

      var img_mcl = new MovieClipLoader();
      var handler = new Object();
      var pos = 1;
      handler.ref = imageContainer_mc.imgbg_mc;
      handler.onLoadInit = function(target_mc) {
      //center the loaded image.
      target_mc._x = -target_mc._width/2;
      target_mc._y = -target_mc._height/2;
      //initialize the _alpha to 0 so we can animate the fade in effect.
      target_mc._alpha = 0;
      //this function will be explained later.
      tween(this.ref, mx.transitions.easing.Regular.easeOut, "_width", this.ref._width, target_mc._width+10, .5, true);
      tween(this.ref, mx.transitions.easing.Regular.easeOut, "_height", this.ref._height, target_mc._height+10, .5, true, _root, "finish");
      handler.onLoadComplete = function(target_mc) {
      //do nothing. trace("image loaded");
      text_lv.onLoad = function(success) { if (success) { trace("text loaded");
      else { trace("loadin failed");