Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
TaskXtra
Sprite Stick To Mouse Cursor
Sprite Blender - Time
Director Showcase Site - Behaviors, interactive examples, Lingo to ActionScript translator & more
goMU-LE (free)
Scroll Thumb Track
CD Everywhere
Firefly CD Burning Xtra
Implementing stacks in Lingo
Audio Xtra
 

 

 

Behavior RotateWithSound

Added on 7/24/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: KurtKoenig (website)

Rotate a Sprite clockwise or counterclockwise while sound behavior

Download PC Source    Download Mac Source
--Rotate a Sprite clockwise or counterclockwise while sound behavior.
---------------------------------------------------------------------
---------------------------------------------------------------------

--   Kurt Koenig * Belgium

------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------

property WhichSprite, HowFast,RotSound, ¬
WhichSound, WhichChannel, CCW

on getPropertyDescriptionList
  desclist = [:]
  
  addprop desclist, #WhichSprite, [#comment : "The rotating Sprite is Spritenumber", ¬
# format : #integer, # default : ""]
  addprop desclist, #HowFast, [#comment : "The Sprites rotation speed is", ¬
# format : #integer, # default : 5, #range : [#min:1, #max:10]]
  addprop desclist, #CCW, [#comment : "Rotate CounterClockWise ?", ¬
# format : #boolean, # default : False]
  addprop desclist, #RotSound, [#comment : "Play sound during rotation ?", ¬
# format : #boolean, # default : False]
  addprop desclist, #WhichSound, [#comment : "Choose a soundmember to play", ¬
# format : #member, # default : ""]
  addprop desclist, #WhichChannel, [#comment : "Play sound in which soundchannel (1-8) ?", ¬
# format : #integer, # default : "3"]
  return desclist
end getPropertyDescriptionList


on getbehaviordescription
  return "Rotate a Sprite clockwise or counterclockwise."&RETURN&"¬
You can set a rotation speed, and use a sound "&RETURN&"¬
while rotating.This behavior acts on mousedown."&RETURN&"¬
Drop on a Sprite to rotate directly, or drop it on "&RETURN&"¬
a button to rotate a given sprite."
end getbehaviordescription


on getbehaviortooltip
  return "Rotate a Sprite clockwise or counterclockwise"
end getbehaviortooltip  


on mousedown
  if RotSound  = true then puppetsound WhichChannel, whichSound
  repeat while the mousedown
    if CCW = FALSE then
      sprite (WhichSprite) . rotation = sprite (WhichSprite) . rotation + HowFast
    else
      sprite (WhichSprite) . rotation = sprite (WhichSprite) . rotation - HowFast
    end if
    updatestage
  end repeat
end mousedown


on mouseup me
  puppetSound WhichChannel, 0
end mouseup

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail