Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need very basic help with Mouse over events

Status
Not open for further replies.

Barret

Technical User
Apr 6, 2004
4
GB
I am making a flash menu, and when the user puts their mouse over a certain image or text box, I need it to display text on another part of the page. This text box must change depending on what item the mouse is over, and when the mouse is not over any of them it needs to display a default(overview) text. How can this be accomplished in Flash 5? Thanks in advance!
 

...I need it to display text on another part of the page...


But is it in the same movie?

Define that textbox display with a variable such as display_text.
At the beginning of your movie define another variable as default_text.

default_text = "This is the default text!";
display_text = default_text;

Then on your buttons scripts add the following:

on(rollOver){
display_text = "This button's display text!";
}
on(rollOut){
display_text = default_text;
}

You might also have to add that last line on press or release actions, depending on what those actions actually do in your movie! Regards,

oldman3.gif
 
I was trying to follow those directions with my limited knowledge and was not quite able to. I figured out I needed to convert the images to symbols(buttons) but I could not figure out how to "Define" text boxes, and define movie variables. I hope what I wrote makes enough sense for somone to help. Thanks Again!
 
You're the one that talked about a textbox... I assumed you knew how to create one!
Are you using Flash 5 or MX. Regards,

oldman3.gif
 
I know how to create a text box...with the A button. I am using flash 5. I just cant figure out how to define it or whatever you were talking about so I can refer to it when scripting the mouse rollover and rolloff events.
 
I ment create a dynamic textfield. Set the variable to display_text. You're done!

On the first frame of your main scene (it could be the only frame in the movie!), set these variables exactly with:

default_text = "This is the default text!";
display_text = default_text;

Then on your buttons scripts add the following:

on(rollOver){
display_text = "This button's display text!";
}
on(rollOut){
display_text = default_text;
}

Simple, no?
Regards,

oldman3.gif
 
Thanks for your help. I have one last question. If I convert a text box on a page into a button, it is only a button when your mouse is over the actual letters. Is there a way to make it so the hot spot is the whole text box? Thanks a bunch!
 
You probably mean converting text and not a text box, into a button, and yes you can edit the hit state (once you text has been converted into a button), where you would draw a rectangle covering the whole area of the text used. Then this area (not visible!) becomes the clickable area, as opposed to only the charaters themselves. Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top