Click to See Complete Forum and Search --> : Faster Text Rendering in flash 8?


Mctittles
08-17-2005, 05:39 PM
Anyone know if they have come up with some crazy new way to render dynamic text in Flash 8 that will make it run faster? As an example I currently have a stale project for Flash 7 that a user can fill out some forms to create a magazine style site complete with zooming, page flipping and other neato animations. The problem with it is with the way Flash currently has to animate dynamic text, once you get any real meat on your pages, adding animation to the text (flipping a page) causes an unacceptable slowdown. The project has been ditched because of this, but I was hoping their might be something in Flash 8 that could bring new life to these type of things.

rdoyle720
08-17-2005, 05:50 PM
In another thread in this forum they have this example: http://www.betaruce.com/flash_swf/blur_skew_txtField.swf

Might give you a better idea of what Flash 8 can (or can't) do.

Mctittles
08-17-2005, 05:53 PM
Thanks. I actually looked at that and that's what got me thinking of this. I'm on my 3ghz machine right now so it's not really enough text to know for sure if there is a speed increase. Also, is that dynamic or pre-rendered text? I did see an option to "treat as bitmap" or something similar in Flash 8 that won't render individual points on some things. It does look rather promising though.

FlashGuru
08-17-2005, 10:22 PM
Yes, you can draw the text into a bitmap and then animate it that way, by scaling/skewing/rotating it etc.... which is alot faster to render than the actual font glyphs.

Mctittles
08-17-2005, 10:57 PM
Very exciting news!

PAlexC
08-17-2005, 11:58 PM
Erm...if you cache the text as a bitmap, then rotate, aren't you re-caching it on each frame of that animation then? Wouldn't that be worse?

Mctittles
08-18-2005, 12:05 AM
Well, if this works how I'm thinking not. I know in the previous versions of flash if I had a page that needed animating with a large amount of text on it, instead of using a texfield in flash I would actually just save a bunch of text as a .jpg in photoshop or something and do the animation on that. So perhaps this does the same thing only from within the movie playing?

csdstudio
08-18-2005, 12:41 AM
Well, if this works how I'm thinking not. I know in the previous versions of flash if I had a page that needed animating with a large amount of text on it, instead of using a texfield in flash I would actually just save a bunch of text as a .jpg in photoshop or something and do the animation on that. So perhaps this does the same thing only from within the movie playing?

Bingo. Exactly the same. When your text changes in flash there will be a moment of non-cached view as it redraws the text then recaches it.

FlashGuru
08-18-2005, 01:12 AM
There is no moment of none-cached view, the redraw is done before the next stage update.

betaruce
08-18-2005, 05:54 AM
in my example http://www.betaruce.com/flash_swf/b...ew_txtField.swf

the text is not dynamic. it is static text and anti-alias for animation

i've tried to use dynamic text instead and obviously there is some problem e.g. the text will disappear once i skew it.

betaruce
08-18-2005, 06:54 AM
i try to draw the dynamic text into a bitmap....seems there are some problems...
i can still do the scrolling (done by scrollRect) and blur, but the effect has some problem....some part of it will disappear sometimes and reappear again when i scroll...

and it seems it cannot be skewed with matrix as it disappear immediately.

not sure if that's my code problem or what....maybe soemone can try it.

Mctittles
08-18-2005, 10:18 AM
Nooooo. Dynamic text is the only thing I was hoping for a speedup on this....

PAlexC
08-18-2005, 01:47 PM
Bingo. Exactly the same. When your text changes in flash there will be a moment of non-cached view as it redraws the text then recaches it.

But it's not just when the text changes, it's any change that would cause a MC to be re-drawn when using cache as bitmap, no? So that would me rotate, skew, etc.

Is there a complete list of what does and doesn't force a re-draw?

Mctittles
08-18-2005, 02:00 PM
I haven't tried it myself, but this is what I think is the difference there PALexC. If you draw a series of shapes in flash, say a rectangle, circle, and triangle inside one movie clip. When you animate that movie clip flash currently moves the individual points of your shapes. Four points to move for the square, 12 or 15 for the circle, 3 for the triangle. Now if instead of drawing these within flash, you create a .jpg with the same 4 shapes on it and animate that, it only has the four corners of the .jpg to deal with so the number of points being calculated has been reduced to four. With the new version when you select cache as bitmap it turns all shapes within the movie clip into one big image so there are less points to calculate which increases the speed of the animation. This becomes more of an issue when dealing with more complex shapes, namely the large amount of points that need calculating when dealing with text. As far as I know flash still has to redraw the stage every time no matter what animation you are doing, but it's the calculations required to do so that become reduced thus increasing speed. Correct me if I'm wrong because like I said this is just from what I've read.

My question still remains I guess. Can this be done with dynamic text as well?

csdstudio
08-18-2005, 02:21 PM
There is no moment of none-cached view, the redraw is done before the next stage update.

Exactly, a moment when it's not using the cached bitmap of the mc, this will cause a slight delay between the current frame and the next frame. The time between those two frames will be the same as a flash 7 file, ie. no cache.

FlashGuru
08-18-2005, 05:51 PM
Exactly, a moment when it's not using the cached bitmap of the mc, this will cause a slight delay between the current frame and the next frame. The time between those two frames will be the same as a flash 7 file, ie. no cache.

Again, i say, it is still quicker for the player to blit a bitmap into memory using the vector renderer than it is to re-draw the font-glyphs.

PAlexC
08-18-2005, 06:04 PM
So if I'm reading you right: with text, even if it's almost always re-drawing the bitmap for the cache, that's better than tweening actual text?

I suspect that will all depend on the amount of text, and complexity of the animation, but in general you may be right.

Sounds like a good question for someone in the MX blogosphere to answer.

FlashGuru
08-18-2005, 06:10 PM
The MX Blogosphere?

Yes, it will be faster, based upon my interpretation of the engineers various comments on Bitmap Caching, that is correct.

Mctittles
08-18-2005, 06:11 PM
Dynamic text anyone?

csdstudio
08-18-2005, 07:37 PM
The MX Blogosphere?

Yes, it will be faster, based upon my interpretation of the engineers various comments on Bitmap Caching, that is correct.

Where are these engineers comments? I'd like to read them and see if there are more ways I can improve performance.

FlashGuru
08-18-2005, 10:41 PM
They are not public.

If you embed fonts, then put a textfield inside a movie clip, you can actually scale, skew or rotate the text using the Movieclip.transform.matrix property or the usual _rotation, _xscale/_yscale whether that textfield be dynamic or input text.