Ghost Typer

Date:  Wed, 22 Oct 97 20:13:42 -0800
From: Joe Sparks 
Subject: Re: Sorry for .. (GhostTyper script to try)

>Sorry if this is off the subject as well as being a stupid question, but 
>what's the easiest way to make text appear like someones typing it in 
>Director?
>I need to make it look like "HTTP://www" is being typed in, and then I need 
>the "www" to move to the center of the screen as I'm zooming in on it, and 
>also have it smoothly change into "world wide web" (the words sliding out 
>of the w's"
Here's one that locks out eveything and just does it all at once (no user interaction while it is happening)
  1. Put a field on the stage, name the cast member "GhostType.fld" for this example
  2. Put this script in a moviescript:
    
    -- generic field typer
    -- pass a text string, a field name, and the number 1 if
    -- you want it to expand www into "world wide web", (0 if not)
    -- example usage: GhostTyper "http://www", "GhostType.fld", 1
    
    on GhostTyper tText, tFldNam, tWWWCheck
      set tDisplayText = ""
      repeat with x = 1 to the number of chars in tText
        put char x of tText after tDisplayText
        put tDisplayText into field tFldNam
        updatestage
        MicroPaus
      end repeat
      
      -- two quick pauses:
      MicroPaus
      MicroPaus
      
      -- check for www special option
      if tWWWCheck = 1 then
        if tDisplayText contains "www" then
          translateWWW tDisplayText, tFldNam
        end if    
      end if
    end
    
    on translateWWW tDisplayText, tFldNam
      set tCharStartPos = offset("www", tDisplayText)
      set tPrefix = chars(tDisplayText, 1, tCharStartPos-1)
      
      repeat with x = 1 to 5
        set tTransFormTx = tPrefix
        
        put chars( "world", 1, x) & " " after tTransFormTx
        put chars( "wide", 1, x) & " " after tTransFormTx
        put chars( "web", 1, x) after tTransFormTx
        
        put tTransFormTx into field tFldNam
        updatestage
        MicroPaus
      end repeat
    end
    
    on MicroPaus
      set tTicks = the ticks
      set tTickDelay = 8  -- adjustable, higher number = longer wait
      repeat while the ticks < tTicks + tTickDelay
        nothing
      end repeat
    end
    -- Joe Sparks, oct 22 1997, and I just got a root canal.
    
  3. Type this in the message window for instant gratification, or on a button or score script or message window, or where ever:
    
      GhostTyper "http://www", "GhostType.fld", 1