PDA

View Full Version : Loaded Components Error



irrationalistic
January 8th, 2009, 02:41 PM
Hey guys,

I have been searching for hours and it seems that the problem I am having is so specific that I don't even know what to search for.

Essentially, I have two SWFs. In one is a form where I use several components to receive user input. The other SWF loads the form and then displays it.

Sounds simple enough, but for some reason, every time i run the main SWF, the form components do not display any text. Even when I click on one and type information, the text will not display. My form validation script shows that text does exist there, it just won't display.

Does anyone have any idea as to why this might happen?

cesig
January 8th, 2009, 03:29 PM
My first thought is that it's a font issue. Look to make sure everything is included and embedded properly.

irrationalistic
January 8th, 2009, 03:32 PM
That's partially the problem. How does one embed a font on a component? I tried using the .setStyle("embedFonts", true) and also tried adding a font to the library and using .setStyle("fontFamily", MyFont). None of the embedding options I have found work.

cesig
January 8th, 2009, 03:34 PM
I don't know that I'll be much help here. I haven't had much luck with the Flash components, either.

Which SWF's library did you add the font to?

irrationalistic
January 8th, 2009, 03:35 PM
The loaded clip. Perhaps I should add it to the parent clip as well...

I'll give that a go and see what happens...

irrationalistic
January 8th, 2009, 03:43 PM
Well, that didn't work...

I added a font to both the parent SWF and the child SWF and did both setStyles and didn't see any change.

irrationalistic
January 9th, 2009, 03:22 PM
So good news, I found the root of the problem. It wasn't the fonts at all, but rather due to the fact that I was masking the loaded content in the parent container. Funny how its the little things we never think about!

Anyways, the solution that I found to work temporarily is to set all the components in the child clip to "cacheAsBitmap". For some strange reason, this must allow them to work more cleanly with the mask.

The next problem is that they won't pick up any events from the mouse. I'll have to see what I can do about that later though...