Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
cXtraJoystick
Set Display Properties
Constrain Mouse to Stage Area
Base64 Xtra
DirectSound Xtra
File Save Button
3D Rotation
authoring method docSprite()
Find Last Label
LineHiLiter
MediaMacros Xtras Mall
 

 

 

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

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail