Re: [Flashcoders] Why isn't my TextField multiline? AS2
In that case, use HTML and and/or try wrapping the content in a CDATA tag. On 5/8/08 8:52 AM, "Alistair Colling" wrote: > hmm, the string that is being targeted is held in a variable that is > set from an xml file so should just be a regular string, i'll look > into this tho. Rich http://www.LearningActionScript3.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Why isn't my TextField multiline? AS2
hmm, the string that is being targeted is held in a variable that is set from an xml file so should just be a regular string, i'll look into this tho. Thanks Rich On 8 May 2008, at 13:38, Rich Shupe wrote: I think the problem is that you're pulling your string from another text field. In that case, the characters are just characters, rather than control codes. This subset of your code works fine: var tmpField:TextField = this.createTextField("my_txt", 1, 0,0,100,100); tmpField.selectable = false; tmpField.border = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.wordWrap = true; tmpField.text = "test\rtest"; However, putting "test\rtest" in another text field, and then saying this: tmpField.text = other.text; shows the characters. If you have to pull text from another field, try using HTML and setting the .html of one field to the .html of another field. Rich http://www.LearningActionScript3.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Why isn't my TextField multiline? AS2
I think the problem is that you're pulling your string from another text field. In that case, the characters are just characters, rather than control codes. This subset of your code works fine: var tmpField:TextField = this.createTextField("my_txt", 1, 0,0,100,100); tmpField.selectable = false; tmpField.border = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.wordWrap = true; tmpField.text = "test\rtest"; However, putting "test\rtest" in another text field, and then saying this: tmpField.text = other.text; shows the characters. If you have to pull text from another field, try using HTML and setting the .html of one field to the .html of another field. Rich http://www.LearningActionScript3.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Why isn't my TextField multiline? AS2
Thanks for your reply Chistoffer, I'm afraid it's still not working, the characters appear in my text field. Here's the code I am using to create the text format and textfield, maybe something here is screwing it up: var myM:TextFormat = new TextFormat(); myM.align = "center"; myM.font = "Serifa Blk BT"; myM.size = 20; myM.color = 0x00; myM.leading = -5; myM.letterSpacing = -1; //add text to boxes var oline:MovieClip = mainMC.monkey.bubble.outline var tmpBox:MovieClip = mainMC.monkey.bubble.createEmptyMovieClip ("text_mc", 1); var tmpField:TextField = tmpBox.createTextField("my_txt", 1, oline._x, oline._y, oline._width, oline._height); tmpField.selectable = false; tmpField.border = true; tmpField.embedFonts = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.wordWrap = true; tmpField.text = Q.monkeyStr; tmpField.setTextFormat(myM); Any suggestions flashers? On 8 May 2008, at 10:06, Christoffer Enedahl wrote: Try "\n" or "\r\n" HTH/Christoffer Alistair Colling skrev: Thanks guys :) works perfectly. Now it seems my line returns ("\r") aren't being recognised (they show up in the textfield). Anyone got any ideas whats going on? Cheers On 7 May 2008, at 18:19, Robert Leisle wrote: Hi Alistair, Try adding this to your code: tmpField.wordWrap = true; Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Colling Sent: Wednesday, May 07, 2008 10:03 AM To: Flash Coders List Subject: [Flashcoders] Why isn't my TextField multiline? AS2 Hi there, thanks for checking this. I'm generating a textfield from within a custom class but I can't seem to make it multiline, I can see the border of the textfield is the right size my text only appears on the first line and also my carriage returns "\r" are having no effect. I've tried a number of options for properties of the textfield but I cant seem to get it to work. Any suggestions thankfully received this is taking lots of time for a simple thing! Cheers, Ali Here's the code from within my class: var oline:MovieClip = mainMC.monkey.bubble.outline var tmpBox:MovieClip = mainMC.monkey.bubble.createEmptyMovieClip ("text_mc", 1); var tmpField:TextField = tmpBox.createTextField("my_txt", 1, oline._x, oline._y, oline._width, oline._height); tmpField.selectable = false; tmpField.border = true; tmpField.embedFonts = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.text = Q.monkeyStr; tmpField.setTextFormat(myM); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Why isn't my TextField multiline? AS2
Thanks for your reply Chistoffer, I'm afraid it's still not working, the characters appear in my text field. Here's the code I am using to create the text format and textfield, maybe something here is screwing it up: var myM:TextFormat = new TextFormat(); myM.align = "center"; myM.font = "Serifa Blk BT"; myM.size = 20; myM.color = 0x00; myM.leading = -5; myM.letterSpacing = -1; //add text to boxes var oline:MovieClip = mainMC.monkey.bubble.outline var tmpBox:MovieClip = mainMC.monkey.bubble.createEmptyMovieClip ("text_mc", 1); var tmpField:TextField = tmpBox.createTextField("my_txt", 1, oline._x, oline._y, oline._width, oline._height); tmpField.selectable = false; tmpField.border = true; tmpField.embedFonts = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.wordWrap = true; tmpField.text = Q.monkeyStr; tmpField.setTextFormat(myM); Any suggestions flashers? On 8 May 2008, at 10:06, Christoffer Enedahl wrote: Try "\n" or "\r\n" HTH/Christoffer Alistair Colling skrev: Thanks guys :) works perfectly. Now it seems my line returns ("\r") aren't being recognised (they show up in the textfield). Anyone got any ideas whats going on? Cheers On 7 May 2008, at 18:19, Robert Leisle wrote: Hi Alistair, Try adding this to your code: tmpField.wordWrap = true; Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Colling Sent: Wednesday, May 07, 2008 10:03 AM To: Flash Coders List Subject: [Flashcoders] Why isn't my TextField multiline? AS2 Hi there, thanks for checking this. I'm generating a textfield from within a custom class but I can't seem to make it multiline, I can see the border of the textfield is the right size my text only appears on the first line and also my carriage returns "\r" are having no effect. I've tried a number of options for properties of the textfield but I cant seem to get it to work. Any suggestions thankfully received this is taking lots of time for a simple thing! Cheers, Ali Here's the code from within my class: var oline:MovieClip = mainMC.monkey.bubble.outline var tmpBox:MovieClip = mainMC.monkey.bubble.createEmptyMovieClip ("text_mc", 1); var tmpField:TextField = tmpBox.createTextField("my_txt", 1, oline._x, oline._y, oline._width, oline._height); tmpField.selectable = false; tmpField.border = true; tmpField.embedFonts = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.text = Q.monkeyStr; tmpField.setTextFormat(myM); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Alistair Colling Interactive Developer FPP Brand Communications (Newcastle upon Tyne) The Courtyard Dinsdale Place Sandyford Newcastle upon Tyne NE2 1BD Telephone: +44 (0)191 261 6662 Fax: +44 (0)191 233 2511 This transmission is confidential and intended solely for the person or organisation to whom it is addressed. It may contain privileged and confidential information. If you are not the intended recipient, you should not copy, distribute or take any action in reliance on it. If you have received this transmission in error, please notify the sender at the e-mail address above. FPP Design Limited. Reg. Office: The Courtyard, Dinsdale Place, Sandyford, Newcastle upon Tyne NE2 1BD. Registered Number 3775564. Registered in England and Wales. Visit our website at http://www.fpp.net/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Why isn't my TextField multiline? AS2
Thanks guys :) works perfectly. Now it seems my line returns ("\r") aren't being recognised (they show up in the textfield). Anyone got any ideas whats going on? Cheers On 7 May 2008, at 18:19, Robert Leisle wrote: Hi Alistair, Try adding this to your code: tmpField.wordWrap = true; Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Colling Sent: Wednesday, May 07, 2008 10:03 AM To: Flash Coders List Subject: [Flashcoders] Why isn't my TextField multiline? AS2 Hi there, thanks for checking this. I'm generating a textfield from within a custom class but I can't seem to make it multiline, I can see the border of the textfield is the right size my text only appears on the first line and also my carriage returns "\r" are having no effect. I've tried a number of options for properties of the textfield but I cant seem to get it to work. Any suggestions thankfully received this is taking lots of time for a simple thing! Cheers, Ali Here's the code from within my class: var oline:MovieClip = mainMC.monkey.bubble.outline var tmpBox:MovieClip = mainMC.monkey.bubble.createEmptyMovieClip ("text_mc", 1); var tmpField:TextField = tmpBox.createTextField("my_txt", 1, oline._x, oline._y, oline._width, oline._height); tmpField.selectable = false; tmpField.border = true; tmpField.embedFonts = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.text = Q.monkeyStr; tmpField.setTextFormat(myM); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Why isn't my TextField multiline? AS2
Try "\n" or "\r\n" HTH/Christoffer Alistair Colling skrev: Thanks guys :) works perfectly. Now it seems my line returns ("\r") aren't being recognised (they show up in the textfield). Anyone got any ideas whats going on? Cheers On 7 May 2008, at 18:19, Robert Leisle wrote: Hi Alistair, Try adding this to your code: tmpField.wordWrap = true; Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Colling Sent: Wednesday, May 07, 2008 10:03 AM To: Flash Coders List Subject: [Flashcoders] Why isn't my TextField multiline? AS2 Hi there, thanks for checking this. I'm generating a textfield from within a custom class but I can't seem to make it multiline, I can see the border of the textfield is the right size my text only appears on the first line and also my carriage returns "\r" are having no effect. I've tried a number of options for properties of the textfield but I cant seem to get it to work. Any suggestions thankfully received this is taking lots of time for a simple thing! Cheers, Ali Here's the code from within my class: var oline:MovieClip = mainMC.monkey.bubble.outline var tmpBox:MovieClip = mainMC.monkey.bubble.createEmptyMovieClip ("text_mc", 1); var tmpField:TextField = tmpBox.createTextField("my_txt", 1, oline._x, oline._y, oline._width, oline._height); tmpField.selectable = false; tmpField.border = true; tmpField.embedFonts = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.text = Q.monkeyStr; tmpField.setTextFormat(myM); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Why isn't my TextField multiline? AS2
Hi Alistair, Try adding this to your code: tmpField.wordWrap = true; Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Colling Sent: Wednesday, May 07, 2008 10:03 AM To: Flash Coders List Subject: [Flashcoders] Why isn't my TextField multiline? AS2 Hi there, thanks for checking this. I'm generating a textfield from within a custom class but I can't seem to make it multiline, I can see the border of the textfield is the right size my text only appears on the first line and also my carriage returns "\r" are having no effect. I've tried a number of options for properties of the textfield but I cant seem to get it to work. Any suggestions thankfully received this is taking lots of time for a simple thing! Cheers, Ali Here's the code from within my class: var oline:MovieClip = mainMC.monkey.bubble.outline var tmpBox:MovieClip = mainMC.monkey.bubble.createEmptyMovieClip ("text_mc", 1); var tmpField:TextField = tmpBox.createTextField("my_txt", 1, oline._x, oline._y, oline._width, oline._height); tmpField.selectable = false; tmpField.border = true; tmpField.embedFonts = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.text = Q.monkeyStr; tmpField.setTextFormat(myM); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Why isn't my TextField multiline? AS2
If i remember correctly it should be: tmpField.wordWrap = true; hth, B. On Wed, May 7, 2008 at 10:03 AM, Alistair Colling <[EMAIL PROTECTED]> wrote: > Hi there, thanks for checking this. > > I'm generating a textfield from within a custom class but I can't seem to > make it multiline, I can see the border of the textfield is the right size > my text only appears on the first line and also my carriage returns "\r" are > having no effect. > I've tried a number of options for properties of the textfield but I cant > seem to get it to work. > > Any suggestions thankfully received this is taking lots of time for a > simple thing! > Cheers, > Ali > > > > Here's the code from within my class: > > > > >var oline:MovieClip = mainMC.monkey.bubble.outline >var tmpBox:MovieClip = > mainMC.monkey.bubble.createEmptyMovieClip("text_mc", 1); >var tmpField:TextField = > tmpBox.createTextField("my_txt", 1, oline._x, oline._y, oline._width, > oline._height); >tmpField.selectable = false; >tmpField.border = true; >tmpField.embedFonts = true; >tmpField.type = "dynamic"; >tmpField.multiline = true; >tmpField.text = Q.monkeyStr; >tmpField.setTextFormat(myM); > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders