Source language: Translate to:

Colored Text? - How can i color my text with ActionScript Co

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

Colored Text? - How can i color my text with ActionScript Co

Postby Schneppi » Sun Jul 25, 2004 3:46 am

I would like to generate a Text in my Pub which is made of multiple Strings.

Each String (each part of the Text) should have another color.

I cant find any ActionScript Command with wich i could assign a color to text.
Schneppi
 

Colored Text?

Postby Gaev » Sun Jul 25, 2004 5:50 am

Schneppi:

See this post where I re-posted details of some old documentation ...

http://www.neosoftware.com/cgi-bin/ikon ... 6&topic=89

... which should help you to display (and change at run time) the contents of the Article object, including color, size, bold etc.
User avatar
Gaev
 
Posts: 3736
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Colored Text?

Postby Schneppi » Sun Jul 25, 2004 4:22 pm

Thx gk51 - i will keep it in my personel archive too, but what i really need is a way to display text in a pub and color it later by using rgb or hex values to pick the exact color of a 32bit palette.
Schneppi
 

Colored Text?

Postby Gaev » Sun Jul 25, 2004 5:39 pm

Schneppi:

... what i really need is a way to display text in a pub and color it later by using rgb or hex values to pick the exact color of a 32bit palette.

NeoBook currently does not support any run-time alteration of any color values (it is one of the outstanding requests for the next version) ; and the rtf file format (which is what is used in the Article Object) requires any colors used in the text to be first defined in the file's "header" part ... so it requires direct manipulation of the rtf file ... not a simple task ... but you might want to check out one of the many plug-ins from Hans-Peter (HPW) ... I recall one of them had some functions that manipulated the raw rtf files.

Alternately, you might consider displaying your text in an html file format inside a Browser object ; creating html files is a lot simpler than rtf files ... and if all you are looking to do is display the same (entire) text in different colors (as opposed to a few words in red and others in green or powder blue etc.), you could just have an html template that you FileRead, do a StrReplace (for the user specified color) and FileWrite to a local .htm file that is the target of the Browser object. If you are not comfortable with html, you could also look at NeoWebEdit ... which can help with the construction of the html files from user actions.
User avatar
Gaev
 
Posts: 3736
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Colored Text?

Postby Schneppi » Mon Jul 26, 2004 11:28 am

@gk51:

This is exactly what i did  yesterday (without reading you post before).

Thank you for your help :)

(Edited by Schneppi at 7:44 pm on July 27, 2004)
Schneppi
 


Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 1 guest