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
Dialog Xtra
CD Everywhere
Blur Static-Alphamania
Sprite Group Movement behavior
NJC - Space Invaders
VTC Training CD for Macromedia Director 6
RTF files using free FileIOXtra
Color Value
Sprite Player v.2
Director To Go
 

 

 

Behavior A cool button

Added on 5/22/2004

 

Compatibilities:

This item has not yet been rated

Author: spiderman3388

the code manuplates 3 sprites the main button and a color sprite with low opacity and a dot sprite

Download PC Source
property mysprite
property colorsprite
property dotsprite
property myright
property myleft
property f
property colorright
property colorleft
property which
property which2
property distancei

on beginsprite me
  mysprite=sprite(me.spritenum)
  colorsprite=sprite(which)
  dotsprite=sprite(which2)
  myright=mysprite.right
  myleft=mysprite.left
  colorright=colorsprite.right
  colorleft=colorsprite.left
  f=0
end

on mousewithin me
  f=2
end
on mouseleave me
  f=1
end
on prepareframe me
  if f=0 then
    set the right of colorsprite to colorleft
    set the blend of dotsprite to 100
    set the visibility  of dotsprite to 0
    set the loch of dotsprite to myright
  end if
  
  if f=2 then
    if the right of colorsprite      set the right of colorsprite to the right of colorsprite +10
    end if
  end if
  if f=2 then
    if the right of colorsprite>=myright then
      if the loch of dotsprite> myleft-Distancei then
        set the visibility  of dotsprite to 1
        set the loch of dotsprite to the loch of dotsprite -10      
      end if
    end if
  end if
  if f=1 then
    if the right of colorsprite>colorleft then
      set the right of colorsprite to the right of colorsprite -10
    end if
  end if
  if f=1 then
    if the blend of dotsprite>0 then
      if the loch of dotsprite< myright + the width of dotsprite*2 then
        if the right of colorsprite<=colorleft then
          set the loch of dotsprite to the loch of dotsprite +10
          set the blend of dotsprite to the blend of dotsprite -10
        end if
      end if
    end if
  end if
  if the blend of dotsprite=0 then
    f=0
  end if  
end
on getPropertyDescriptionList me
  set props= [:]
  props.addProp(#which, [#format: #integer, #default: 2, #comment: "which sprite is the color"])
  
  props.addProp(#which2, [#format: #integer, #default: 1, #comment: "which is the dot"])
  props.addProp(#distancei, [#format: #integer, #default: 16, #comment: "how far away?"])
  
  
  return props

 


Contact

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

Send e-mail