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
VTC Training CD for Macromedia Director 6
Wait for DigitalVideo End
SM scroll slowdown
encrypt/decrypt Image
KK
Blur Range/Pendulum-Alphamania
Check user's administrative privileges on NT platform
Toggle ActionsEnabled Property of a Flash Sprite
Cut Behavior (Ctrl + X)
Mastering Macromedia Dreamweaver 3
 

 

 

Behavior Faux Typing

Added on 6/30/1999

 

Compatibilities:
behavior D6_5 D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: AlanLevine

Fake Typink Script

Download PC Source    Download Mac Source
-- Message Machine
-- alan

-- Sends a message string to a field one char at a time
------------------------------------------------------
property  useString, myMessage, myAutoMode, myMessageField, myLength, myCurrentChar, myState, myDisplayField

-- useString        : boolean flag for the source is a string (T) or a field (F)
-- myMessage        : text of message to display
-- myAutoMode       : flag for whether the message plays immediately or waits for keydown
-- myMessageField   : name of cast member of source target (used only if useString = false
-- myLength         : character length of the message
-- myCurrentChar    : the charatcer that is currently being transmitted
-- myState          : symbol flag for indicator of status
-- myDisplayField   : cast member that is the target for display
------------------------------------------------------
on beginSprite me
  -- load the message from the appropriate source
  set myState = #pause
  set myDisplayField = the name of the member of sprite (the spriteNum of me)
  set the text of field myDisplayField = " "
  if myAutoMode then typeIt
end

on typeItOnce me
  if myState = #pause then typeIt
end

on typeIt me
  if useString then    
    setMessage me, myMessage
  else
    setMessage me, the text of member myMessageField
  end if
end

on prepareFrame me
  if myState = #go then
    set myCurrentChar = myCurrentChar + 1
    
    if myCurrentChar > myLength then
      set myState = #stop
    else
      set the text of member myDisplayField = char 1 to myCurrentChar of myMessage
    end if    
  end if  
end

on setMessage me, newMessage
  -- sets up a message and intitiates its display
  -- This can be called from another sprite (sendSprite...)
  -- to send a different message at some other time
  
  set myMessage = newMessage
  set myLength = length( myMessage )
  set myCurrentChar = 1
  set the text of member myDisplayField = char 1 of myMessage
  set myState = #go
end


on blitMessage me, newMessage
  set myState = #stop
  set the text of member myDisplayField =  newMessage  
end

on getPropertyDescriptionList  
  return  [ #myAutoMode: [ #comment:"auto playback:", #format:#boolean, #default:1], #useString: [ #comment:"use string:", #format:#boolean, #default:true], #myMessage: [ #comment:"String:",  #format:#string,  #default:"Send this message"], #myMessageField: [#comment:"Use Field:",  #format:#field,  #default:1 ] ]
end

on getBehaviorDescription
  return "Plays back a stream of text to  a field one char at a time. The source can be string entered in the Behavior dialog or from a field cast member."
end

 


Contact

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

Send e-mail