Embedding Font Issue.
I've never had to do this before. A project I am working on requires custom fonts which I have used. I see the embed font feature which I have done. I am using Flash 8 Pro
Issues or maybe not:
1. I don't see the Font I want to embed when I click embed. So I selected Auto select
2. Do I need to upload the fonts to the same directory as the pages using it?
3. All text fields are dynamic how do I embed those dynamic fields..
Thanks for all you help...
Ultrashock Forums > Flash > Flash Professional
Posted on: 2007-04-05
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Run Time Font Embedding Issue
Hi,
I am creating a TextField using createTextField but i want to embed specific text to that textfield at runtime.
Can any one help me to embed font to a text field at run time ?
With Regards
Bharat Patel
Flex Dynamically Embedding Font Issue With Absolute URL
hey, so in Flex i'm loading in swf's that have embedded fonts. i have a loadstack class that handles fonts, and registers them. it works fine when i call the swf file relatively, but not absolutely.
i get the error =
ActionScript Code:
ArgumentError: Error #1508: The value specified for argument font is invalid.
at flash.text::Font$/registerFont()
googling the issue, no one's had it shut down when the font swf was absolute. so i was wondering if anyone had any fixes. it's loading the swf correctly, but something is weird with the applicationDomain.
in my app:
ActionScript Code:
LS.addToLoader('http://omgplaylist.com/playa/fonts/kroeger05_53.swf', {type:'font', classes:['Kroeger05_53']});
in the loadstack class:
ActionScript Code:
switch (queue[index][1].type) {
case 'font' :
var classes:String = queue[index][1].classes;
var f:Array = classes.split(',');
var FontLibrary:Class;
for (var k:uint = 0; k<f.length; k++) {
FontLibrary = e.target.applicationDomain.getDefinition(f[k]) as Class;
FontLibrary ? Font.registerFont(FontLibrary) : null;
}
break
}
it gets the FontLibrary correctly, but registerFont fails.
http://omgplaylist.com/playa/ is the app, the text on the bottom uses that font, it's loading relatively -
ActionScript Code:
LS.addToLoader('fonts/kroeger05_53.swf', {type:'font', classes:['Kroeger05_53']});
it's not a problem for me yet, i'll be able to do it the way it is but in the future i might need to change it. i've tried checking for a policy file but that didn't do anything because it's actually getting the swf.
thanks for any help.
Wierd Font Issue, Text Dissapearing After Embedding
Hey everyone -
I'm having a very frustrating problem. I have a text field that I am loading text into dynamically. I am loading it with html tags and have that selected on the textfield.
I've applied some css to the textfield to highlight <a> tags. It shows up when i publish the movie when the fonts aren't embedded, but as soon as i embed the font, all of the things in the <a> tags disappear.
If I take out the css styles, everything shows up fine. I don't get it...
Can anyone help???????
Thanks
Button - Embedding Font Issue W/Mask Into Loaded Movie
I have a CS3/AS3 button that is behind a mask. If I embed the font, the button label appears without a problem. However, when this SWF gets loaded into another movie, the button label is no longer visible. I followed this example - http://blogs.adobe.com/pdehaan/2008/..._with_the.html, for embedding the fonts, and was able to reproduce my issue with his example as well.
Can someone provide some insight on how to resolve this issue.
Thanks for any and all replies.
Embedding Font And Dynamic Html Text -> Font Is Gone
Hi there ,
I've been searching all over this forum and searched on Google for an answer to this question but can't find an answer that works to me.
I have some dynamic textfields and I retrieve the data from a databases. Each textfield has a handwritten font which I embed using Character Options in the Text Properties. That works fine.
The problem is, when I check the 'Render as HTML' checkbox and send simple HTML-tags to it, the html-tags still work but the handwritten font is gone! I really tried lot of things but it really doesn't work to me.
I really hope someone can help me. I really appreciate it!
Kind regards,
forcer
Embedding A Font
How would I go about embedding a font in a dynamic text box that loads itself from a text file with a scrollbar attached to it?
Font Embedding
Hi all, I have a dynamic textfield that load its text from an external txt file. How can I make it display a special font? I tried the embedded option but all I get is an empty textfield?! Do I have to specify the font face in my external txt file? I'm a little lost!
Thanks in advance
Isengard
Font Embedding
I cannot get my font to load correctly in other people's machines. I used WEFT to make the .eot file, and that has been uploaded, and my script URL points to it. The page is here...It's probably just a minor coding issue or something.
http://www.specialedword.com/history2.htm
Embedding A Font
i have a slight problem, i am using eurostar font for all my movies and i have a couple of questions... when i embed a font into my library, and tested the movie , then ran it in another computer without the font, it didnt embed it. do i have to linkage export for actionscript?
also how can i make sure that the font size doesnt change when i make my field dynamic?
thanks in advance
Embedding A Font? Bug?
In this movie:
http://www.midnight007.com/pizza/layer_root_3.swf
When you click on any of the pizza slices (which pulls up another movie layer), the dynamic titles switched by a switch statement do not show up. They show up on any computer that the font is ON. However, I can't get the titles to work on any other computer. I've tried embedding the characters of the font, I've tried linking the font from the original root movie, and I've also tried actually writing the titles in the movie to the right of the frame (as you will see - and those are in the correct font) - but still the dynamic title is not showing up on computers that don't have the font.
Any other ideas as to how to get the titles to show up?
Embedding A Font
Hi, I need help with a problem with embedding a font and using it to format a dynamic scrollable textbox in actionscript, maybe I've missed something fundamental.
Anyway, I first added a font to the library and did the linkage and gave it an identifier of Font_MSS with the export to action script checked.
then in the following code I added the line to the “// format the font for the scroller text” section with :-
scrollerTxtFormat.embedFonts = true;
Although the text shows up it has no effect on the font itself, it remains as the default font.
any ideas?
many thanks
Cheers Rob.
Code:
// Loads the XML file
#include "external as/xmlnitro.as"
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("xml/StringAboutText_XML.xml");
// Variables to hold the node and attribute values from the XML file.
function loadXML(loaded) {
if (loaded) {
_root.scrollerTxt = this.firstChild.childNodes[0].firstChild.nodeValue;
// Create empty textfield called scroller
_root.createTextField("scroller", 14, 40, 270, 500, 162);
//scroller.embeded = true;
scroller.type = "dynamic";
scroller.multiline = true;
scroller.html = true;
scroller.wordWrap = true;
scroller.selectable = false;
scroller.htmltext = _root.scrollerTxt;
// format the font for the scroller text
scrollerTxtFormat = new TextFormat();
scrollerTxtFormat.embedFonts = true;
scroller.setTextFormat(scrollerTxtFormat);
// create a scrollbar for the scroller text
_root.initialization = {_targetInstanceName:"scroller", horizontal:false};
_root.attachMovie("FScrollBarSymbol", "scrollBar", 15, initialization);
scrollBar._x = scroller._x+scroller._width+15;
scrollBar._y = scroller._y;
scrollBar.setSize(scroller._height);
// Format the scrollbar
scrollBar._width = 15;
scrollBar.setStyleProperty("arrow", 0x000000);
scrollBar.setStyleProperty("scrollTrack", 0xFFFFFF);
scrollBar.setStyleProperty("face", 0xFFFFFF);
scrollBar.setStyleProperty("highlight", 0xFFFFFF);
scrollBar.setStyleProperty("highlight3D", 0xFFFFFF);
scrollBar.setStyleProperty("shadow", 0xFFFFFF);
scrollBar.setStyleProperty("darkshadow", 0x000000);
} else {
trace("xml file not found!");
}
}
Second Day Without Font Embedding...
I'm at a loss for how to fix my font embedding issue. I've redone it many times using adobe source, AS3 Cookbook source, online tutorials, searched forum results, and nothing works. I have a font, Square721ExBT. It is inside my windows/fonts directory. I've tried some of the following, comment lines show different methods:
ActionScript Code:
// _header is a new TextField(); Assume after first example the _header lines are the same
[Embed(source='C:WindowsFontssqr721e.TTF', fontName = 'Square721', mimeType='application/x-font-truetype')];
_headerFMT = new TextFormat();
_headerFMT.color = 0xFFFFFF;
_headerFMT.font = new Square721;
_header.embedFonts = true;
_header.autoSize = TextFieldAutoSize.LEFT;
_header.text = "This is a header font.";
_header.setTextFormat(_headerFMT);
//////////////////////////////////////////////
// Attached in Library Given name of Square721
_headerFMT = new TextFormat();
_headerFMT.color = 0xFFFFFF;
_headerFMT.font = new Square721(); //Compile error
//////////////////////////////////////////////
// Read that the name matters tried sqr721e
_headerFMT = new TextFormat();
_headerFMT.color = 0xFFFFFF;
_headerFMT.font = new sqr721e(); //Compile error
The list goes on as I've been trying for quite some time now. Many give me errors, few just don't do anything. The closest I've ever been was one showed the text in white but using Times not my font. Please any suggestions! Also I can never set the defaultTextFormat of the textfield. It returns "1195: Attempted access of inaccessible method defaultTextFormat through a reference with static type flash.text:TextField."
Embedding Font Help
Hi, All!
I am reading flash help file about embedding font, and more I read more I confuse. If someone could answer my questions I would be very thankful, because I am stuck.
1)If I am using Static text box, I do not have any opportunity to embed a font for it? What should I do, if the font is not installed on a user's system? The only way out is to make it bitmap text?
2)If I need to use some special font in dynamic text field, why do after embedding font into the library I also need to embed characters? If I embed only Characters, my font is shown also on the user's system, that doesn’t have that font installed, than why I should I embed font and when should I embed?
Please, someone, answer…
Font Embedding
I've been scouring the internet for the last few days trying to fix this issue that I'm having. I'm working on a project in CS3, using Actionscript 3.0 and cannot for the life of me get my fonts embedded. I am using the "FFF" fonts, namely FFF Executive Extended, and FFF Business.
ActionScript Code:
var myTextFormat:TextFormat = new TextFormat();
myTextFormat.font = "FFF Executive Extended";
myTextFormat.size = 8;
var myTextField:TextField = new TextField();
myTextField.text = "blah blah blah";
addChild(myTextField);
myTextField.setTextFormat(myTextFormat);
the text fields are being created from external .as files, which are working fine. If I have the fonts enabled on my computer everything is displayed perfectly, but if I disable the fonts, a default font is used.
I've tried to embed the fonts using the method which requires creating a new library instance of a font, checking the linkage properties so that it exports for actionscript and exports in the first frame.
I've also created a dynamic text field on the stage, chosen to embed characters, and selected relevant characters - I even tried it once with all characters chosen. No dice.
Like the subject line says, I'm at my wit's end with this, because I simply cannot figure out why this isn't working! Please please please help me!
Font Embedding
So, I tried this in different ways, but nothing seems to have worked so far.
I have a movieclip containing a vector and in it I want to place a label. I linked this movieclip to a class. The movie is supposed to be scalable, so I can't just add a textfield with embedded fonts to the movieclip in the library, since it would stretch.
That's why I want to add the textfield dynamically through the class constructor. I created a font symbol in the library, but I can't quite figure out how to import and use the font in an external class.
edit: I'm not using Flex, just AS3. So [Embed] won't work
Font Embedding
Hi,
I want to use Futura LT BT and Futura MD BT font in dynamic labels, I have already embedded characters as described in Flash Live docs, but it is not working consistently. On Some screen it works and on some screens my label just disappears.
I also tried font embedding my creating font symbol in library and then importing runtime, but I got the same inconsistant result as described above.
If anyone has another solution then please revert back.
regards
Paresh Maru
Font Embedding
Here is a site that loads fonts as part of a shared library I think.
Blue Cotton
I have a site that has 90 fonts for a design application. The shared font file is 3.8 megs! It takes forever to download. In my shared font library swf that is 3.8 megs I just have the fonts in the library and then a linkage id. I believe these fonts are embedding all character glyphs. I could really shrink the size of my shared font library if I could change this to only upper case, lower case and punctionation. Is there a way to do that for each font?
Or is there a better way than how I'm doing this?
Thanks
Embedding Font.. I Know..
I have a main swf. It loads child swf's using loadMovie.
I embed a font in one of the child swf's by saying Character > All.
Do I have to embed the same font in all of the child swf's ?
Thanks
Embedding A Font
I found a tutorial online about embedding a font which I've been trying to do. I'm using a minimal font. I went into the character options and click 'embed all characters' then I exported the file. I posted it and the fonts look blurry, did I do something wrong during the process? Thanks everyone. First time user on this forum.
Rob
Embedding Font On Swf
im having problem on sticking my font on swf's. fonts on my swf seems to appear on local computer but it is replaced by default font when viewed on other computers. can anyone help me.. tnx.. im using flash mx 2004 right now.. i remember that it is automatic on flash 5..
Embedding Font.. I Know..
I have a main swf. It loads child swf's using loadMovie.
I embed a font in one of the child swf's by saying Character > All.
Do I have to embed the same font in all of the child swf's ?
Thanks
Embedding A Font?
Alright, I got 3 fonts that are used in my site design, no one can see them (or at least, I don't think they can) they say it's blurry (most likely because they're seeing the wrong font (arial or something), so...I think embedding the fonts is what I want to do, right? And if so, how do I do that?! Thanks for the help.
Font Embedding
Hi All,
I am working on a project where i need to embed diffrent font to diffrent Text Fields. As there are tooo many fonts i am trying to use font shared fonts but its not working....
Can any one help....
Thanks
Monica
Embedding A Font
Hi there!
.
Please visit query31.net
.
You`ll notice that the font used in the floating captions
is different to the one which is used in the info-text.
The caption`s text comes from a variable which is
different for each button.
.
I thought fonts are embedded automatically?
Does this work for dynamic text, too?
How? (;
Font Embedding
so I tried embedding fonts in my flash file..weird issue, I clicked on my dynamic txt box, then hit embed, selected upper,lower, and symbols. when I go to test the movie the type is all distorted and wide? have any info for me
Embedding Font
Hi guys,
Straight to the question: i have several text fields in my movie (dinamic and input), is it possible to embed a font once for all the fields or do i have to embed it for each of them?
Thanks in advance.
A
Embedding Font
Is there a way to embed a font for the whole movie with all its variations like Bold, Italic, Underline?
Font Embedding... Help
Hi there,
Is there any way to make a swf install a font into any computer that runs it? I've tried the dynamic text embeding thingie but I didn't get it to work, so I wonder if I could just make the swf upload the font to the user...
it's really important, since no text at all is appearing in some computers...
thanks in advance.
Problem In Font Embedding
hi everybody
in my site i m using rare fonts, which is only i m having. To make it visible on viewers pc, I have to break apart all the matter of that font but that time the size of movie increases, To avoid this what i should do, plz help me.
Font Embedding Question...
is it possible to embed a font in a flash movie just once in the main movie clip and have all other movie clips loaded dynamically use the same font without having to embed it in every instance of a loaded clip?
if it is, how is one to accomplish this?
zachary
Globally Embedding A Font?
Is there a way to globally embed one or two fonts? Like, if I have 20 different swfs that gets loaded in and out of 1 main swf, can I just embed the font in that main swf and have it work for every dynamic field? If so, how do I do it?
Font Embedding With Preloader
Hi,
I've following problem.
In my flashmovie I use an embedded font for dynamic Textfields. My preload-Animation runs between frame 1 and 3. But it appears when the font is loading completely. (10 seconds is showing a blank screen). What can I do to start the animation immediately?
Thanks a lot
Rocco
TextArea Font Embedding
I have a textArea component (mx 2004 pro) on the stage at _root. Here's the code.... The xml loads fine, but the font will not embed. If I publish the movie then delete the font from my font's folder to test, it defaults to times roman....HELP!!!!!!
_global.styles.TextArea.setStyle("backgroundColor" , "none");
_global.styles.TextArea.setStyle("fontSize", "8");
_global.styles.TextArea.setStyle("embedFonts", "true");
_global.styles.TextArea.setStyle("fontFamily", "FFF Business");
var xmlURL = "beliefs.xml";
var myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success) {
if (success) {
trace("XML is loaded");
_root.beliefs.text = this.firstChild;
} else {
trace("error loading XML");
}
};
_root.beliefs.text = "";
myXML.load("beliefs.xml");
stop();
OR
var xmlURL = "beliefs.xml";
var myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success) {
if (success) {
trace("XML is loaded");
_root.beliefs.text = this.firstChild;
} else {
trace("error loading XML");
}
};
_root.beliefs.text = "";
_root.beliefs.setStyle("backgroundColor", "none");
_root.beliefs.setStyle("fontSize", "8");
_root.beliefs.setStyle("embedFonts", "true");
_root.beliefs.setStyle("fontFamily", "FFF Business");
myXML.load("beliefs.xml");
stop();
Embedding A Font But Not In Frame 1 - How ?
Hi
I've got a movie with dynamimc text fields and a couple of embedded fonts that are exported with the movie.
The problem is that the movie has a preloader in frame 1 that doesn't show until the fonts have finished loading - and this is bad news because the movie is pretty much empty apart from the embedded fonts, so what happens is that the movie shows nothing for 80k and then the preloader shows but disappears almost instantly.
How can I embed the fonts into, say, frame 2 of the movie so that the preloader will show before the fonts are loaded?
If possible I'd like to avoid having to put in a textfield containing all of the characters as I have to use a number of accents
thanks for any help you can give
:-)
Embedding Font Not Working.
hello!
I've read as much as Flashkit has to offer about embedding fonts and I've tried everything but it just won't work.
I have a dynamic textbox, I've selected the box and clicked on the 'character' button, I selected the specific ranges I want, embedded the font and exported the file but the font is not embedding.
Is there something I'm missing? Do I have to export In any specific format, like Flash Reader 5, Actionscript 2.0 or anything like that?
jo
[MX04] Embedding Font
I understand flash embedds static font automatically. It also can embed dynamic font too if u tell it too
So lets say i have a dynamic text box with the custom font embedded. I also have another dynanic text box with the same font. Do i have to embbed it again.
Embedding Font Problems
I'm not sure if I'm in the right place but here goes..
I have used a pixel font in flash (8px, all locked to pixels & nice and sharp).
All integers are set to whole numbers (W,H,X & Y)
I have selected dynamic text and embedded all characters.
It looks fine in flash but when i export to swf all the wholes in the letters fill in to solid (A's B's D's etc).
The same has happened with numerous pixel fonts, I've tried bmap and ttf and the same happens.
Any help would be amazing, thanks
Basic Font Embedding
I'm trying to understand why my embeded fonts wont work in AS3. I have extensive experience with this in AS2 but something has changed that's just not working.
I'm using the CS3 authoring tool to compile an .fla.
I included a font symbol in the library, set the linkage name to Fruitiger, checked export for AS and first frame and included the base class flash.text.Font.
Then in the class that needs it I imported flash.text.Font, flash.text.TextFormat, and flash.text.TextField.
The class is similar to this:
PHP Code:
package{
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.Font;
public class Demo extends Sprite{
var txtFormat:TextFormat;
public function Demo(){
txtFormat = new TextFormat();
txtFormat.font = "Fruitiger"
var tf:TextField = new TextField();
tf.background = true;
tf.backgroundColor = 0xFF0000;
tf.embedFonts = true;
tf.text = "Test Text";
tf.setTextFormat(txtFormat);
addChild(tf);
}
}
}
I get a red square on the stage but no text and no errors.
Any ideas on what I'm doing wrong?
[F8] ActionsScript Embedding Font
Hi,
I would like to use an outside font for XML driven text. The font should be in the same folder with the movieclip, and flash should use that font, and embed it using nothing but ActionScript. Is that possible? Thanks
Embedding Font Problem
Dear friends
I want to load some text which is right to left languagetext in flash
and show it. If I don't embed any right to left language font to it, swf
works well and shows the text true, but when I embed a font, swf
understand the font but will displace the letters of the text.for example if
positions of one of my words are like "ABCD", swf will represent
positions of the word like "DCBA". I have tried with HTML format for the text
(<html dir="rtl">) but without result.
could anybody help?
Font Embedding Problems
Hey folks,
I just started a new job and among many things I will do Flash. They ran out and purchased Flash 8, which is great.
One issue, though, I'm having. I'm trying to embed fonts for a dynamic text box with scroller. As soon as I export a swf file, Flash slows down to a crawl or crashes. My old Flash MX 2004 (after embedding the fonts) sprints through the task, displaying a beautiful swf file with scrolling text. Flash 8, after literally an hour.
Is there something new I must do that I'm unaware of?
For background, I'm on a mac, 10.4 with Suitcase fusion, the font I'm using is active and working.
Thanks for any help
CC
Font Embedding Issues
I see you guys get similar problems a lot but I couldn't find a specific response to this question.
I'm make a bunch of text fields dynamically, and setting the font to Courier New... maybe I'll just paste the code in here:
Code:
button_text = this.createTextField("button_text", this.getNextHighestDepth(), 8, 3, 10, 20);
button_text.embedFonts = true;
var text_format:TextFormat = new TextFormat();
text_format.font = "Courier New";
button_text.setTextFormat(text_format);
I've also got a pre-made text field off the stage with no text, set to the font, dynamic, with all the alphanums set to be embedded. Yet, my friend on linux still doesn't see the fonts. How do I embed them properly?
Font Embedding Problems.
Hi there!
I guess this is my first post, and im not a pro when it comes to actionscript.
And i have a problem, a big problem. And i really hope somebody can help me out.
The problem Is that i created a acordian style kind of menu wich can be seen here: http://www.i4s.org/hell/html/first.html
It was created in a program called 123flash menu, the problem is that the the program will not allow me to embed the fonts i want to use!
So ive been trying to embed the fonts wich is no problem, but i dont know how to make the flash file use them / how to call them in actionscript code.
The font i want to use are named Rosewood Std Regular and FatStack BB they are mentioned in the first frame in the "xmlString =". Anyway i really want to solve this problem and learn more about actionscript.
I tried to put all the actionscript code in this message but it was to long so i put the .fla file here.
www.i4s.org/hell/2.fla
So if anybody can post the changes i need to do in the file, and i think this might be a lot i would be be forever greatfull.
If its to compliacted dont bother, and ill do another kind of homepage
I hope i made myself as clear as possible and thank you for taking time to help out.
regards
/Marcus
Unicode And Font Embedding
I am building an application for international use. I am using an unicode 8 xml file to load in the different languages. Script works great with device fonts. However, the problem comes in when I attempt to embed fonts. When I embed a font, all Chinese, Russian, and Hebrew (etc) characters disappear, even when using Arial Unicode MS. I have tried loading specific Unicode Hebrew typefaces, and still all characters disappear.
I cannot use the author screen to create the textfields; all text formatting must be done in actionscript. Any help on this matter would be greatly appreciated.
Problem With Embedding Font
I need to embed some fonts so it will work with the tweener class only
I am having problems with embedding the font.. I have attached the fla
If i uncomment :
container.caption.multiline = false;
container.caption.wordWrap = true;
container.caption.border = false;
container.caption.selectable = false;
//container.caption.embedFonts = true;
caption_format = new TextFormat();
caption_format.color = 0x000000;
caption_format.bullet = false;
caption_format.font = 'verdana';
caption_format._alpha = 20;
caption_format.size = 20;
Embedfonts than the text does not show anymore..
If I put the text outside the function it works?? Does anybody know why:
Test code outside function i rotate the mc and text still shows so the font is embedded :
ActionScript Code:
for(var x=0;x<=6; x++){
trace(x);
test(x);
};
function test(name) {
var container:MovieClip = _root.createEmptyMovieClip('test', _root.getNextHighestDepth());
container._x = (name * 150);
container.lineStyle(borderThickness, borderColor, 100, false, "none", "none", "miter", 100);
container.lineStyle(10, 0x000000, 100, false, "none", "none", "miter", 100);
container.moveTo(0, 0);
container.lineTo(0, 300);
container.lineTo(300, 300);
container.lineTo(300, 0);
container.lineTo(0, 0);
container.createTextField ('caption', container.getNextHighestDepth(), 10, 10, container._width, 100);
container.caption.text = captions[currentPicture];
container.caption.multiline = false;
container.caption.wordWrap = false;
container.caption.border = false;
container.caption.selectable = false;
container.caption.embedFonts = true;
caption_format = new TextFormat();
caption_format.color = 0x000000;
caption_format.bullet = false;
caption_format.font = 'verdana';
caption_format.size = 20;
container.caption.text = 'Test';
container.caption.setTextFormat(caption_format);
container._rotation = 15;
}
The full code:
ActionScript Code:
stop();
import caurina.transitions.Tweener;
/** SETTINGS **/
var borderThickness:Number = 15;
var borderColor = '0xFFFFFF';
var delay:Number = 2000;
var animateDuration:Number = 2;
var maxRotate:Number = 45;
var minRotate:Number = -45;
var maxHeight:Number = Stage.height;
var maxWidth:Number = Stage.width;
/** DO NOT EDIT BELOW THIS LINE **/
var currentPicture:Number = 0;
var interval_id;
var images = new Array();
var captions = new Array();
var picListener:Object = new Object();
// Create a new XML object.
var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("photos.xml");
/** Load XML and start images slide **/
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
for (i=0; i < total; i++) {
image = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
caption = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
images[i] = image;
captions[i] = caption;
}
startSlide();
} else {
content = "file not loaded!";
}
}
function startSlide(){
interval_id = setInterval(addImage, delay);
}
function addImage(image) {
clearInterval(interval_id);
mcName = 'mc_image'
var container:MovieClip = _root.createEmptyMovieClip(mcName + currentPicture, _root.getNextHighestDepth());
var imgListener:Object = new Object();
imgListener.onLoadInit = function(targetMC:MovieClip) {
// Draw a border around the image
container.lineStyle(borderThickness, borderColor, 100, false, "none", "none", "miter", 100);
var borderHalf:Number = borderThickness / 2;
container.moveTo(0 - borderHalf, 0 - borderHalf);
container.lineTo(0 - borderHalf, container._height + borderHalf);
container.lineTo(container._width - borderHalf, container._height - borderHalf);
container.lineTo(container._width - borderThickness, 0 - borderHalf);
container.lineTo(0 - borderHalf, 0 - borderHalf);
// Set the caption
trace(captions[currentPicture]);
var caption_textfield = 'caption' + currentPicture;
container.createTextField ('caption',_root.getNextHighestDepth(), 10, 10, container._width, 100);
container.caption.text = captions[currentPicture];
container.caption.multiline = false;
container.caption.wordWrap = true;
container.caption.border = false;
container.caption.selectable = false;
container.caption.embedFonts = true;
caption_format = new TextFormat();
caption_format.color = 0x000000;
caption_format.bullet = false;
caption_format.font = 'verdana';
caption_format.size = 20;
container.caption.text = captions[currentPicture];
container.caption.setTextFormat(caption_format);
positionX = Math.ceil(Math.random() * (maxWidth - 0 + 1)) + (0 - 1);
positionY = Math.ceil(Math.random() * (maxHeight - 0 + 1)) + (0 - 1);
rotate = Math.ceil(Math.random() * (maxRotate - minRotate + 1)) + (minRotate - 1);
// Animate the image on the stage
animateImage(container, positionX, positionY, rotate);
currentPicture++;
if(currentPicture < images.length){
interval_id = setInterval(addImage, delay);
}
}
var imageLoader:MovieClipLoader = new MovieClipLoader();
imageLoader.addListener(imgListener);
imageLoader.loadClip(images[currentPicture], container);
}
function animateImage(img, positionX, positionY, rotate){
img._x = Stage.width / 2;
img._y = Stage.width /2;
Tweener.addTween(img, {_x:positionX, _y:positionY, _rotation:rotate, _xscale:50, _yscale:50, time:animateDuration, transition:"easeOutExpo"});
img = null;
}
Loading (not Embedding) A Font
Hello,
I want to be able to dynamically load a font. The path to the font (a TTF file) will be specified in an XML file. It would similar to loading a XML or bitmap.
From the examples I've seen, the font has to be embedded in the source code or has to be placed in a SWF file. This to me means that you have to load all the fonts you need in advance and someone can't add a font that wasn't already pre-loaded. Is what I'm trying to do possible?
Thanks.
Embedding Font Outlines
I've got a Flash™ movie with quite a few dynamic text fields. For each text field, I'm having to embed the same font every time. I use to think that once you embed one font, to a text field, that same font wont have to be embedded again. However, that's not happening. . . Therefore, after having to embed the same font for every text field, the file size increases each time, and publishing takes FOREVER! . . . What's the solution, or is the nature of the beast?
Good Font Embedding Tut
Does anyone know of a good tut on embedding fonts so they can be accessed with html formatted text (I need my DIN!). I can't seem to a) call the linkage of my fonts from the Library in the html b) find a tut that explains how to do this without creating a TextField object in AS...
Any help will be greatly appreciated
Brady
Flash 8 Embedding Font Is Not Possible ?
i tried to embed font in flash 8 but it didn't appear in computer that doesnt have the font.
here's what i did:
- i embed the font, make a new name "acme-15 (embedded)" and add a linkage id "acme-15" ,then i embed the textlayer
//its not working (in flash player 8)
- i even tried to code some "as", then apply the new textformat in the textlayer with var "my_txt"
var text_fmt:TextFormat = new TextFormat();
text_fmt.font = "acme-15";
text_fmt.size = 15;
my_txt.autoSize = "left";
my_txt.embedFonts = true;
my_txt.selectable = false;
my_txt.setNewTextFormat(text_fmt);
my_txt.multiline = true;
my_txt.wordWrap = true;
//its still not working
i figured it out that if you publish in flash 7 or less... the embed is working.
any idea why?
how can i embed font in flash 8?
ps.: you can see the font i embed in the attachment. i published it to 3 different flash player, 6,7 and 8. only flash player 8 that doesnt work with embed font >.<
blue text is not embed. black text is the embeded one.
regards,
www.martinsamroni.com
|