Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Sony UK: a New Director Case Study by INM
Audio Xtra
Vigenere cipher (Encryption)
Soundoftheweb Network
Send OSA Script
Open a window from inside shockwave
Playthrough
RGB Hex Module
Custom Scroll Bars
Useful list functions
MediaMacros Xtras Mall
 

 

 

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

 


Upload Provided by ABCUpload ASP

Contact

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

Fax - (206) 339-5833

Send e-mail