Solved

Actionscript for Zooming in Background when Mouse Rolls Over

Posted on 2009-07-10
3
370 Views
Last Modified: 2013-11-11
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?
0
Comment
Question by:kmead6
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
TanLiHao earned 500 total points
Comment Utility
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;
}

0
 
LVL 6

Author Comment

by:kmead6
Comment Utility
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!
0
 
LVL 14

Expert Comment

by:TanLiHao
Comment Utility
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.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now