Copy link to clipboard
Copied
I've defined two different parts on Flash Timeline, like:
'a', frames 1:10;
'b', frames 11:20;
which contains two different TLFTextFields. I set the format to both of them like Font, Size, Align, etc.
Whenever I do gotoAndStop('b') the TLFTextField that is in these frames is set to default, all the formats are lost.
Is it possible to keep the format I define on the designer (Flash Professional) so I can just edit text ???
edit: Problem does not exist whenever I work on smaller movieclip (with 2-3 differently labeled parts of frames in MC). Also does not happen whenever I try to reptoduce itin new, empty project.
Movieclip I have the problem with has over 20 parts with unique label on each. Even in debugging mode, right after 'gotoAndStop', I check the clip and its format is default (TNR, default size, alignment and other properties).
Copy link to clipboard
Copied
In your setter function for the TLF instance do the properties look right (i.e. are the properties correct before you edit the text through AS)?
Copy link to clipboard
Copied
I do not set properties through the code - setting them through the designer, Flash Pro CS 6
Let me explain in more details:
- The movie clip with few section of frames is linked through AS to a class
- I have more than 20 sections (all uniquly labeled, like 'a', 'b', 'c', ...)
- I define all the TLFTextFields in the designer (Flash pro cs6)
- They have embedded fonts
I tried to debugg it and:
- whenever I stay in the first section, or even go to first section ('a') I have all the TLFTextFields correctly set (as I did in the designer)
- if any TLFTextField has the same INSTANCE name in the further section (like 'b', or 'c'), the format is propagated from the first section (like the 'text':TLFTextField is in the 'a' section, layer doesn't matter, and the 'text':TLFTextField is also in 'b' - separeted instances - the 'b' one gets the format - size/font/etc. - from 'a' TLFTextField)
- if in further section contains TLFTextField named: 'text_new' which is not present in the first part of frames - section 'a' - it gets DEFAULT format (Times New Roman, 12px, etc. etc.)
- debugging the code gives me the same results - right after gotoAndStop to section, the TLFTextField is set (from null, to an instance from MovieClip) and it has the default properties
Tried the same on a different movieclip which I created in new, empty project, and it worked perfectly (format was set ok even in further sections of frames).
Tried the same on my project with a movieclip containing 2-3-4 section of frames - works perfectly
Can't find a solution to it
Copy link to clipboard
Copied
Hm, not sure. I just use TextFields because TLF Text is wonky. You may want to try adding getters/setters so that you have breakpoints to inspect your fields. Also, you might want to try listening for ADDED_TO_STAGE, because I believe this triggers before Flash populates the instance variable. That just gives you another place to look to see if you can figure out the problem.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now