Removing Leading & Trailing Spaces from Text

Home • Members Tutorials Forum iSnapChat Contact Us 

 


Flash Tutorials

   

Trimming Leading & Trailing Spaces from Text

 

Free Flash Tutorial


Step 1    <<   Previous      Intro   1   2     Next   >>      

 

Step One: Setting Up the Document

  1. Open a New Flash Document: File > New (Ctrl N)
  2. If the General Tab is not selected, select it:
  3. Select Flash Document:
  4. Click: OK
  5. Now you need to check to the publish settings are set to ActionScript 2

  6. Go to: File > Publish Settings
  7. Select the: Flash Tab
  8. Note: This tab will not be visible unless the Flash box is selected:

  9. Select ActionScript Version: ActionScript 2
  10. Click: OK
  11. Add a text box to the stage and give it an instance name of: inputField
  12. Then add a button to the stage
  13. Past the following code into the button:
  14. on (Press) {
    // Trim the text
    _root.inputField.text = _root.Trim(_root.inputField.text);
    // Remember if you do not want to filter out leading and
    // trailing html space tags add 'false' to the parameters been passed to the Trim function e.g.
    // _root.Trim(LocationOfTheTextBoxInTheFlashMovie.TheInstanceNameOfTextBoc.text, false);
    }

         

Step 1    <<   Previous      Intro   1   2     Next   >>      


12584 visitors to this page since Feb 07 •

Phil Schulz's Facebook Profile
Webwasp is Phil Schulz's baby. You are welcome to contact me or become my Facebook friend: Click here

 Top of Page HomeMembers Tutorials Forum iSnapChat Contact Us 
 All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.