on beginSprite me
set s=the spriteNum of me
if not alphaManiac(s) then exit
set pInterp=interpolation(pInterp)
if not EffectActive(s, #rotate) then
rotate(sprite s, [degrees:pStartDial, interpolation:pInterp])
end if
set centerAngle = ((pRightLimit - pLeftLimit) / 2) + pLeftLimit
if (((centerAngle + 360) mod 360)-90) > 90 then
set pSpeed = pSpeed * -1
end if
end
on mouseDown me
set s = the spriteNum of me
--set eighthWidth = (the width of sprite s) / 8
set centerL = ((the width of the rect of sprite s)/2) + the left of sprite s
rotate(sprite s, [animMode:#static])
repeat while the mouseDown
set curAngle = GetAngle(sprite s, #rotate)
if the mouseH > centerL then
if((curAngle + pSpeed) < pRightLimit) and¬
((curAngle + pSpeed) > pLeftLimit) then
rotate(sprite s, [deltaDegrees:pSpeed])
end if
end if
if the mouseH < centerL then
if((curAngle - pSpeed) > pLeftLimit) and¬
((curAngle - pSpeed) < pRightLimit) then
set ang = 0 - pSpeed
rotate(sprite s, [deltaDegrees:ang])
end if
end if
updateStage
end repeat
end
on getBehaviorDescription me
set msg= "Your AlphaManiac dial will rotate when it is clicked and held"
put return & return after msg
put "Parameters:" & return & "-----------" & return after msg
put "* Speed: How fast does it turn?" & return after msg
put "* Left Limit: Left extreme of dial." & return after msg
put "* Right Limit: Right extreme of dial." & return after msg
put "* Start Dial Angle: angle to start the dial." & return after msg
put "* Interpolation: On,Off,or While Paused" after msg
put return & "-----------" & return & return & ">>>" && amTip() after msg
return msg
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA