Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Newbie here. I'm creating a network diagram, and for each item (laptop, database, web server) I need to update text in an area of the screen with details for that object. I do not know whether to loadimages (can't figure it out), show/hide images, or ju

New Here ,
Sep 03, 2015 Sep 03, 2015

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!

TOPICS
ActionScript
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 03, 2015 Sep 03, 2015

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)?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 04, 2015 Sep 04, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 04, 2015 Sep 04, 2015

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:

  • Click to load/unload SWF or image
  • Click to load image from library  (there is no unload pair to this, and not specific to movieclip?)
  • Add instance from library
  • Remove instance from Stage
  • Load external text


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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 04, 2015 Sep 04, 2015

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]);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 04, 2015 Sep 04, 2015
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines