PDA

View Full Version : making tooltipped image maps in flash


sehaitt
12-17-2007, 08:40 PM
Hello again everyone,

I'm attempting to remake a page in flash but I'm still quite new to Action Scripting.

Basically I'm trying to do something like this (http://www.shopbrodart.com/swatches/default.htm) in Flash.

Now, I have my background with the "hotspots" laid out on top of it. These hotspots are really just invisible buttons. I've been trying all day to add some Action Script to these "hotspots" to get a tooltip feature to stick to my cursor but so far no success. The tooltip should disappear when you roll off the hotspot.

I've tried this tutorial:
http://www.flashkit.com/tutorials/Tips_And_Techniques/Mouse_Fo-Sidney_d-741/index.php

..as well as a few others from that site to no avail. I am working with ActionScript 2.0, btw.

Any help would be greatly appreciated. Thanks in advance.

gnomeontherun
12-19-2007, 11:03 PM
Hi,
Without following the tutorial through, it seems like a logical approach to it. Lets try to work directly with one of the tutorials, and when errors come up figure out why. When you go through your tutorial listed, what happens? Any errors?

sehaitt
12-20-2007, 01:55 AM
Thank you for your response and willingness to help, Jeremy. Today I ended up solving the problem myself after fiddling around in Flash for a while. I'd like to share how I did it with anyone interested. All these references to the word ginger is just the name of the image I'm using as a tooltip. I'm an Action Script noob so maybe this would be obvious to all you pros out there. First just let me set this up for you.. The layers and timeline are set up something like:

Layer top: ginger_MV <--movie clip of the image I want to be tooltipped
Layer middle: gingerHS <--the "hotspot" button for the rollover boundaries
Layer bottom: background <--bg image

"ginger" refers to the instanced version of ginger_MV on the top layer, FRAME 1.

I added this action to the ginger hotspot instance on FRAME 1 :

on (rollOver) {
startDrag("ginger", true);
}
on (rollOut) {
gotoAndStop(2);
}

On FRAME 2 I inserted a blank keyframe on the ginger_MV layer.

Simple enough. This made it so when I mouseover the hotspot, the tooltipped image appears and when I roll out it disappears. But that's not all, if you would attempt to rollover the hotspot again, nothing happened. So I then added this action on FRAME 2 of the gingerHS layer; new instance:

on (rollOver) {
gotoAndStop(1);
}

Done. That solved it and seemed a lot simpler than most tutorials I was trying to emulate.

gnomeontherun
12-20-2007, 05:55 AM
Ok yes that is an option that requires very little actionscript. In the tutorials you read they most likely opted for an AS based approach, which would allow for more advanced usage of the technique as well as making it more expandable so you can load things from external sources. So its all a matter of style, and practicality. Your method would be ok for a few clips that don't change, but you would find it impractical on a larger scale, which is where AS would be able to take the weight of the work.