View Full Version : clean html from flash
heyder
02-04-2004, 01:06 PM
Does any one know if there is a way to get 'clean' html code output from a flash textbox?
ie....
<p>test</p>
instead of
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="12" COLOR="#0B333C">test</FONT></P></TEXTFORMAT>
I can do it with php... but hoping for a flash solution
pinch150g
02-04-2004, 02:43 PM
The only way that you are going to get this is by creating the text with Actionscript. If you creat the text field with the text tool, you will get what you have described above.
Try this first : http://livedocs.macromedia.com/flash/mx2004/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=part4_as.htm
Then, you will have to format the text either by setting the CSS properties with setStyle("p",{CSS commands}); or you can call the CSS from outside your swf. Check livedocs.
This is a little annoyance that I ran into when I was trying to load CSS styles on HTML rendered in a dynamic text box.
farafiro
02-05-2004, 02:01 AM
heyder
I didn't quite get what u mean
but as pinch150g said u can do this by setting the text with Action Scipt, save it to a variable first then u can grab thvariable's value anytime
heyder
02-05-2004, 02:29 PM
But if the textfield is input text that won't work.
pinch150g
02-05-2004, 02:33 PM
What are you trying to do exactly? Render Text from an input field to HTML? I am not clear on what you are trying to accomplish.:confused:
Pinch
heyder
02-05-2004, 02:41 PM
Basically I am taking text from flash and storing it in a database. I don't want to have all the flash specific html included with the text.
All I really want is to keep line breaks or /n or <p> tags whatever works.
Like I said in the original post I can strip the tags with php but thought maybe it would be better not to have to send all that extra data to the server just to strip it.
pinch150g
02-05-2004, 02:50 PM
I'm not sure how you could do it unless you created the input text fields with AS. I think you can do this by setting the footext_txt.type = "input"; Maybe the fucntion that does the 4.0 spec HTML will not run. You can always check this by looking at the variables in your Debug window (ctrl+alt+v) while you are in Test Movie mode. There you will see your text box with all the variables that are either set or not set. Otherwise, you may need to use PHP
Pinch
splict
02-05-2004, 02:52 PM
well, your php functions for stripping data are faster and easier to use, so, personally i would go that route over the saved bandwidth.
Off the top of my head I guess you could .split your text based on '<' and '>', etc. And then join it. Check out http://proto.layer51.com I'm sure there is stuff under String that would help. Especially check senocular's post(s)
-splict
heyder
02-05-2004, 06:35 PM
k.
thanks.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.