Here’s what I’m after: there’s a small map with a draggable rectangle (viewfinder, as it were). There’s also a large map, with most of it masked. When the user drags the viewfinder rectangle, the large masked map moves accordingly. Think of the navigator pallette in Photoshop.
So, here’s my code:
ActionScript Code:
[FONT=Courier New][LEFT]speed=[COLOR=#000080]5[/COLOR];
[COLOR=#000000]function[/COLOR] dragIt[COLOR=#000000]([/COLOR]dragger, dragged[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
dragger.[COLOR=#0000FF]onPress[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
dragger.[COLOR=#0000FF]startDrag[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#0000FF]_root[/COLOR].[COLOR=#0000FF]onEnterFrame[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
dragged.[COLOR=#0000FF]_x[/COLOR] = COLOR=#000000[/COLOR]/speed;
dragged.[COLOR=#0000FF]_y[/COLOR]=COLOR=#000000[/COLOR]/speed;
[COLOR=#000000]}[/COLOR];
[COLOR=#000000]}[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]function[/COLOR] dragNotCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
dragger.[COLOR=#0000FF]onRelease[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
dragger.[COLOR=#0000FF]stopDrag[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#808080]//dragged.stopDrag();[/COLOR]
[COLOR=#000000]}[/COLOR];
[COLOR=#000000]}[/COLOR]
dragIt[COLOR=#000000]([/COLOR]viewFinder, bigMap.[COLOR=#000080]bigTitan[/COLOR][COLOR=#000000])[/COLOR];
dragNotCOLOR=#000000[/COLOR];
[/LEFT]
[/FONT]
I’ve attached my fla.
I’m hitting around the problem, but not quite getting exactly what I’m after. Can anyone point me in the right direction? Thanks!