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

Simple Rollover question (i pressume) 1

Status
Not open for further replies.

Butters261285

Programmer
Jan 2, 2006
29
GB
I am making an educational program for a school i have a section with a collection of buttons with question marks on them.

I used the built in rollover member change function and this works fine. What i would like it to do is, when the question mark is hovered over on a button, it changing to the rollover image lets say 'teeth' as an example.

Now when clicked it will go to the frame that contains this data about the teeth. I've managed that much, but when i move off the teeth button it goes back to being a question mark. Is there a way of staying as the rollover image permanently once clicked.???

So to start the kids would have a collection of Question mark buttons but as they clicked them they stayed as the topic that they are, in a 'revealing as they go along' fashion.

Any help is much appreciated ^_^

Peter Butler
Tandokuno Design
 
You have to write custom button behaviour something like this. You need a button base graphic in one sprite channel and the question mark is immediately on top of the button base.

[tt]-- Behaviour attached to the button base
global gVisited

on beginSprite me
if gVisited then
sprite(me.spriteNum + 1).member = member("teeth")
else
sprite(me.spriteNum + 1).member = member("question mark")
end if
end beginSprite

on mouseEnter me
sprite(me.spriteNum + 1).member = member("teeth")
end mouseEnter

on mouseLeave me
if not gVisited then
sprite(me.spriteNum + 1).member = member("question mark")
end if
end mouseLeave

on mouseUp me
gVisited = true
go "teeth"
end mouseUp
--[/tt]

Kenneth Kawamoto
 
This script works perfectly !!

Thankyou so much Kenneth you're awesome!!

Peter Butler
Tandokuno Design
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top