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
Happy Hour Fonts
Lingo Paradise
DirSaver
A Simple Coloring Book
How to Use Macromedia Flash 5
Change ShapeType of a Shape cast member
Font Freak
Foundation Flash 5
sequenceXtra
Flash Component Label
 

 

 

Behavior All_In_One Button Hue Shift

Added on 11/20/2000

 

Compatibilities:
behavior D6_5 D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: CicicDejan

Just attach behavior on Alphamania button sprite and set all properties and you"ll have all button functions in just one behavior.

--All_In_One Button Behavior, by Dejan Cicic, DEXSOFT Multimedia,

Property pOff,pOn,pMouseDown
property pSpeed,pClick
property myMovie,MyFrame,FrameFlag,MovieFlag,ClickSound
property OverSoundFlag,OverSound

on beginSprite me
  set s=the spriteNum of me
  if not alphaManiac(s) then exit
--set initial hue value
  hsb(sprite s,[hueShift:pOff])
end

on mouseEnter me
--set Hand cursor when rollover occurs
  cursor 280
--optional sound for rollover
  if OverSoundFlag then
    puppetsound 4,OverSound
  end if
  set s=the spriteNum of me
  if not alphaManiac(s) then exit
--set new Hue value for rollover member
  hsb(sprite s,[animMode:#Range,numFrames:pSpeed, startHue:pOff, endHue:pOn])
end

on mouseLeave me
--old cursor when mouse leave
  cursor -1
  set s=the spriteNum of me
  if not alphaManiac(s) then exit
--restore start hue values
  hsb(sprite s,[animMode:#Range,numFrames:pSpeed, startHue:pOn, endHue:pOff])
  
end
on mouseDown me
--play sound on mouseDown
puppetsound 4,clickSound
  set s=the spriteNum of me
  if not alphaManiac(s) then exit
--set hue for clicked state
  hsb(sprite s,[animMode:#Range,numFrames:1, startHue:pOn, endHue:pMouseDown])  
end
on mouseUp me
  set s=the spriteNum of me
  if not alphaManiac(s) then exit
--restore hue value for rollover member
  hsb(sprite s,[animMode:#Range,numFrames:1, startHue:pMouseDown, endHue:pOn])

--optionally you can set movie and marker name to play

  if movieFlag then
    if FrameFlag then
      play frame myFrame of movie myMovie
    else
      play movie myMovie
    end if
  else
    if FrameFlag then
      play frame myFrame
    else
      nothing
    end if
  end if
end mouseUp

on getPropertyDescriptionList
  if not alphamaniacCheck(the currentSpriteNum) then exit
  set description = [:]  
  addProp description,#pOff,[format:#integer,comment:"Off Hue (degrees):", Default:0, range:[min:0,max:360]]
  addProp description,#pOn,[format:#integer,comment:"RollOver Hue (degrees):", Default:0, range:[min:0,max:360]]
  addProp description,#pMouseDown,[#format:#integer,comment:"MouseDown Hue (degrees):" ,Default:0, range:[min:0,max:360]]
  addProp description,#pSpeed,[format:#integer,comment:"Frames:", Default:10]
  addProp description,#MovieFlag, [#default : false, #format:#boolean, #comment:"Movie (optional)"]
  addProp description,#MyMovie, [#default:"", #format:#string, #comment:"Jump to movie"]
  addProp description,#FrameFlag, [#default:false, #format:#boolean, #comment:"Marker (optional)"]
  addProp description,#MyFrame, [#default:"", #format:#string, #comment:"Marker name:"]
  addProp description,#ClickSound, [#default:"", #format:#sound, #comment:"Click Sound member:"]
  addProp description,#OverSoundFlag, [#default:false, #format:#boolean, #comment:"Sound on RollOver (optional)"]
  addProp description,#OverSound, [#default:"", #format:#sound, #comment:"RollOver Sound member:"]
    return description
end

 


Contact

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

Send e-mail