Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-21-2006, 05:08 PM   #1
rejectbill
Registered User
 
Join Date: Nov 2006
Posts: 1
Post Image Zoom and Pan on Rollover

Hi all,

I was wondering if anyone has any suggestions on setting something like this up. I'm not very good at programming, I'm trying to modify this code to work on rollOver instead of onClipEvent (mouseDown). I also want to stay zoomed in on rollOver and be able to pan around the zoomed image. Then, when I mouse out have it return to normal position.

onClipEvent (mouseDown) {
if (k>0) {
return;
}
zoom = true;
dir == 1 ? (dir=-1) : (dir=1); // i understand that this sets
//zooming in and out
if (dir == 1) { //this set zooming in position on mouseDown
pt = {x:_root._xmouse, y:_root._ymouse};
}
}
onClipEvent (enterFrame) {
if (!zoom) { //test for if zooming is true
return;
}
_root._xscale += dir*k*50/8; //this controls image zoom in/out
//depending on direction
_root._yscale += dir*k*50/8;
var pt2 = {x:pt.x, y:pt.y};
_root.localToGlobal(pt2);
_root._x -= (pt2.x-pt.x);
_root._y -= (pt2.y-pt.y);
k++; //this is the counter for animating the zoom
if (k == 8) {
zoom = false;
k = 0;
}
}

I think that I'd need to make my image a button and perhaps move the onClipEvent (mouseDown) script to the button as on (rollOver). I was thinking I'd have to set some global variables to make that work with this script.

One day I'll take a programming class and get this stuff down.
rejectbill is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:37 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.