targetX and targetY position of our MovieClip when targetZ is changed to zoom in:if (k == Key.PGUP) {
offSetX = (Stage.width/2 - targetX) / targetZ;
offSetY = (Stage.height/2 - targetY) / targetZ;
targetZ += 5;
targetX = Stage.width/2 - offsetX * targetZ;
targetY = Stage.height/2 - offsetY * targetZ;
}if (k == Key.PGUP) {
offsetX = (Stage.width/2 - targetX) / targetZ;
offsetY = (Stage.height/2 - targetY) / targetZ;
targetZ += 5;
targetX = Stage.width/2 - offsetX * targetZ;
targetY = Stage.height/2 - offsetY * targetZ;
}Tags:
© 2009 Created by Rob Saunders on Ning. Create Your Own Social Network
You need to be a member of DECO2102 to add comments!
Join this social network