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

Mouse over 1

Status
Not open for further replies.

MichelleButler

IS-IT--Management
Apr 5, 2002
73
GB
I am designing a world atlas map and when you click over a country, I can get the mouse to view text about the country with out leaving the frame. I would also like to be able to view a graphic in a certain location (ie., a map of each country) without leaving the frame using the mouse over. Is this possible. Your help is much appreciated.

Michelle
 
Yes, that is possible.
Put this code in your behavoir.

on mouseWithin
sprite(b).member=member("a")
sprite(b).locV=Vb
sprite(b).locH=Hb
end

Where b is the sprite channel number, a is the name of the graphic cast member, Vb is y coordinate for the reg. point of the graphic and Hb is the x coordinate for the reg point of the graphic on the stage (when the graphic appears on the stage.)

1. Now there is two ways to do this. First, you can make sprite b a graphic image and then move it off the stage, so the end-user will not see. Then the next two lines with locV and locH bring it out onto the stage.
2.Or you could go into the Paint editor of Director, do not create anything, just write blank in the field where you name it. It essentially becomes a cast member of nothing. So put it in the score on sprite channel b.
You do not even need the lines with locH and locV for this way; just position the blank cast member in the exact spot where you want the graphic to appear. The first line will simply switch the cast member of nothing with your graphic.

Then you probably want a handler for mouseLeave, so when you leave the country the graphic goes away.

For the first option

on mouseLeave
sprite(b).member=member("a")
sprite(b).locV=Vc
sprite(b).locH=Hc
end

The only thing different are the values for locV and locH. Hc and Vc are both the coordinates for the graphic to be offstage.

For the second option

on mouseLeave
sprite(b).member=member("blank")
end

The second option may be less work for you and easier to manage but i figured you might want more options.

Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top