Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Resizing Flash Sprite to its Original Size
NTI CD Maker
Linear Path Tracker
List Inspector 1.1 with Tree View
DirectTransition3D Xtra Set II.
Group of Sprite Mover
Impressario Find Dialog
Drag and Switch
Rollover Sound
Sprite Recorder
MediaMacros Xtras Mall
 

 

 

Behavior Light Sensitive Text Dropshadow

Added on 8/20/1999

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: MediaMacros (website)

Drop thison a text member and give it an empty sprite channel. You cna assign either a sprite or the mouse as the "light"

--Copyright 1999 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know. :-)

property spriteNum, shadowSprite, follow, followSPrite, rangeOffset

on getPropertyDescriptionList me
  p_list = [:]
  if the currentSpriteNum > 0 and sprite(the currentSpriteNum).member.type = #text then
    p_list.addProp(#shadowSprite, [#format : #integer, #comment : "Which sprite to use as the shadow?", #default : (the currentSpriteNum + 1)])
    p_list.addProp(#follow, [#format : #symbol, #comment : "What should the shadow follor?", #default : #mouse, #range : [#mouse, #sprite, #nothing]])
    p_list.addProp(#rangeOffset, [#format : #float, #comment : "Offset value for the shadow:", #default : 100.0])
    p_list.addProp(#followSprite, [#format : #integer, #comment : "If following a sprite, which sprite?", #default : the currentSpriteNum + 2])
  end if
  return p_list
end

on beginSprite me
  if sprite(spriteNum).member.type = #text then
    if sprite(shadowSprite).member.type = #empty then
      puppetSprite shadowSprite true
    end if
    sprite(spriteNum).ink = 36
    sprite(shadowSprite).ink = 36
    sprite(shadowSprite).member = sprite(spriteNum).member
    sprite(shadowSprite).forecolor = 255
    sprite(shadowSprite).locz = sprite(spriteNum).locZ - 1
  end if
end

on endSprite me
  puppetSprite shadowSprite false
end

on enterFrame me
  if sprite(spriteNum).member.type = #text then
    if follow = #mouse then
      distance = sprite(spriteNum).loc - point(the mouseH, the mouseV)
      sprite(shadowSprite).loc = sprite(spriteNum).loc + (distance / point(rangeOffset, rangeOffset))
    else if follow = #sprite then
      distance = sprite(spriteNum).loc - sprite(followSprite).loc
      sprite(shadowSprite).loc = sprite(spriteNum).loc + (distance / point(rangeOffset, rangeOffset))
    end if
  end if
end

on getBehaviorDescription me
  return "Drop this behavior on a text member and assign an empty sprite or a sprite with a second instance of the same cast member. Choose the " & quote & "light" & quote & " and you are ready to go."
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