changing a text members text content with lingo

Ask a Question related to Macromedia Director Basics, Design and Development.

  1. #1

    Default changing a text members text content with lingo


    Is there a way of setting the content of a text member through lingo, specifying where there should be Carriage Return.

    I have a director movie that when you press a button, a string should appear in the text box on screen, but the layout is very poor, in that there is no paragraphs.

    Is there any way to tell lingo that at a certain point in the text a new line needs to be made.

    It has to be done through lingo as the text is made up from the result of a search on a property list.

    repeat with i =1 to movieList.count
    if movieList> movieList.count then


    if movieList.name = member("input").text then

    -----------
    charNo = the number of chars in member("text").text
    member("text").char[(charNo+1)] = string(i)&"."&& string(movieList.name)
    ----------

    this is the part above that I am trying to adjust the layout. After each loop, if the users input equals the property in the list then it outputs the name to the text field after the last charcter that is already there.

    Is there a symbol for entering carridge-return, or is there a way in director to assign ascii code?
    Any ideas would be great.





    kiaoraFiona webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. changing dynamic text content on attachMovie
      I have a MC that is brought on stage via attachMovie. The MC has a dynamic text that is defined on the attach action. My problem is I would like to...
    2. identifying text members via lingo.
      i have a movie with several scrollable text members. For each of these i want to set the scroll top so that they are automatically displayed at the...
    3. Odp: identifying text members via lingo.
      Yes.... Go thru the loop of members and check if actual member type is #text... if it is do what you want to do with him regards lukpcn
    4. changing text foreColor through Lingo
      Ideally using a "on mouseOver me" command. This is what I've got so far with no results: on mouseOver me sprite(5).forecolor = #FFFFFF end ...
    5. Changing the Font of a text char w/ lingo
      change Wingding to Wingdings missing s is causing problems otherwise your just fine ;) hope this helps gabriel
  3. #2

    Default Re: changing a text members text content with lingo

    I know you can format your text using the html property
    Then the text in your propertylist is actually the html text. so format your text following HTML language. In Lingo you just set the textfield property to HTML. It read then your original text as HTML and you have a lot of
    control of your text. However crossplatform issues may occur.

    Nick



    "\"kiaoraFiona\" webforumsuser"@macromedia.com wrote:
    > Is there a way of setting the content of a text member through lingo, specifying where there should be Carriage Return.
    >
    > I have a director movie that when you press a button, a string should appear in the text box on screen, but the layout is very poor, in that there is no paragraphs.
    >
    > Is there any way to tell lingo that at a certain point in the text a new line needs to be made.
    >
    > It has to be done through lingo as the text is made up from the result of a search on a property list.
    >
    > repeat with i =1 to movieList.count
    > if movieList> movieList.count then
    >
    >
    > if movieList.name = member("input").text then
    >
    > -----------
    > charNo = the number of chars in member("text").text
    > member("text").char[(charNo+1)] = string(i)&"."&& string(movieList.name)
    > ----------
    >
    > this is the part above that I am trying to adjust the layout. After each loop, if the users input equals the property in the list then it outputs the name to the text field after the last charcter that is already there.
    >
    > Is there a symbol for entering carridge-return, or is there a way in director to assign ascii code?
    > Any ideas would be great.
    >
    >
    Nick Gordon Guest

  4. #3

    Default Re: changing a text members text content with lingo

    It sounds like you want to add something to the text that already
    exists in a text member. You can do that by just adding the text:

    member(X).text = member(X).text & newString

    If you want to add a carriage return to the text:

    member(X).text = member(X).text & RETURN & newString

    --
    Rob
    _______
    Rob Dillon
    Team Macromedia
    [url]http://www.ddg-designs.com[/url]
    412-243-9119

    [url]http://www.macromedia.com/software/trial/[/url]
    Rob Dillon Guest

  5. #4

    Default Re: changing a text members text content with lingo

    I tried something with CharToNum and found asci for return is 13.
    So the following may work as well.
    Convert your text to asci and have the values put in a list. So
    "I like the way you cook!" becomes
    [73, 32, 108, 105, 107, 101, 116, 104, 101, 32, 119, 97, 121, 121, 111, 117, 32, 99, 111, 111, 107, 33]
    Now you can add the carriage return which is 13
    [73, 32, 108, 105, 107,13, 101, 116, 104, 101, 32, 119, 97, 121, 13, 121, 111, 117, 32, 99, 111, 111, 107,13, 33]
    NumToChar will get you this

    I like
    the way
    you cook
    !

    But it a little tedious
    Nick



    "\"kiaoraFiona\" webforumsuser"@macromedia.com wrote:
    > Is there a way of setting the content of a text member through lingo, specifying where there should be Carriage Return.
    >
    > I have a director movie that when you press a button, a string should appear in the text box on screen, but the layout is very poor, in that there is no paragraphs.
    >
    > Is there any way to tell lingo that at a certain point in the text a new line needs to be made.
    >
    > It has to be done through lingo as the text is made up from the result of a search on a property list.
    >
    > repeat with i =1 to movieList.count
    > if movieList> movieList.count then
    >
    >
    > if movieList.name = member("input").text then
    >
    > -----------
    > charNo = the number of chars in member("text").text
    > member("text").char[(charNo+1)] = string(i)&"."&& string(movieList.name)
    > ----------
    >
    > this is the part above that I am trying to adjust the layout. After each loop, if the users input equals the property in the list then it outputs the name to the text field after the last charcter that is already there.
    >
    > Is there a symbol for entering carridge-return, or is there a way in director to assign ascii code?
    > Any ideas would be great.
    >
    >
    Nick Gordon Guest

  6. #5

    Default Re: changing a text members text content with lingo

    If there was no MacromediaTeam...
    I'll have to take a first look at these 'constants'
    Nick

    Rob Dillon wrote:
    > It sounds like you want to add something to the text that already
    > exists in a text member. You can do that by just adding the text:
    >
    > member(X).text = member(X).text & newString
    >
    > If you want to add a carriage return to the text:
    >
    > member(X).text = member(X).text & RETURN & newString
    >
    > --
    > Rob
    > _______
    > Rob Dillon
    > Team Macromedia
    > [url]http://www.ddg-designs.com[/url]
    > 412-243-9119
    >
    > [url]http://www.macromedia.com/software/trial/[/url]
    Nick Gordon Guest

  7. #6

    Default Re: changing a text members text content with lingo

    TO add a carriage return, you simply have to use the RETURN command...for instance:

    on startMovie me
    member("myText").text = "Hello,"&RETURN&"How are you?"
    end

    In the text member named "myText", the code would print out:

    Hello,
    How are you?

    Hopefully that makes sense...

    Good luck.




    srsidman webforumsuser@macromedia.com Guest

  8. #7

    Default Re: changing a text members text content with lingo

    Thank you everyone for all your help,

    I used the RETURN keyword and it works wonders for what I wanted to do.




    kiaoraFiona webforumsuser@macromedia.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139