babytarantula
Technical User
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
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