Thanks, Jim. I appreciate your help. Your post makes sense to me and
I'll play with modifying the styleSheet object.
If anyone has examples of this, it would probably save me a couple of
hours experimenting.
Thanks all,
Marc
At 11:24 AM 12/6/2006, you wrote:
You can do this. I don't have time to do even pseudocode, but....
Once you've loaded a sylesheet from a file, you can modify it.
Therefore, you can build a function to:
1. Modify a property of your styleSheet object.
2. Broadcast notification that it has been modified to all interested
text fields. If you don't know what I mean, look into
EventDispatcher, AsBroadcaster, or the Observer Pattern in general.
Once each textfield is notified that there's been a change in its
stylesheet, it can trigger a function to reassign its stylesheet
property to that altered stylesheet. Kind of like refreshing....
Jim Kremens
On 12/6/06, Marc Hoffman <[EMAIL PROTECTED]> wrote:
Well, one question leads to another :)
First, thank you Jim -- I had avoided "embedFonts" thinking it would
embed the entire character set, but according to the Size Report it
embeds only those characters I embed in the dummy text fields. So now
it's working fine.
And now my next question: Is there a way to dynamically
increase/decrease type size when using CSS? Once the CSS is loaded
into the swf, can I modify its font-size settings? I can change type
size using textFormat, but since it seems you can't combine
textFormat with CSS, I lose the benefits of CSS (in particular the
ability to define a:link and a:hover).
thanks,
Marc
At 09:47 AM 12/6/2006, you wrote:
>Just checking for gotchas...
>
>Are you loading text into a textfield on the stage, or creating the
>field dynamically?
>
>Either way, set myTextField.embedFonts = true; if you haven't already...
>
>Jim Kremens
>
>On 12/6/06, Marc Hoffman <[EMAIL PROTECTED]> wrote:
>>I am having trouble getting Flash to embed a font that is
designated by CSS.
>>
>>In Flash:
>>- I create a textfield, create a loadVars and a StyleSheet, load the
>>CSS into the StyleSheet, and designate the style sheet as the style
>>for the text field. I then load text into the textfield (currently
>>using hard-coded AS, but eventually it will be xml).
>>- I also create dummy text fields to embed the fonts in Flash that
>>the CSS uses.
>>- I then generate the .swf for testing.
>>
>>The CSS file is present and working.
>>
>>When I play the swf, Everything works okay ONLY IF the font is on my
>>system. If I remove the font from my system and double-click the swf
>>again, the font is replaced by a system-resident font.
>>
>>Is there a right way to embed a font in a swf so that when it is
>>called by CSS, it will display even if it's not on the user's system?
>>
>>TIA,
>>
>>Marc Hoffman
>>
>>
>>_______________________________________________
>>Flashcoders@chattyfig.figleaf.com
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com
>>http://training.figleaf.com
>
>
>--
>Jim Kremens
>_______________________________________________
>Flashcoders@chattyfig.figleaf.com
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
--
Jim Kremens
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com