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

About button states...

Status
Not open for further replies.

proggie

Technical User
Jul 13, 2000
13
VE
Thanks a lot for your kind attention.

I have problems making "clickable" bottons.

With Director 6 I tried using the button wizard (button editor) included with that edition, and since I´m
using alphamania and photocaster, the wizard will not work properly.
Then I tried using the "long way" for making buttons (gif-images) with the respective scripts:

On mouseenter
set the visible of sprite 3 to¬
false
set the visible of sprite 2 to¬
true
end

then...
On mouseleave
set the visible of sprite 2 to¬
false
set the visible of sprite 3 to¬
true
end

then...

On mousedown
set the visible of sprite 1 to¬
true
set the visible of sprite 2 to¬
false
Updatestage

end


Problems thet I had:

When the pointer of the mouse got into the "rollover", the image changed blinking constantly,
and then it stayed that way and did not turn back into the normal state, when I got to see
the pushed state, it changed rapidly, turning back into the normal state, without the mouse
being "clicked up".

Can anyone give me a hand with this little trouble?
Is there a more secure and "neater way to make these "state buttons"?

Thanks a lot, once more for your kind attention and appreciated help,
a friend:

Nikita Borova
 
property spritenum
on mouseenter
sprite(spritenum).member = "member to switch to"
end

on mouseleave
sprite(spritenum).member = "member to switch to"
end

on mousedown
sprite(spritenum).member = "member to switch to"
end

on mouseup
sprite(spritenum).member = "member to switch to"
end

this way you only use one sprite channel.
You can get a bit more fancy by using specific nameing conventions, eg button1,up button1,over button1,down
then your code would look like

property spritenum
on mouseenter
sprite(spritenum).member = item 1 of sprite(spritenum).member.name & ",over"
end

on mouseleave
sprite(spritenum).member = item 1 of sprite(spritenum).member.name & ",up"
end

on mousedown
sprite(spritenum).member = item 1 of sprite(spritenum).member.name & ",down"
end

on mouseup
sprite(spritenum).member = item 1 of sprite(spritenum).member.name & ",up"
end


another way is to use a behaviour with properties that you can set at design time but I think its a bit slow doing it that way. If you want to know how reply to this post and I'll add it on.

What this will allow is for you to drop this script on any button that follows the nameing convention and it will instantly have working button behaviour.I think D6 had dot syntax, if not reply and I'll post a non dot syntax method...I don't actually remember how to use non dot syntax anymore.
remember that D6 allows you to drop more than one script on a sprite so you can put what happens when they click in a different script and attach that too.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top