PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
problem with line spacing and carriage returns
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: problem with line spacing and carriage returns

  1. #1
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146

    problem with line spacing and carriage returns

    I posted a previous question on the actionscript forum and got some assistance; however the solution isn't working for me and I think its due to the Koolmoves software I'm using. The post is here:

    http://board.flashkit.com/board/showthread.php?t=826703


    I wanted to know how to get my dynamic text box to display with single line breaks instead of double. My text file (mFile) reads this way:

    2nd Saturday at Twelve Lounge
    1123 H Street/ NE Washington DC 20003
    Battle of the hottest djays

    But when displayed in my movie it reads this way:

    2nd Saturday at Twelve Lounge

    1123 H Street/ NE Washington DC 20003

    Battle of the hottest djays

    This is the code I currently have that results to the above:
    Code:
    var R;
      //
      res=new LoadVars();
      res.load("mfile.txt");
    
      res.onData=function(info){
        if (info==undefined){
          R="Loading failed";
        }else{
           R=info;    }
        txt1.text=R;
      }
    I was advised to change "R=info;" to :

    Code:
    R=info.split("\r\n").join("\n");
    When trying to use that syntax it produced the following error:

    "expecting a variable for the property target"

    Does anyone know the proper syntax for this expression? Or why I am getting this error?

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Quote Originally Posted by talytech View Post

    Code:
    R=info.split("\r\n").join("\n");
    When trying to use that syntax it produced the following error:

    "expecting a variable for the property target"

    Does anyone know the proper syntax for this expression? Or why I am getting this error?

    try:
    Actionscript Code:
    R=info.split("\r\n");
    R=R.join("\n");

  3. #3
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146
    Yayyyy .. Thank you Blanius .. that worked!!!!! ...

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Thought that might be it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center