|
Comments
Hi Graeme, I can't reproduce this with Flash MX or Flash MX 2004. Does this only happen when you're working with data from Flashcom? Can you give me 1-2-3 steps to see this in Flash MX with a simple string? Thanks. Posted by: Vera at January 7, 2004 10:47 AMHi Vera, 1. Make a text box on the stage, dynamic with multiple lines or not.. 2. Give it a name like chat_txt 3. Click the "render as html" button. 4. go to the actions panel and type in chat_txt.htmlText+="My text is this"; 5. run it :) Doing that compared with setting the html with AS shows different ouputs in the text. ps.. I'm using the Japanese version. Does it make a dif? Posted by: Graeme at January 7, 2004 10:57 AMAlso, if you trace out the contents of the chat_txt.htmlText you will get a whole line of html code. Whereas if you set it by AS, nothing comes up in that trace. Posted by: Graeme at January 7, 2004 11:37 AMHmmm. I didn't realize I had to do +=. A simple = does not cause this behavior. Also, this seems to have been fixed in Flash MX 2004. One thing to watch out for in Flash MX 2004 is that all undeclared strings by default have a value of undefined. So someVar += "this is the text"; would result in a string of "undefinedthis is the text". Posted by: Vera at January 7, 2004 02:46 PMGood to hear it's fixed. A simple = doesn't cause the behaviour because you are overwriting what is already in there. That is why I did (up until yesterday) chat_txt.text=""; But, I don't want to overwrite the text everytime somebody makes an entry in the chat, or we would have only one line chats... ;) On your last note there, wouldn't that only be for variables and not my situation above where I am adding text into a text box that is on the stage? I hope I'm not understanding you wrong. Thanks for the checking though. I was going to have a friend check the text thing FMX2004 but now I know! Posted by: Graeme at January 7, 2004 04:46 PMYes, what I described is only true for variables. But I'm sure that a lot of developers assign the string to a variable first and then to the text field property. :) Because of the "undefined" issue though I still think it's a bad idea to initiate a text field value with +=. I'm not saying use = every time and wipe out what's there :), just initiate the text field once with a =, then add to it with +=. Posted by: Vera at January 8, 2004 12:26 AMThanks for the info Vera! When I update to MX2004, I'll make sure to initiate to reduce the chance of errors. Posted by: Graeme at January 8, 2004 10:07 AM |