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!

whats wrong with my easy script?

Status
Not open for further replies.

babytarantula

Technical User
Feb 23, 2006
6
MX
whats wrong with this script?----
I am trying to create a switch button. When you click on it, an object rotate but if you click again it stops...
theres something wrong, maybe i don't understand the function of "Property"

-- my script written in the button image-object

property switchy

on beginsprite
switchy = TRUE
on mouseup
switchy = not(switchy)

on exitframe
if switchy = TRUE then sprite(2).rotation = sprite(2).rotation + 10
if switchy = FALSE then sprite(2).rotation = 0
end if

end
 
Try:
[tt]--
property switchy

on beginsprite
switchy = TRUE
end beginSprite

on mouseup
switchy = not(switchy)
end mouseUp

on exitframe
if switchy then sprite(2).rotation = (sprite(2).rotation + 10) mod 360
end
--[/tt]

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top