Yesterday, I was playing with the new Flash Player 10 text engine and I clearly felt in love with it. The API is really powerful and you can do things just impossible to do in the past or at least hardly possible.
I came up with a little class handling different kind of smileys and even animated ones thanks to the GraphicElement class which can contain any kind of DisplayObject and therefore also the GIFPlayer class.
Notice how the Flash Player automatically handles spaces and line height break so that the GraphicElement perfectly fits. There is so much things to experiment with it !
Each time a smiley code is detected, if a Bitmap or an instance of the GIFPlayer is linked to that key the smiley is shown.
Here is a little demo :
If you guys are interested in such a class, let me know, so that I polish it and post it.
Comments (26)
That is loads of fun! I’d be interested in taking a look at the code behind that.
This is genius! We’d absolutely love some source
Hi Nate,
I am happy you like it. The whole class is around 100 lines maximum and is very easy to use. I will post it in a few days, time to add maybe some other features.
Thibault
Really, really cool. I’m so much excited with my tests using FP10.
yeah that looks cool. I’d like it.
Really cool …
I want this class too…
Funnily enough, I was also playing around with the new text engine yesterday. I was trying to get a basic text edit control working it took me a few hours to get it working so if anyone wants an example, let me know.
Hi Pleh,
Excellent ! You can post a link here so that we can have a look
Thibault
Hi Thibault,
I have uploaded an example here…
http://www.pleh.co.uk/experiments/textengine/textbox.as.txt
and a simple example of using it here…
http://www.pleh.co.uk/experiments/textengine/textboxexample.as.txt
this is very a basic example, but its a good starting point.
Excellent, I was just about to try this myself – now I don’t have to
Please can someone send me a code sample? I’ll give full credit. stefan AT flashcomguru.com
thx!
Hi guys,
I just posted a “classic” version if you want to see how it works :
http://www.bytearray.org/wp-content/projects/smileyengine/smiley-engine.zip
Note that this version does not handle animated GIF’s, I will post the animated version in a few days.
Thibault
This text is not selectable? Is it because you simply set selectable = false, or there needs t be some extra work for that? Would be good to allow reusing the text with all the smiley codes if the reader wishes so.
Dah, nice as always. But does it have xhtml support?
Hi edzis,
Yes it would need some extra work to enable editing.
Jloa,
It would also need some little work to implement XHTML support
Thibault
Thibault, xhtml support would be awesome especially if the table tag would appear ^_^
just as a reference this is a similar project based on as2 http://fosforo.theninjabunny.com/
pffff qd je pense que j arrive meme pas a mettre une image entre 2 textes ds un textField avec Flash9…vivement que je passe au 10…
I had to click through 14 runtime errors, wassup with that?
Hi blah,
Wow 14 errors ? Can you tell me more about them ? What kind of errors is it ?
best,
Thibault
That’s so pretty cool! Many thank to you, Thibault! Great finding in FP10. This is exactly what I need.
I still neeed to figure out if it’s possible to use html formated text. But your code is a good start for me.
Thanks.
would it be possible to have custom bullet points?!
Source code links are broken.
Hi AlexeyB,
You can download the sources here :
http://www.bytearray.org/?p=521
Thibault
Peter,
Yes, it’s totally possible to have custom bullets. I just finished a project for a client using the flash.text.engine classes with custom bullets. Very straightforward.
-Andrew
OMG…totally!
That’s great~! I’m also looking at the text engine right now, I just wonder how you managed to handle mouse click.
I’m trying to get a spark Button inside a GraphicElement, so far I can only display it, but no mouse click/over effect…
Trackbacks/Pingbacks (3)
[...] Flash Player 10 Text Engine [ by Thibault Imbert ] [...]
[...] > Flash Player 10 Text Engine by Thibault Imbert < ByteArray.org [...]
[...] Flash Player 10 Text Engine [ by Thibault Imbert ] (from ByteArray.org) [...]