Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

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?
0
liltyga
Asked:
liltyga
  • 5
  • 4
1 Solution
 
negatyveCommented:
Which version of flash are you using?
0
 
liltygaAuthor Commented:
Flash MX 2004 Pro
0
 
BillystyxCommented:
this is the basic idea:
put this code on the combobox
on(itemRollOver){
   trace("Item #" + eventObj.index + " has been rolled over.");

}

billystyx
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
BillystyxCommented:
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
 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now