[Flashcoders] Embedded Fonts: Works in CS4, Fails in CS5?
Hi Christoffer, thank you for the answer; but adding fontFamily didn't help. [Embed(arial.ttf, fontName=_Arial, fontFamily=_Arial, mimeType='application/x-font')] John -- I tried messing with the flex swc but that didn't do it either -- although I have a feeling that it is related to this. I am digging further in. Thanks ~Bill One of the frustrating things with CS3 Flash was (contrary to many blogs -- and I believe the docs) that you could not actually [EMBED] fonts. However this worked wonderfully in CS4. But now, in (a fully updated) CS5 I can't seem to get EMBED to work again. The below code is exactly the same in a CS4 and a CS5 FLA. Literally, the same fla file was copied and updated to CS5. The font class was untouched. All it is meant to do is display This is my text, which works in CS4. The code is the same for both CS4 and CS5. Am I missing something in the code? Or a setting? import flash.text.AntiAliasType; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; import fonts._Arial; [SWF(backgroundColor=#ddffdd, frameRate=30)] var Arial:_Arial = new _Arial(); try { var _title:TextField = new TextField(); with(_title) { x = 1; y = 1; alpha = 100; background = false; defaultTextFormat = new TextFormat(font=_Arial,size=24,color=0xff,align=center); width = 500; visible = true; selectable = true; type = TextFieldType.INPUT; antiAliasType = AntiAliasType.ADVANCED; embedFonts = true; text = This is my text; trace(Embedded); // Embedded is outputted in both cases. } stage.addChild(_title); } catch(e) { trace(error in TextField setup: + e); } // the fonts._Arial class package fonts { import flash.text.Font; import flash.display.Sprite; public class _Arial extends Sprite { [Embed(arial.ttf, fontName=_Arial, mimeType='application/x-font')] public var m_font:Class; public function _Arial():void { Font.registerFont(m_font); } } } Thanks ~Bill ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Embedded Fonts: Works in CS4, Fails in CS5?
In CS5 Publish settings, ActionScript3, Source path there was already a path set up for ., which I thought would be enough to find the package, but I changed it to the fla's directory C:\Users\John\Desktop\Temp and then it found the font package. I would have expected it to find the saved fla with . After that I had two errors FontAsset was not found (my FlashBuilder error I had seen before) and You have used a feature that requires the flex SDK. Then it said Flex SDK Path: $(AppConfig)/ActionScript 3.0/flex_sdk/4.0.0/ I clicked Update Library path to change the publish settings and then it worked okay and reported embeded. I had copied the font file into the same directory. I usually build my programs in Flash Builder and so hadn't expected the . path problem. John On 28/06/2010 13:03, Bill S. wrote: Hi Christoffer, thank you for the answer; but adding fontFamily didn't help. [Embed(arial.ttf, fontName=_Arial, fontFamily=_Arial, mimeType='application/x-font')] John -- I tried messing with the flex swc but that didn't do it either -- although I have a feeling that it is related to this. I am digging further in. Thanks ~Bill One of the frustrating things with CS3 Flash was (contrary to many blogs -- and I believe the docs) that you could not actually [EMBED] fonts. However this worked wonderfully in CS4. But now, in (a fully updated) CS5 I can't seem to get EMBED to work again. The below code is exactly the same in a CS4 and a CS5 FLA. Literally, the same fla file was copied and updated to CS5. The font class was untouched. All it is meant to do is display This is my text, which works in CS4. The code is the same for both CS4 and CS5. Am I missing something in the code? Or a setting? import flash.text.AntiAliasType; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; import fonts._Arial; [SWF(backgroundColor=#ddffdd, frameRate=30)] var Arial:_Arial = new _Arial(); try { var _title:TextField = new TextField(); with(_title) { x = 1; y = 1; alpha = 100; background = false; defaultTextFormat = new TextFormat(font=_Arial,size=24,color=0xff,align=center); width = 500; visible = true; selectable = true; type = TextFieldType.INPUT; antiAliasType = AntiAliasType.ADVANCED; embedFonts = true; text = This is my text; trace(Embedded); // Embedded is outputted in both cases. } stage.addChild(_title); } catch(e) { trace(error in TextField setup: + e); } // the fonts._Arial class package fonts { import flash.text.Font; import flash.display.Sprite; public class _Arial extends Sprite { [Embed(arial.ttf, fontName=_Arial, mimeType='application/x-font')] public var m_font:Class; public function _Arial():void { Font.registerFont(m_font); } } } Thanks ~Bill ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] removingChildAt
First - let me say that this code may be totally screwed up... that is a possibility! What I am trying to do is remove child mcs and load a new one. My code is: function onCompleteHandler(e:Event) { var pChildren:int = new int(parent.parent.numChildren); parent.parent.addChild(e.currentTarget.content); var foundMC:int=0; for (var j:int=0; jpChildren; j++) { if (foundNav==0) { if (parent.parent.getChildAt(0).name != navName) { parent.parent.removeChildAt(0); } else { foundNav = 1; } } else { parent.parent.removeChildAt(1); } } if (foundNav==1) { parent.parent.removeChildAt(0); } } } The intent of this to remove all of the mcs on the stage (except for the one that is added at the beginning of the function - making sure that the last one removed (navName) is the one that is firing this code Doing some tracing, I am seeing that it is failing like half way through the removal - say if I have 8 mcs on the stage at the beginning - it goes up to 9 when I add the new one then about half way through - at this line: parent.parent.removeChildAt(0); I am getting Error #2006: The supplied index is out of bounds I would think there would be a child at 0 if there were still children in existence... any thoughts? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] removingChildAt
On 28/06/2010 17:19, Lehr, Theodore wrote: First - let me say that this code may be totally screwed up... that is a possibility! Try: while ( parent.parent.numChildren 1){ if (parent.parent.getChildAt(0).name != navName) { parent.parent.removeChildAt(0); } else { parent.parent.removeChildAt(1); } } What I am trying to do is remove child mcs and load a new one. My code is: function onCompleteHandler(e:Event) { var pChildren:int = new int(parent.parent.numChildren); parent.parent.addChild(e.currentTarget.content); var foundMC:int=0; for (var j:int=0; jpChildren; j++) { if (foundNav==0) { if (parent.parent.getChildAt(0).name != navName) { parent.parent.removeChildAt(0); } else { foundNav = 1; } } else { parent.parent.removeChildAt(1); } } if (foundNav==1) { parent.parent.removeChildAt(0); } } } The intent of this to remove all of the mcs on the stage (except for the one that is added at the beginning of the function - making sure that the last one removed (navName) is the one that is firing this code Doing some tracing, I am seeing that it is failing like half way through the removal - say if I have 8 mcs on the stage at the beginning - it goes up to 9 when I add the new one then about half way through - at this line: parent.parent.removeChildAt(0); I am getting Error #2006: The supplied index is out of bounds I would think there would be a child at 0 if there were still children in existence... any thoughts? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Embedded Fonts: Works in CS4, Fails in CS5?
Try removing the underscore in your font name. In my experience, when embeding fonts, the name of the font in your code must match the font name exactly. cAse SeNsiTiVe. I believe it should be. Arial Not _Arial And if your embedding arial.ttf, it should be arial as the font name. Hth, Karl Sent from losPhone On Jun 28, 2010, at 7:03 AM, Bill S. lists...@fo.com wrote: Hi Christoffer, thank you for the answer; but adding fontFamily didn't help. [Embed(arial.ttf, fontName=_Arial, fontFamily=_Arial, mimeType='application/x-font')] John -- I tried messing with the flex swc but that didn't do it either -- although I have a feeling that it is related to this. I am digging further in. Thanks ~Bill One of the frustrating things with CS3 Flash was (contrary to many blogs -- and I believe the docs) that you could not actually [EMBED] fonts. However this worked wonderfully in CS4. But now, in (a fully updated) CS5 I can't seem to get EMBED to work again. The below code is exactly the same in a CS4 and a CS5 FLA. Literally, the same fla file was copied and updated to CS5. The font class was untouched. All it is meant to do is display This is my text, which works in CS4. The code is the same for both CS4 and CS5. Am I missing something in the code? Or a setting? import flash.text.AntiAliasType; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; import fonts._Arial; [SWF(backgroundColor=#ddffdd, frameRate=30)] var Arial:_Arial = new _Arial(); try { var _title:TextField = new TextField(); with(_title) { x = 1; y = 1; alpha = 100; background = false; defaultTextFormat = new TextFormat (font=_Arial,size=24,color=0xff,align=center); width = 500; visible = true; selectable = true; type = TextFieldType.INPUT; antiAliasType = AntiAliasType.ADVANCED; embedFonts = true; text = This is my text; trace(Embedded); // Embedded is outputted in both cases. } stage.addChild(_title); } catch(e) { trace(error in TextField setup: + e); } // the fonts._Arial class package fonts { import flash.text.Font; import flash.display.Sprite; public class _Arial extends Sprite { [Embed(arial.ttf, fontName=_Arial, mimeType='application/x- font')] public var m_font:Class; public function _Arial():void { Font.registerFont(m_font); } } } Thanks ~Bill ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] AIR tooltips (outside app container)
Forgive the noobness of this request... I haven't seen anything in Google and I thought I had seen this before. I am authoring an AIR 2 app using the Flash CS5 IDE. How can I generate OS-level tooltips from stuff in my AIR app (so they can appear at an OS-level outside the AIR container). I could use regular tooltips or make my app window larger than it would seem, but looking for OS-level hooks. E ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Anyone local to Exton, PA?
Just wondering if anyone on here is near me (Exton, PA)? thanks ~Bill ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Embedded Fonts: Works in CS4, Fails in CS5?
Hi Karl. I did try all combos of arial, Arial, _arial before asking. And the fontname in the ttf itself is Arial. Also, the exact same code works in CS4. I think it's the path stuff that John notes. I'm looking into that now. Thanks ~Bill - Original Message - From: Karl DeSaulniers To: Bill S. ; Flash Coders List Cc: flashcoders@chattyfig.figleaf.com Sent: Monday, June 28, 2010 2:24 PM Subject: Re: [Flashcoders] Embedded Fonts: Works in CS4, Fails in CS5? Try removing the underscore in your font name. In my experience, when embeding fonts, the name of the font in your code must match the font name exactly. cAse SeNsiTiVe. I believe it should be. Arial Not _Arial And if your embedding arial.ttf, it should be arial as the font name. Hth, Karl ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Anyone local to Exton, PA?
Feeling lonely? Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Bill S. Sent: Monday, June 28, 2010 3:37 PM To: Flash Coders List Subject: [Flashcoders] Anyone local to Exton, PA? Just wondering if anyone on here is near me (Exton, PA)? thanks ~Bill ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders