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
Hold on a frame till sound finishes playing
Toggle ButtonsEnabled Property of a Flash Member
Lingo MarkUp Service
Reshacker
Creating a Game Environment
BlurImage
Fade bitmap to / from pure colour behaviour
3D Quad
Parse CSV File
Date Master
 

 

 

Behavior Push Dial-Alphamania

Added on 6/10/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

Required Xtras:
Alphamania
Effector Set I for Alphamania

This item has not yet been rated

Author: MediaLab (website)

Requires Effector Set 1 Behavior Support Scripts.

Property pSpeed, pInterp, pLeftLimit, pRightLimit, pStartDial, midSlope

on getPropertyDescriptionList
  --if not alphamaniacCheck(the currentSpriteNum) then exit
  
  set pList=[:]
  addProp pList,#pSpeed,[format:#integer,comment:"Speed of dial:", Default:6, range:[min:6,max:20]]
  addProp pList,#pLeftLimit,[format:#integer,comment:"Left Limit (degrees):", Default:-90, range:[min:-360,max:360]]
  addProp pList,#pRightLimit,[format:#integer,comment:"Right Limit (degrees):", Default:90, range:[min:-360,max:360]]
  addProp pList,#pStartDial,[format:#integer,comment:"Start Dial Angle (degrees):", Default:0, range:[min:-360,max:360]]
  addProp pList,#pInterp,[format:#symbol,¬
                               comment:"Interpolation:",¬
                               Default:#On,range:[#Off,#On,#Paused]]
  
  return pList
end

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

Send e-mail