• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

Actionscript for Zooming in Background when Mouse Rolls Over

Hi, I have a basic working knowledge of Actionscript and Flash and have what I hope is a simple question. I need to make an interactive map that when you rollover a button a little bubble pops up with info, like google maps. I know how to do all of that, but what I want is to have the map, which is not the button that triggers the roll over event of the bubble popping up, to scale bigger like it's zooming in when the user hovers over the pinpoint button.

Any ideas?
  • 2
1 Solution
If your map is a movieclip or button you can add a mouseover event to it. On mouseover you just set the width and height of the movieclip larger. Please specify what exactly you want to do and whether it's in AS2 or AS3.

I will give a sample for each.

If it's AS2 you just instanceName.onRollOver = function() {
map._xscale *= 1.5;
map._yscale *= 1.5;
map.useHandCursor = false; // if you do not want a cursor

if it's AS3 you do

map.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
function mouseOverHandler(event:Event):void {
map.scaleX *= 1.5;
map.scaleY *= 1.5;

kmead6Author Commented:
Hmm, I'll give that a shot. My map is in AS2. I don't want the map to zoom in when the mouse is over it unless the mouse is over a certain pinpoint though and I think what you're suggesting might make the map zoom no matter where the mouse is. Can I add a button to the map that is underneath the button of the pinpoint so they sync up? Also, if I want the map to zoom out when off the pinpoint should I just add a rollout function?

Thanks for your help!
Create a button with the up,over,down frames empty. The hit frame you put the shape of the button that when you rollover the button it will zoom the map. So you just place the button over the map where you want the pinpoint to be.

If you want to zoom out, just like you said, just add a rollout function.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now