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
Create Icon
Set Up Users Components
Vector Shapes - Create Spiral & Create Spiral Twist
ADisplay
Streaming Media
HTML-ingo
Animated Button
simODBCPro Xtra
Toggle ButtonsEnabled Property of a Flash Member
Wait for a DirectMedia CuePoint(Name as Reference)
 

 

 

Behavior 3state Button with Cursor change

Added on 6/24/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: KumarK

3 state Button with Cursor change

---- written for Director 8 ---
---- Kumar.K ----
---- kumark@icode.com ----

------ Custom Properties ------
property  WhereTo,RolloverCursor,Rollovermember,StandardMember,savedCursor,Clickedmember,ClickedCursor,spritenum

------ Get Behavior Description List ------
on getPropertyDescriptionList me
  set description = [:]
  if the currentspritenum = 0 then exit
  theMember = sprite(the currentSpriteNum).member
  theMemberNumber = theMember.number    
  addProp description, #RolloverCursor, [#comment: "Set the Cursor To(On Rollver) :",#format:#cursor,#default:280]  
  addProp description, #Rollovermember, [#comment: "Set RollOver Member To :" ,#format:#Graphic,#default:member(theMemberNumber+1)]    
  addProp description, #ClickedCursor, [#comment: "Set the Cursor To(On Click) :",#format:#cursor,#default:280]  
  addProp description, #Clickedmember, [#comment: "Set Clicked Member To :" ,#format:#Graphic,#default:member(theMemberNumber+2)]
  return description
end getPropertyDescriptionList
------ Get Behavior Description List ------

-- Get Behavior description --
on getBehaviorDescription me
  return
    "Change Cursor & Memer On Rollover and Click" & RETURN & RETURN &
    "This Behavior Changes the Member & Cursor of the sprite to the Specified member and Cursor." & RETURN & RETURN &
    "PARAMETERS:" & RETURN &
    "* RollOver Cursor" & RETURN &
    "* RollOver Member" & RETURN &
    "* MouseDown/Clicked Cursor" & RETURN &
    "* MouseDown/Clicked Member" & RETURN &
    "* Where To assign this Script."
end getBehaviorDescription
-- Get Behavior description --


------ Availbale for both Frame and Sprite Script ------
on isOKToAttach (me, aSpriteType, aSpriteNum)
  case aSpriteType of
    #graphic:
      return true
    #script:
      return false
  end case
end isOKToAttach
------ Availbale for both Frame and Sprite Script ------

-- Events --
on beginsprite
  StandardMember = sprite(spritenum).member
  savedCursor=sprite(spritenum).cursor
end

on MouseDown me
    repeat while the stilldown
      Sprite(Spritenum).cursor=ClickedCursor
      sprite(spritenum).member=Clickedmember
      updatestage
    end repeat
end MouseDown

on MouseWithin me
    Sprite(Spritenum).member=Rollovermember
    Sprite(Spritenum).cursor=RolloverCursor
end MouseEnter

on MouseLeave me
    Sprite(Spritenum).member=StandardMember
    Sprite(Spritenum).cursor=savedCursor
end MouseLeave
------ Events ------

 


Contact

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

Send e-mail