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!

on and off state buttons

Status
Not open for further replies.

luckyy

Technical User
Sep 29, 2001
40
AU
How would I assign lingo to a button which for example, on mouseUp turns a separate graphic/or sound on, (and the button changes cast members to a down state), then clicking the down state button turns the graphic back on?

I only know how to assign the behaviour to the original sprite in the score, but not to the member which will display after the button is clicked (ie the down state).

get my drift?


thanks..
 
You don't have to attache any behaviours when changing members coz the script is attached to the sprite

So on mouseEnter you can change it to something, then on mouseDown something else and mouseUp something else...

get my drift ;-)

Mayuresh
 
What about if a button is a graphic of a switch in the off state, on mouseUp it changes something (in this case trackEnable for a quicktime track), and the button changes to an on state member - then the switch stays in the on state (and the track remains enabled) until it is clicked again and it changes back to the off state - the member changes back to the off graphic (the track is turned back off)..

get my vibe?
 
Have a property variable and store either on of these default values: TRUE or FALSE
Then on each click set the value to
variableName = not(variableName)
That way you know if it's On or Off and then you can do the necessary things accordingly.

HTH
Mayuresh
 
ok i'm getting it, but where do I assign the on mouseUp script, so it works on the original member in the score as well as the member which will replace it (the down state graphic) after the first click?

I would usually apply it to the member in the score, if it remained the same, as i don't usually need the graphic to change...

thanks for your help,,
(wew are a bit slow on the uptake down in Australia)
 
Hi.

Only in the cast are all your imported media called Members. Once on the stage o score, they are called sprites.
You need to place the script on the sprite itself.
At runtime, when you change the member to show the "On" or "Off" states, the script does not need to be reassigned coz, you have assigned it to the sprite and not the member. So whatever the member of the sprite is immaterial.

Mayuresh
 
it's all fallen into place,,,,thanks very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top