Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-04-2008, 01:09 AM   #1
sneakyimp
Senior Member
 
Join Date: Dec 2003
Location: Silver Lake
Posts: 340
Send a message via AIM to sneakyimp
Default Proper way to use external CSS, embedded fonts in AS2?

I have a dynamic text field with an instance name of txtFilmNews. I am loading some external HTML and an external stylesheet. I am also embedding fonts (Orator, regular and bold) for this text field. Everything seems to load properly -- html and stylesheets both -- however, the text shifts a tiny bit when I mouseover the hyperlinks in my text field.

I'm wondering if this has something to do with how I've embedded my fonts. I created two new font objects in my library:
DynamicFont1 - Orator 12 pt with linkage ID of DynamicFont1, exported for actionscript in first frame.
DynamicFont1Bold - Orator 12 pt *bold* with linkage ID of DynamicFont1Bold, exported for actionscript in first frame.

The stylesheet is here, NOTE that I refer to 'Orator' and not DynamicFont1 :
http://merminfilm.com/styles.css

The HTML is here:
http://merminfilm.com/getHTML.php?q=filmNews

The text does seem to appear with its regular and bold variants in various sizes and colors HOWEVER the text around the hyperlinks appears to jump when I mouseover the hyperlinks in the text. Interestingly, the jump only happens on the first mouseover and then the text is stable. What the heck? Is there some way to prevent this? To see the text jumping, go here and click 'film'...then mouse-over the hyperlinks:
http://merminfilm.com/index2.html

Am I properly embedding my fonts and assiging stylesheets? I haven't been able to locate any authoritative adobe documentation on how to use stylesheets with embedded fonts in AS2.

I am using CS3.

My code is below.
ActionScript Code:
stop(); import TextField.StyleSheet; var myStyleSheet:StyleSheet = new StyleSheet(); myStyleSheet.onLoad = function(success:Boolean) {     if (success) {         var stylesArray:Array = myStyleSheet.getStyleNames();     } else {     } }; myStyleSheet.load("styles.css"); txtFilmNews.html = true; txtFilmNews.styleSheet = myStyleSheet; txtFilmNews.width = 295; txtFilmNews.autoSize = true; txtFilmNews.selectable = false; txtFilmNews.condenseWhite = false; txtFilmNews.embedFonts = true; var lvFilmNews:LoadVars = new LoadVars(); lvFilmNews.onLoad = function(success) {     if (success) {         txtFilmNews.htmlText = lvFilmNews.html;     } else {         trace('load failure!');     } } lvFilmNews.load('getHTML.php?q=filmNews');
__________________
Write multiplayer games with FlashMOG 0.3.1
Try the MyPlan Salary Calculator
sneakyimp is offline   Reply With Quote
Old 11-04-2008, 02:08 AM   #2
sneakyimp
Senior Member
 
Join Date: Dec 2003
Location: Silver Lake
Posts: 340
Send a message via AIM to sneakyimp
Default

I finally tried one last thing. I set the font of the textfield in CS3 to '_sans' and specifed 'DynamicFont1' or 'DynamicFont1Bold' in my stylesheet. This appears to have eliminated the problem. The jumping text problem appears to happen when I specify ANY embedded font in my dynamic text field in CS3 -- including one that I actually use in the text field. Weird.
__________________
Write multiplayer games with FlashMOG 0.3.1
Try the MyPlan Salary Calculator
sneakyimp is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rich Text Editor - Does not display multiple non-system embedded fonts Ntoriuscpm Flex 2, 3 & 4 3 08-10-2010 07:53 PM
embedded fonts, css, xml, dynamic textfields erictomlinson ActionScript 2.0 5 06-21-2008 02:42 PM
Trouble with External Text, External CSS lonrhino ActionScript 3.0 1 06-03-2008 05:48 PM
Embedded fonts?? texbala Simple Stuff (Newbies) 6 07-13-2002 07:09 PM
Dynamic Text vs Static Text and embedded fonts philip ActionScript 1.0 (and below) 4 07-01-2001 12:11 PM


All times are GMT. The time now is 07:59 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.