Mouse Over Functionality (or simulation)

Hi,

I have a dropdown box in a flash forms application, which I am populating the content of from the database. The content in the dropdown box is truncated to the first 35 characters if the text runs over the space allowed in the dropdown. When the item is selected, the full text from the database is populated in a text field further down on the screen.

What I want to be able to do, is when hovering over any of the fields in the dropdown box, display the full text in a peripheral box that will appear upon mouseover, simulating the effect in HTML when an image has an alt tag, or a text field or area has a title tag. Once the item is selected, that information will dissappear, and the full contents will be submitted in the field below as normal.

Can anyone give me any tips or suggestions on how to make this happen?
liltygaAsked:
Who is Participating?
 
BillystyxConnect With a Mentor Commented:
to round it out:
on(itemRollOver){
msg._x=_root._xmouse;//msg instance name of textfield
msg._y=_root._ymouse;
msg.text=this.getItemAt(eventObj.index).label;
msg._visible=true;
}  
on(itemRollOut){
msg.text="";
msg._visible=false;
}

Billystyx
0
 
negatyveCommented:
Which version of flash are you using?
0
 
liltygaAuthor Commented:
Flash MX 2004 Pro
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
BillystyxCommented:
this is the basic idea:
put this code on the combobox
on(itemRollOver){
   trace("Item #" + eventObj.index + " has been rolled over.");

}

billystyx
0
 
liltygaAuthor Commented:
thanks Billystyx,

I want to make sure I'm implementing this correctly. I should be putting this in the actionscript area of the comboBox component itself, and have a textarea component on the stage which has the instance name, is that right?
0
 
BillystyxCommented:
yes, that's right.
The instance name of the textfield is msg, and you add all the code above to the actual components action script editor window.

billystyx
0
 
liltygaAuthor Commented:
thanks again,

in the comboBox field, I have the following as:

on(itemRollOver){
      trace("Item #" + eventObj.index + " has been rolled over.");
        trace(this);
}
on(itemRollOver){
msg._x=_root._xmouse;//msg instance name of textfield
msg._y=_root._ymouse;
msg.text=this.getItemAt(eventObj.index).label;
msg._visible=true;
}  
on(itemRollOut){
msg.text="";
msg._visible=false;
}

On the same screen that the comboBox exists, i have a textArea component that I have given an instance name of msg to for testing purposes. When i test the movie, the trace works fine, but the itemRollOver and itemRollOut doesn't display anything in the textArea.  Any thoughts?
0
 
liltygaAuthor Commented:
duh...all I had to do was add '_parent.' in front of msg, so that the box would display.
Can you tell me how I might be able to make the box which appears do so above the item selected, without having to maually set the x/y coords away from the comboBox?
Thanks so much for your help!
0
 
BillystyxCommented:
dep=_root.getNextHighestDepth();
attachMovie("box","box",dep);//box in your library, with linkage identifier set to 'box'
box._x=_root._xmouse;
box._y=_root._ymouse;

and on rollout
_root.box.removeMovieClip();
billystyx
0
 
BillystyxCommented:
put your textfield inside that mc, with variable name _root.msg
0
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.

All Courses

From novice to tech pro — start learning today.