To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flex and AIR

Reply
 
Thread Tools Display Modes
Old 09-14-2007, 11:03 PM   #1
Kid Charlie
Senior Member
 
Join Date: Sep 2005
Location: Detroit
Posts: 193
resolved [RESOLVED] Embedding font --> invalid data?

I have no idea what is going on here. Any one else having similar issues?

Code:
Embed(source="/Library/fonts/SwissBTExtCom.ttf", fontName="Swiss 911", mimeType="application/x-font-truetype")]
This throws:
Quote:
Error: Error #2136: The SWF file contains invalid data.
I can't find anything about this anywhere... Thanks for the help.
__________________
While the music played you worked by candlelight
Those san francisco nights
You were the best in town
Just by chance you crossed the diamond with the pearl
You turned it on the world
That’s when you turned the world around
Kid Charlie is offline   Reply With Quote
Old 09-16-2007, 11:05 AM   #2
cancerinform
Mod
 
Join Date: Mar 2002
Location: press the picture...
Posts: 12,744
Just for clarification, do you have the line between <mx:Script> tags?
Have you tried this: source="SwissBTExtCom.ttf"?
__________________

- The right of the People to create Flash movies shall not be infringed. -
| www.Flashscript.biz | Help a little girl, Ana, who has cancer. | Flashscript Biz Classes/Components | The new Event design pattern | Clothing for Haiti |
cancerinform is offline   Reply With Quote
Old 09-17-2007, 08:56 AM   #3
Kid Charlie
Senior Member
 
Join Date: Sep 2005
Location: Detroit
Posts: 193
Thanks for the response CancerInform, This is actually just outside a class in a class/Package file. The class is being called from inside the mx:script tags.

I did put the font in the local directory and no luck there either. (FYI: it needs to be source="/SwissBTExtCom.ttf", for some reason). I am really stuck here. Any other suggestions?
__________________
While the music played you worked by candlelight
Those san francisco nights
You were the best in town
Just by chance you crossed the diamond with the pearl
You turned it on the world
That’s when you turned the world around
Kid Charlie is offline   Reply With Quote
Old 09-18-2007, 07:09 AM   #4
cancerinform
Mod
 
Join Date: Mar 2002
Location: press the picture...
Posts: 12,744
You can try this and create a style script:
PHP Code:
<mx:Style>
        @
font-face
        
{
            
src:url("/Users/username/Library/Fonts/myfont.ttf");
            
fontFamily:myFont;
        }
    </
mx:Style>
__________________

- The right of the People to create Flash movies shall not be infringed. -
| www.Flashscript.biz | Help a little girl, Ana, who has cancer. | Flashscript Biz Classes/Components | The new Event design pattern | Clothing for Haiti |
cancerinform is offline   Reply With Quote
Old 09-19-2007, 04:04 PM   #5
Kid Charlie
Senior Member
 
Join Date: Sep 2005
Location: Detroit
Posts: 193
Thanks for the help CancerInform. That method did work but I needed to use TextFormat instead of HTML or css text.

I finally figured out what was going on. For each font you need to create a private class under to load. So for my example above:

Code:
		[Embed(source="/SwissBTExtCom.ttf", fontFamily="Swiss911", mimeType="application/x-font-truetype")]
		private var Swiss911:Class;
This was an error with ActionScript 3.0 Cookbook. That is annoying. Spend $50 and still need to find the answers on the Web.

Hope no one else wastes their time on this. Don't forget t(:TextField).embedFonts = true;
__________________
While the music played you worked by candlelight
Those san francisco nights
You were the best in town
Just by chance you crossed the diamond with the pearl
You turned it on the world
That’s when you turned the world around
Kid Charlie is offline   Reply With Quote
Old 09-19-2007, 04:37 PM   #6
cancerinform
Mod
 
Join Date: Mar 2002
Location: press the picture...
Posts: 12,744
I knew that but I thought you had done that, because the rest of your script was correct.
__________________

- The right of the People to create Flash movies shall not be infringed. -
| www.Flashscript.biz | Help a little girl, Ana, who has cancer. | Flashscript Biz Classes/Components | The new Event design pattern | Clothing for Haiti |
cancerinform is offline   Reply With Quote
Old 09-21-2007, 03:57 PM   #7
Kid Charlie
Senior Member
 
Join Date: Sep 2005
Location: Detroit
Posts: 193
You would have thought. But hey thanks for the help. Problem solved now.
__________________
While the music played you worked by candlelight
Those san francisco nights
You were the best in town
Just by chance you crossed the diamond with the pearl
You turned it on the world
That’s when you turned the world around
Kid Charlie is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flex and AIR

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:13 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.