Can anyone help with AS paths in this?

I have finished customizing this 360 degree panorama viewer from an example I found. Now I need to load this as a SWF into another movie.

Since I am loading this into another SWF, and the asolute paths could change, [color=Red]I need to get all the actionscript calls relative, not absolute[/color]. Can anyone fix this for me, or give me some hints?

Here is some of the code:

onClipEvent (enterFrame) 
{	
	if (_xscale > myscale*10) {
		_xscale = myscale*10
		_yscale = myscale*10		
	}
	if (_xscale < myscale*minXs) {
		_xscale = myscale*minXs
		_yscale = myscale*minXs
		minXT = true
	}
	if (_root.arrower.zoomin) {		
		lastX = _x
		if (minXT <> true) {
			_x = obj_x * _root.arrower.scalefactor
			_x += _root.x
		} else {
			_x = lastX
			minXT = false
		}
		_y = obj_y * _root.arrower.scalefactor
		_y += _root.y
	} else {
		_x += _root.dx
		_y += _root.dy
	}
	actual_W = getProperty(_level0.img, _width)
	actual_XF = getProperty(_level0.img, _xscale)/100
	actual_WXF = init_width * actual_XF
	actual_R = (_root.img._x + actual_WXF/2 + (h-1)*actual_WXF) 
	actual_L = (_root.img._x - actual_WXF/2 - (i-1)*actual_WXF)
	actual_T = (_level0.img._y - _level0.img._height/2)
	actual_B = (_level0.img._y + _level0.img._height/2)
	minY = 0
	maxY = _root.movieH
	minX = 0
	maxX = _root.movieW
	if (actual_L >= minX) { 
		if (_root.panorama){
			_x = _width/2
		} else {
			duplicateMovieClip (_level0.img.central, "left"+i, i+10000)
			prevL = "left"+(i-1)
			prevLX = getProperty(prevL, _x)
			setProperty("left" + i, _x, prevLX - init_width)
			 i = i + 1
			for(iDel=1; iDel<h; iDel++) {
				removeMovieClip("right"+iDel)
			}
			h = 1	 
		}
	}
	if (actual_R <= maxX) {
		if (_root.panorama){
			_x = (_root.movieW - ((_width)/2))
		} else {
			duplicateMovieClip (_level0.img.central, "right"+h, h)
			prevR = "right"+(h-1)
			prevRX = getProperty(prevR, _x)
			setProperty("right" + h, _x, prevRX + init_width)
			h = h + 1
			for(hDel=1; hDel<i; hDel++) {
				removeMovieClip("left"+hDel)
			}
			i = 1
		}
	}

	if(actual_T >= minY) {_y = _height/2}
	if(actual_B <= maxY) {_y = (_root.movieH - ((_height)/2))}
	// for debugging
	actual_X = _x
	actual_Y = _y
}

onClipEvent (load) 
{
	ok = ok2 = 1
	beginX = _x
	h = 1
	i = 1
	myscale = _xscale
	minXs = _root.movieH/_height
	init_width = _root.img.central._width
	setProperty("central",_x,0)
	setProperty("central",_y,0)
}

onClipEvent (mouseDown) 
{
	obj_x = _x - _root.x
	obj_y = _y - _root.y
}

“Unexpected file format” :-/

There’s no real hint to give: you just have to replace all the _root and _level0 is the code with as many _parent as you need.

OR I believe you can lock the _root with FMX2004 (something like lockRoot = true).

OR you can use something like this: http://www.kirupa.com/developer/actionscript/tricks/relativeaddressing.htm

Uploading the file again. This is a ZIP created with Windows XP. Inside is my FLA source. This time I saved it as Flash MX.