Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Sound FadeIn
What is the difference between Director and Flash?
Generic behavior to get Key State.
Hangman
sprite resize
Protected Code
Set BroadCast Property of a Flash Sprite
Dialogs - Tell Me Something
Group of Sprite Mover
Toggle Stay On Top-Button
MediaMacros Xtras Mall
 

 

 

Behavior replace escape characters

Added on 5/25/2001

 

Compatibilities:
D6_5 D7 D8 D8_5 Mac PC Script Shockwave

Rating:

Author: robbchar

Send this some text and it will give you the text back with the escaped '\' characters switched. Current supports \n - RETURN \t - TAB \q - QUOTE Others can be easily added in the case statement. This really isn't a behavior but rather a utility for text that should be placed in a movie script.

on replaceEscapeChars theText
  if stringP(theText) = 1 then
    -- save the old itemDelimiter and replace it with "\"
    oldDelimiter = the itemDelimiter
    the itemDelimiter = "\"
    newText = theText.item[1]
    numItems = theText.item.count
    repeat with i = 2 to numItems
      currentItem = theText.item[i]
      specialChar = ""
      
      -- figure out which char it is
      escapedChar = currentItem.char[1]
      case escapedChar of
        "n":
          specialChar = RETURN
        "t":
          specialChar = TAB
        "q":
          specialChar = QUOTE
      end case
      
      -- put it together
      currentItem = currentItem.char[2..currentItem.char.count]
      newText = newText & specialChar & currentItem
    end repeat
    -- restore the itemDelimiter
    the itemDelimiter = oldDelimiter
    -- return the new string
    return newText
  else
    -- return theText if its not a string
    return theText
  end if
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