PDA

View Full Version : Setbounds when object is larger than MASK


lirving
12-23-2005, 12:41 AM
I see how to play a clip inside another clip and use hittest to see that the smaller movie stays within the larger frame.

I am trying to create a viewer where the image, in this case a map, is larger than the mask

onClipEvent (enterFrame) {
if (dragging) {
// set to location of the mouse
this._x = _root._xmouse + xOffset;
this._y = _root._ymouse + yOffset;
}
if (this._x> this.xmin ){this._x = xmin };
//if (this._x< this.xmin -(width/2)){this._x = xmin -(width/2)};
if (this._y > this.ymin ){this._y = ymin};
}

As is this prevents dragging past the origin (top left corner of map)
If I uncomment the second if statement i cannot move the map right or left
if i change the commented line to //if (this._x< this.xmin - 50){this._x = xmin -(50)}; then it behaves as expected however it only moves a static (50) amount and there is no guarantee that the maps will be the same size

Maybe I am attempting to access a non existing variable or ouside its scope or something
the movie clip instance is target_item so I tried
this.width and this.width.value , target_item.width , target_item.width.value

There is an example at http://www.coffs.com.au/panzoom3.swf

point me to some code or a tutorial please

Wayne