2 Replies Latest reply on Jul 30, 2008 7:43 AM by Newsgroup_User

    scoping problem

    Level 7
      I have the follwing code. When I call UPDATE_INFO_BOX(); the trace window
      gets the correct path to the movie clip, but when this function is called
      from the interval, it returns undefined. I guess this is to do with scoping.
      Could anyone please tell me where i am going wrong.

      Many thanks

      mBACK.onPress=function(){
      startDrag(this._parent);
      trace(this);
      vMOUSE_INT=setInterval(UPDATE_INFO_BOX,10);
      }
      mBACK.onRelease=function(){
      stopDrag();
      clearInterval(vMOUSE_INT);
      }
      mBACK.onReleaseOutside=function(){
      stopDrag();
      clearInterval(vMOUSE_INT);
      }

      function UPDATE_INFO_BOX(){
      txtPOSITION.text=this._x;
      trace(this);
      }
      UPDATE_INFO_BOX();