Click to See Complete Forum and Search --> : FDTDefineText FTextChangeRecord FTextGlyphRecord

07-25-2000, 05:29 PM
I'm getting some rather strange problems with the FDTDefineText class in the SDK. At certain times, the WriteToSWFStream function call of the class (the part being called by either one of the 2 child classes of FTextRecord) would write a bunch of messed up values to the stream, starting with the first byte which has all the flags. What happens exactly is in one of the FDTDefineText object, starting from something like the third FTextRecord to the end of that DefineText is all messed up in the file that is written by the FObjCollection. This only happens at exactly 1 of the many FDTDefineText objects in the FObjCollection. And the same thing happens each time, so I don't think it's a memory leak or the such. Has anyone else had this problem? Any help would be greatly appreciated.

07-26-2000, 01:03 AM
I use my font classes instead of the MM stuff because they are a lot more powerful, but if you want to use the define text stuff...I'll try to help.

I know that there is a problem with the shape record stuff. When you add a record with 0,0 length (either curved or straight), the player can't properly read the info. Make sure this never happens (you can either skip those records or put a 1,1 or something to that effect instead.


07-31-2000, 10:47 AM
Thanks for the reply. I figured out what was wrong. Just to let those who are using the SDK know, there is a little bug in the FTextRecord class's member function that writes to the SWFStream. The problem is that, when there is an list of Glyph records, they can be attached one after the other. However, when there is a changeover from a glyph record to a text style change record, the format demands that at the end of the last glyph record before the changeover the stream be byte-aligned. And this byte-align part is not in the member function. So, sometimes it works (when this doesn't happen or the bits just happened to be aligned), but when it is not aligned, the problem will show up.