View Full Version : Numbered list in HTML??
flashpipe
July 20th, 2006, 10:09 AM
Is there any way to do/fake a numbered list, <ol>, in a flash HTML text field??
Thanks!!
flashpipe
July 20th, 2006, 01:33 PM
Here's what I've got so far as far as an AS workaround...not working quite right because it either doens't keep the HTML formatting, or it displays the HTML tags in the field...
Any ideas??
creatify
July 20th, 2006, 03:22 PM
Have you tried using css? I'm fairly sure <li> is supported in html textFields, but I don't kow that <ol> is - unless I'm wrong?
Any how, using CSS, you can use textIndent and left/right margins along w/ an incremented number var to add numbers to your list. Does this all kinda make sense?
flashpipe
July 20th, 2006, 03:41 PM
Makes sense, thanks! Not sure how CSS would work since the problem is that the flash HTML doesn't support the <ol> tag. I think I almost need to parse the HTML and then replace <li> tags with numbers, but I'm not sure how I can distinguish between and <ol> and <ul> since flash won't even read those...
THanks!!
flashpipe
July 21st, 2006, 10:16 AM
This is coming along. I think I've got a good chunk of this working, but I can't figure out how to retain the HTML formatting of the pre and post selections.
For example, if you enter 5 lines, bold the first line and make the last line an UL and then select the 3 middle lines and make that an OL, all the other formatting is removed...
Not sure how to either set the selBegin and selEnd of the htmlText or how to keep the HTML formatting of the pre and post selections...
Any ideas??? See the attached fla to see it working so far...
THANKS!!!!
flashpipe
July 21st, 2006, 12:45 PM
WOOHOO!!
replaceText seems to be the answer to preserve the formatting...
Here it is! I've got to tweak the turning off a bit, but I think this is pretty close. If anyone else finds bugs or something that doesn't work, let me know!!
Thanks!!!
oldgreymare
July 21st, 2006, 01:52 PM
Hey...that is cool! Works great.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.