Hey guys,

Nice to be here - really amazing site :-) Theres tons of resources, im not sure why I haven't found this place previously!!!

So Im abit of noob, you'll have to bear with my stupidity... I've only tinkered with animation before and I'm trying to get stuck in with AS.



I'm trying to do a map, which toggles between full screen, and can be moved with a holding down the left mouse button.

Ive managed to get the image to move with the mouse, but its constant - not with the click of a button... and when I gg full screen the scroll goes wrong (right and bottom don't stop at image edge)

I've been trying for quite some time and am at a bit of a lose :-( any help would be much appreciated!





This is the full screen code:

//Don't scale the movie when the stage size changes
Stage.scaleMode="noScale";
//Align the stage to the top left
Stage.align = "TL";
//Function to toggle between fullscreen and normal size
//the toggle fullscreen button calls this function when pressed
function toggleFullScreen(){
//if normal size, go to fullscreen, else go to normal size
if(Stage["displayState"]=="normal"){
Stage["displayState"]="fullScreen";
}else{
Stage["displayState"]="normal";
}
}
//Create a listener for each time the Stage is resized
var resizeListener:Object = new Object();
//Called each time the stage is resized
resizeListener.onResize = function () {
//Move the button to the center of the screen
toggleFullScreenButton._x=Stage.width/2;
toggleFullScreenButton._y=Stage.height/2;
}
//Add the listener to Stage
Stage.addListener(resizeListener);


This works well on its own...









And this is the mouse movement code, clearly not for left mouse click :-(




onClipEvent (load) {
this.swidth = Stage.width;
this.sheight = Stage.height;
this.speed = 10;
this.acceleration = this.speed/this.swidth;
this.acceleration = this.speed/this.sheight;
}
onClipEvent (enterFrame) {
_root._position = -_root._xmouse*((this._width-this.swidth)/this.swidth);
this.distance = Math.abs(_root._position-_x);
this.theX = _x;
if (this.distance>1) {
if (_root._position>theX) {
_x = this.theX+(this.distance*this.acceleration);
} else {
_x = this.theX-(this.distance*this.acceleration);
}
}
}

onClipEvent (enterFrame) {
_root._position = -_root._ymouse*((this._height-this.sheight)/this.sheight);
this.distance = Math.abs(_root._position-_y);
this.theY = _y;
if (this.distance>1) {
if (_root._position>theY) {
_y = this.theY+(this.distance*this.acceleration);
} else {
_y = this.theY-(this.distance*this.acceleration);
}
}
}