Pass a variable from onEnterFrame function

I need help guys,. Can anyone point me in the right direction. I need to get the width of mc and pass it to a global variable that i can use.

Heres the code sample.


xCor = -3;// this value is actually in the xml so it depends whether its negative or positve
var dragitem:MovieClip = _root.createEmptyMovieClip("new_item"+dragItemTracker, root.getNextHighestDepth());

var imageBorder = dragitem.attachMovie("imageBorder", "imageBorder_"+dragItemTracker, dragitem.getNextHighestDepth());

var image:MovieClip = dragitem.createEmptyMovieClip("image", dragitem.getNextHighestDepth());

dragitem.onEnterFrame = function() {
         imageBorder._width = image._width+3;
         imageBorder._height = image._height+3;
         imageBorder._x = image._x-1;
         imageBorder._y = image._y-1;
         
         
         divideThis = string(imageBorder._width/2)
         if(strpos(""+xCor+"", '-', 0) == 0){ 
            _global.tmp__ = string(xCor-divideThis );
         }
         else{
             _global.tmp__ = string(xCor+divideThis );
         }
}


line_mc_ = _root.createEmptyMovieClip("line_mc", _rootgetNextHighestDepth());
line_mc_.lineStyle(2, 0xf0c02e, 100);
line_mc_.lineTo(0, 480);
line_mc_._x = tmp__;
line_mc_._y = 10;


I’ll really appreciate all the help…