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
Set ButtonsEnabled Property of a Flash Cast member
Rotate a Flash Sprite
Check PM Group
Set FrameRate of a Animated Gif Cast Member
Import from Access - Valentina
VTC Training CD for Macromedia Director 6
binary search
Retrun Properties on a Sprite
Director 8 & Lingo Fast and Easy Web Development (With CD-ROM)
PrimeBase Xtra
 

 

 

Behavior Blend given sprite from 0 to given value

Added on 6/20/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: KumarK

Blend given sprite from 0 to given value

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

Property whereTo,spriteToBlend, Endblend

------ Get Behavior Description List ------
on getPropertyDescriptionList me
  set description = [:]
  if the currentspritenum = 0 then exit  
  addProp description, #spriteToBlend, [#comment: "Choose the Sprite to Blend:",#format:#Integer,#range:[#min:1,#max:the lastchannel],#default:the currentspritenum]    
  addProp description, #Endblend, [#comment: "Choose the BlendLevel :",#format:#Integer,#range:[#min:1,#max:100],#default:100]  
  addProp description, #WhereTo, [#comment: "Where To Attach ?" ,#format:#String,
    #range:["On MouseUp","On MouseDown","On MouseEnter","On MouseLeave"],#default:"On MouseUp"]    
  return description
end getPropertyDescriptionList
------ Get Behavior Description List ------

-- Get Behavior description --
on getBehaviorDescription me
  return
    "Blend given sprite from 0 to given value" & RETURN & RETURN &
    "This Behavior Blends the given sprite from 0 to the given value" & RETURN & RETURN &
  "PARAMETERS:" & RETURN &
    "* Sprite Number" & RETURN &
    "* Blend Level."
end getBehaviorDescription
-- Get Behavior description --

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

-- Events --
on MouseUp
  if WhereTo = "On MouseUp" then
    blendsprite
  end if
end MouseUp

on MouseDown
  if WhereTo = "On MouseDown" then
    blendsprite
  end if
end MouseDown

on MouseEnter
  if WhereTo = "On MouseEnter" then
    blendsprite
  end if
end MouseEnter

on MouseLeave
  if WhereTo = "On MouseLeave" then
    blendsprite
  end if
end MouseLeave
------ Events ------

--- Custom Handler to Blend the spriite
on blendsprite
  set the ink of sprite spriteToBlend = 32
  repeat with i = 0 to endblend
    set the blend of sprite spriteToBlend = i
    updatestage
  end repeat
end if
end
--- Custom Handler to Blend the spriite

 


Contact

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

Send e-mail