A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Variable between a sentence

  1. #1
    Junior Member
    Join Date
    Jan 2010

    Variable between a sentence

    I must be doing something stupid here, but simply I want this below

    "This was made by namehere, how kind!" displayed in a dynamic textbox.

    However, this is what I have so far. For some reason though it does not display the end half of the sentence. My variable is being loaded from a txt file.

    Actionscript Code:
    _root.authortext.text = "This was created by "+this.author+"how kind!";

    This works, but only outputs the following to the dynamic textbox:

    "This was created by Jack"

    It doesn't include the second half of the sentence, but I always thought adding a + sign indicated to include that afterwards. Seems not.

    I have blatantly done something silly, anybody care to shed some light on my sillyness? :P

  2. #2
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    British Columbia
    Your code is correct and you're right about the + sign. Is the text field you're loading it in to long enough? Try tracing the same line of code to see if it's being recorded correctly.

    PHP Code:
    trace("This was created by "+this.author+"how kind!"); 
    ps if you can, use _parent instead of _root...
    Evolve Designs Interactive Media
    the natural selection

  3. #3
    Junior Member
    Join Date
    Jan 2010
    It does work in trace, but has a 1 line break between the first and second half of the sentence:

    This was created by Jack

    how kind!

  4. #4
    Junior Member
    Join Date
    Jan 2010
    Sorry for the double post. But the same happens in my text box. If I stretch my dynamic textbox to fit in 3 lines, and put multiline on it does exactly the same as what it does in trace.

    So, anybody know what is causing this line break? And if there is any way to get rid of 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