Copy link to clipboard
Copied
Seems a simple thing ,but spending hours on it.
I'm just trying to mouse over a circle and have another image with text in it dsplay.
on mouseout, the image goes away.
I need to do this for about 30 images in a network diagram, all with different text popping up and then disappaering on mousout.
Please help!
Copy link to clipboard
Copied
adding and removing the images (converted to movieclips) would be one (of several) way to do that.
do you have about 30 hotspots that you can mouseover (and out)?
Copy link to clipboard
Copied
Thanks. I'm working on the main functionality before I create all the network objects. So what I understand would be to set each object in the diagram as a button, add mouseover/load image (movieclip), and mouse out/remove image (movie clip). Is that correct?
Can these target clips be positioned onload? Basically I want the description field for each object (the movieclip loaded/unloaded per network object) to populate the same rectangular area in the lower left corner of the stage.
Thanks so much for replying.
Copy link to clipboard
Copied
Just to add to my last point...my confusion is also around what commands to use, which pairs. we are discussing loading movie clips and unloading them. These will be in the library once I get the technique down. The load/unload commands I see are:
could you advise on which I should use? There should be nothing in the target field until mouseover. the clip loaded needs to be displayed in a certain location, and then removed on mouseout.
Copy link to clipboard
Copied
i would create a one transparent movieclip library symbol.
drag it from the library and overlay the first hotspot that will work like a button. position and size it to your liking. assign it an instance name, eg hotspot_0. then add the movieclip that you want to appear when you rollover hotspot_0 in the position you want it to appear. assign it an instance name of eg, image_0.
repeat the above 29 more times for your 30 hotspots and movieclips (which all be on-stage when you finish). you can use different layers for the movieclips so you can hide and unhide them to keep your workspace manageable.
create a dynamic textfield (possibly multiline) where you want your text to appear and assign it an instance name, eg tf. embed your font.
finally, add your code:
var ivar:int;
var textA:Array=['the text seen when hotspot_0 is rolled over','the text seen when hotspot_1 is rolled over',...,'the text seen when hotspot_29 is rolled over'];
for(var i:int=0;i<30;i++){
this['hotspot_'+i].ivar=i;
this['hotspot_'+i].addEventListener(MouseEvent.MOUSE_OVER,overF);
this['hotspot_'+i].addEventListener(MouseEvent.MOUSE_OUT,outF);
this['image_'+i].parent.removeChild(this['image_'+i]);
}
function overF(e:MouseEvent):void{
ivar=e.currentTarget.ivar;
tf.text=textA[ivar];
addChild(this['image_'+ivar]);
}
function outF(e:MouseEvent):void{
ivar=e.currentTarget.ivar;
tf.text='';
removeChild(this['image_'+ivar]);
}
Copy link to clipboard
Copied
One approach would be to use button symbols and have the stuff you want to have display in the Over frame. Only include the button area in the hit frame. No coding needed at all from your end.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now