Re: SV: [Flashcoders] CSS with input text, simple editor, sourcefiles

2006-03-20 Thread Danny Kodicek

I wrote a simple little system for textformatting with

textField.htmlText. It is really primitive, but we have used it and it
is entirely
possible to make it work.

Thanks - it's fairly similar to what I'm doing too. My solution (which 
appears to be working) is to make two functions, HTMLtoXML() and 
XMLtoHTML(). When importing or exporting text, I use the XML format, which 
is my own and under my control. Then XMLtoHTML essentially acts as a 
stylesheet, and HTMLtoXML is a system which strips out all the tags I don't 
need and restores my XML format. It's not nice, but it's brought everything 
back into a position where I know what's happening. Now I can make my html 
field editable, knowing that as soon as I have any problems I can just run 
my translator and it'll fix them.


Danny 


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: SV: [Flashcoders] CSS with input text, simple editor, sourcefiles

2006-03-20 Thread Eskil Janson

Hi

I wrote a simple little system for textformatting with 
textField.htmlText. It is really primitive, but we have used it and it 
is entirely
possible to make it work. It is basically a very simple HTML editor for 
the flash text format (textField.htmlText) and comes with a tool to tag 
it and and untag it in an XML/HTML safe format, so that you can store it 
and send it in simple textnodes, without loosing the formatting information.


download sourcefiles here if you want to check it out:

http://www.eskiljanson.com/asml_tagger/tagger_stuff.zip


And this is the only manual (sorry for that)...

1. Make executables from the sourcefiles or atleast swf them, (notice 
the little class that has to be accessible and

exchange the fonts in the library to fonts of your choice.)

2. Use the ASWord to see what the textformat code you write in the right 
textfield does to your left textfield.
If you change the type of the left textfield in the sourcefile to 
"input" you can also just paste in any formatted text and see what it 
codes to.

This can be useful to start with.

The reason why I disabled this feature, is that to write useable code 
(not the crap flash autogenerates) you will want to have som control
over when your codeview window on the right is updated. It is not nice 
when hours of work disappear...


3. Use the ASMLTagger to tag the code to a format that is not interprted 
as XML or HTML, that you may send in an XML
textnode. (Just paste in the code you generated, and press the tag (or 
untag) button)


4. In your project, implement the "untagIt" function somewhere to 
convert the text back to flash readable HTML-text.


5. Assing the result to your textfield as .htmlText. don't forget to 
embed fonts (yourTextField.embedFonts = true;)


As I said this is simple stuff, and comes as is, there is no support for 
this product...This_ is _the only manual


With that said, IF anyone find it useful, or improves on it,please let 
me know!


Regards

/Eskil Janson
[EMAIL PROTECTED]





Martin Baltzer skrev:

Hi Danny,

I don't know if this will help you at all, but the TextField.Stylesheet class has a transform() 
method which will convert _one_ of your style objects from the Stylesheet (ie. The one you maybe 
assigned for the  or the  element or  element) into a 
TextFormat object which you can then apply to your TextField with setNewTextFormat.

It is also possible to transform several style objects into the same TextFormat 
object, but doing this the other way around is a lot more complicated but I 
gues it could be solved by writing a your own parser to rewrite the HTML that 
flash generates - maybe its already out there ;-) ?

I hope this is helpful otherwise throw it away ;-)

Cheers
Martin Baltzer


-Oprindelig meddelelse-
Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Danny Kodicek
Sendt: 20. marts 2006 12:12
Til: Flashcoders mailing list
Emne: Re: [Flashcoders] CSS with input text

  
Is not possible at all. When flash parses a CSS styled html, it simply  

replaces all the tags with the corresponding formatting code (textformat,  
font, etc).


Ugh, ugly. Thanks.

Danny
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



  



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com