942,790 Members | Top Members by Rank

Ad:
Aug 13th, 2009
0

Loading External Text in Flash Using AS3 URLLoader

Expand Post »
hi
I am doing a flash website in danish language.i am using loading external text method.I am not getting special chatacters which are used in the language (ex: æ,å, ø).please tell me how to display in flash swf.i have tried this with url encoder but some characters are working.others are coming like boxes.please do reply me.
thanks.its urgent please help me
lydia
Similar Threads
Reputation Points: 3
Solved Threads: 2
Junior Poster
kings is offline Offline
107 posts
since Nov 2007
Aug 13th, 2009
0

Re: Loading External Text in Flash Using AS3 URLLoader

Do you give the font that you used for the danish language? Let I will try...
Reputation Points: 167
Solved Threads: 239
Nearly a Posting Virtuoso
rajarajan07 is offline Offline
1,445 posts
since May 2008
Aug 13th, 2009
0

Re: Loading External Text in Flash Using AS3 URLLoader

I remember having similar problems using flash 8 several years ago.. Certain extended ascii characters wouldn't show up in dynamically loaded text.

The solution was to select the dynamic textbox that the text was loaded into, open the properties panel and click on the 'Embed..' button. This allows you to select which characters from the font are embedded into your movie. I think by default it only includes the 'Basic Latin' character set (95 characters) in the English version of flash...not sure about flash in other languages!

I assume that you'll be needing to use either 'Latin I' or one of the 'Latin Extended' character sets.

Anyway, as long as your font contains all of the relevant characters and the character embedding settings are set appropriately your text should appear correctly.

Obviously, that was in the Flash 8 IDE. I'm not sure if this still applies to the CS3/CS4 IDE's, but it couldn't hurt to check.
There should also be a way of setting this via actionscript, but if there is, offhand I can't think of it!

The reason for the Character Embedding setting is to keep your .swfs filesize down.

For example:
Imagine you have a font which contains all possible 39,477 glyphs (which would be one massive .ttf file!) and you're using it in a text box to display some text.

If you export your movie with the default settings (Basic Latin - 95 chars - A..Z,a..z, 0..9 and basic punctuation) then any extended characters/glyphs (i.e. the other 39382 in the font) will not be included and therefore will not be shown if they appear in the text in the textbox.

So if you need to display additional characters, you need to select a different character set to embed. (you can also specify additional individual glyphs if need be!)

Whereas if you were only using the numerical digits 0..9 in your text-box, you could set the embed settings to 'Numerals' so the only characters from the font to be embedded in your .swf would be the characters 0..9.

That way only 10 glyphs out of the 39,477 in the font would be included in your .swf instead of the default 95 of 39,477.
Meaning that you've got 85 less glyphs in your movie and thus you save some space in your swf.

You've got the former problem, you need to alter your Embed settings to include more characters. Your movie will be a little bigger in size, but you'll be able to see all of the characters.

Like I said, I'm not sure if it's still possible to do the above in CS3/CS4, but it might be worth a look!
Cheers for now,
Jas.
Reputation Points: 590
Solved Threads: 123
Practically a Master Poster
JasonHippy is offline Offline
672 posts
since Jan 2009
Aug 13th, 2009
0

Re: Loading External Text in Flash Using AS3 URLLoader

Just found this little AS3 snippet:
ACTIONSCRIPT Syntax (Toggle Plain Text)
  1. [Embed(source='assets/ttf/gothic.ttf', fontName='CenturyGothic', mimeType='application/x-font', unicodeRange="English")]
at the following URL....
http://ricozuniga.com/2007/07/13/uni...ge-references/

Might be worth a try, if you're embedding the font in code, then setting the unicode range as above might help. (you'd just need to find out what the Danish unicode range is! )

Also take a look at the following:
http://livedocs.adobe.com/flex/3/htm...=fonts_07.html

Cheers for now,
Jas.
Reputation Points: 590
Solved Threads: 123
Practically a Master Poster
JasonHippy is offline Offline
672 posts
since Jan 2009
Aug 14th, 2009
0

Re: Loading External Text in Flash Using AS3 URLLoader

Please go through the files attached:

banco.fla:
[Embed(systemFont="Banco Std", fontName="Banco",
	   mimeType="application/x-font", unicodeRange="U+0041-U+005A")]
var banco:Class;

Font.registerFont(banco);

Shows you how to embed and register the font with flash at runtime

fonttest.fla:

var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, fontLoaded);
loader.load(new URLRequest("banco.swf"));

function fontLoaded(e:Event):void
{
	var tf:TextField = new TextField();
	tf.width = 600;
	tf.embedFonts = true;
	tf.defaultTextFormat = new TextFormat("Banco", 60, 0x000000);
	tf.text = "RUNTIME FONTS";
	addChild(tf);
}

Shows how to utilize the embedded font into your textfield

Hope this helps!!!
Attached Files
File Type: zip runtimefonts.zip (18.4 KB, 110 views)
Reputation Points: 167
Solved Threads: 239
Nearly a Posting Virtuoso
rajarajan07 is offline Offline
1,445 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Graphics and Multimedia Forum Timeline: Problem with flash!! help!
Next Thread in Graphics and Multimedia Forum Timeline: Newbie needs help with Flash cs4





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC