s   h   o   c   k   i   n   g   !

  B   A   D     S   N   E   A   K   E   R   S
BUG? Unlike the first version, this one has a bug which stumps me! The lingo code of the parent script "sneaker" is designed to colorize the letter once it has done its sneakerizing. I found in testing that it worked fine in Authoring mode but in shockwave, it would start to color text that was still scrambling. The only way to get it work in the original version was to add a line that reset the forecolor of the scrambling character to black. This makes it work but slows the effect down considerably.

This movie is Director 5 but Detlef Beyer <d.beyer@hermes.de> has replicated it in Director 6 and I have as well in this new version.

Here is the parent script:

property pId, pDestChar, pCurrChar, pTimes, pDone

-- =======================================================================
-- parent script:
-- ============= sneaker
--
-- Creates objects for each letter of the intended text
-- and randomizes on demand
-- =======================================================================

on new me, i, inText, N, flag
  -- the character position in the field
  set pID = i
  
  -- the intended letter when all is done
  set pDestChar = inText
  
  -- until then generate a random letter
  set pCurrChar = numToChar( 31 + random(94) )
  put pCurrChar into char pID of field "display" 
  
  -- the number of times to snekarize until we are done
  set pTimes = N
  
  -- a flag to indicate if we are done
  set pDone = 0
  return me
end

on stepFrame me
  if pDone then exit
  
  -- check if we have run the counter out
  if pTimes = 0 then
    
    -- yes, then set the done flag
    set pDone = 1
    
    -- put the intended letter into the proper place
    put pDestChar into char pID of field "display"
    
    -- As suggested by Martin Winkler 
    -- when the sneakering is done, change the color of the
    -- character as an indicator
    set the foreColor of char pID of field "display" to the foreColor of field "c"    
    kill me
        
  else
    -- decrement the counter
    set pTimes = pTimes  - 1
    
    -- generate another random character
    set pCurrChar = numToChar( 31 + random(94) )
    
    -- put the intended letter into the proper place 
    put pCurrChar into char pID of field "display"   
    
    -- Ok, I cannot explain this, but without this statement
    -- the shockwave version will adversely color text
    -- that is still scrambling
    -- to test it, see what happens when you comment out this line
    
   --  set the foreColor of char pID of field "display" = the foreColor of field "b"
  end if
end

on kill me
  deleteActor (script "main", me)
end

Source Code for buggy file
Mac [12k] ~~ Win [8k]