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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Roll Over Function To Bring Up Info

Status
Not open for further replies.

candle20

Technical User
Aug 1, 2002
7
GB
I currently have a diagram which I need to become active. When the cursor moves over areas of the diagram I need various paragraphs of information to appear along side. Could anyone suggest a simple way of doing this which doesn't involve too much lingo (if any) as I have only recently been working with director.
Cheers
Steve
 
Are the different areas of the diagram all seperate sprites, or is it all one sprite. If its one big sprite, that will be more difficult.
 
The diagram is split, it's more of a flow chart so it wouldn't be a problem to make each one a separate area.
 
Ok what I would do is make each topic or whatever a seperate sprite. With this having been done, create a textbox along side your chart. This will hold the paragraph about whatever topic you click on. Name this text member something like topicParagraph Then, make all you text members (just keep them in the cast). Name them someting like topic1, topic2, etc. Next make a behavior script like this:

on mouseenter me
case me.spritenum of
1:member("topicParagraph").text = member("topic1").text
2:member("topicParagraph").text = member("topic2").text
3:member("topicParagraph").text = member("topic3").text
end case
end

Next apply this (drag it from the cast to the sprites) script to all the seperate parts of your diagram. The way this scirpt works is simple. Based on what the sprite number is of the part of the chart you click on is, it puts into the paragraph textbox the contents of a specified text member. What's nice about a script like this is that you only need 1 script for all your sprites. If this doesn't work right or you need some help, just ask.

 
Hi there,
Don't know if you can help a bit more, I set up the whole script and process as you described. I have eleven sprites whithin a flow chart which are now active roll over buttons, the topic paragraph is set up along with all eleven text sections (in my cast) which should appear within the topic paragraph. The script is attached to each one of these roll over buttons but when I run the movie the text does not appear in the topic paragraph. I'm sure it's just a simple thing I've missed off but I just can't seem to find any area that's different to the way you have suggested.

Do the numbers at the beginning of the behaviuor script refer to anything or just there for numerical order? i.e;
1:member("topicParagraph").text=member("topic1").text
 
Thoes numbers are very important. They are the conditions of the case statement. A case statement is basically a long list of if statements.

case me.spritenum of
1:member("topicParagraph").text=member("topic1").text
--if the sprite number is 1 then do this
2:member("topicParagraph").text=member("topic2").text
--if the sprite number is 2 then do this
3:member("topicParagraph").text=member("topic3").text
--if the sprite number is 3 then do this
end case

So the numbers by the statements specify the number sprite (location in the score) that causes the proceeding text to appear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top