Re: [Flashcoders] Apple changes their guidelines
LLVM. On Sep 9, 2010, at 9:59 AM, allandt bik-elliott (thefieldcomic.com) wrote: > how does cs5 generate files for iphone? Does it create a swf and then use a > cocoa framework to make it work or does it transcode the file directly into > objective c? > > suddenly looks very interesting again ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom cellRenderer for a List with XML data
Alexander Farber wrote: >I've traced the set data in debugger and its d argument > is really an Object, not XML. Flash seemingly will go through all the > 1st level children of dataProvider's XML and create an Object for > each of them with attributes as properties (and also with sub-children > as properties, but they will be empty strings). That's because of the way your xml is formed. Your child nodes don't contain any data--just attributes. If you had data, you could expand the tree. > public function set data(d:Object):void { > _data = d; > id = d.id; // works ok now, but d.user is a "" Yes, the way you have it, d.user has no data--just attributes. Flash is giving you accurate results. What you really want is something like this: Then you can access your attributes with syntax like this (untested, so you'll have to tweak it a bit): games.ga...@id games.gam...@id==0].user.@id games.gam...@id=="9013"].use...@id=="OK305894249541"] I probably have some of the syntax wrong--its untested, and I usually make mistakes when I write it off the top of my head. That's the general idea, though. The Flash help files have some good examples--just look under the XML class. Or, get Colin Moock's ActionScript 3 book, and read the chapter on XML. That's how I learned to use the XML parser. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Embedding Fonts, it should be easy...., right!
Jiri, What version of Flash are you using? What version of the Flex sdk? Does the swf you are loading use timeline code? Have you tried putting in some traces? var tField:TextField = _sprite.getChildByName("field") as TextField; trace("tField =", tField); I did not notice before but, based on the code you have shown, this discrepancy in arguments should cause an error: addFormatting( treatmentTimeInfo , STD_LABEL_FONT_SIZE , WHITE); function addFormatting(tField:TextField):void{ trace("addFormatting function called"); // more code } Progress? Regards, Keith Reinfeld Home Page: http://keithreinfeld.home.comcast.net ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom cellRenderer for a List with XML data
Hello Kerry and others, > Alexander Farber wrote: > http://stackoverflow.com/questions/3709172/custom-cellrenderer-for-a-list-with-xml-data thank you, I've traced the set data in debugger and its d argument is really an Object, not XML. Flash seemingly will go through all the 1st level children of dataProvider's XML and create an Object for each of them with attributes as properties (and also with sub-children as properties, but they will be empty strings). public function set data(d:Object):void { _data = d; id = d.id; // works ok now, but d.user is a "" } My new problem is however, that I need to access the sub-children "user" for each "game", but the d.user is just an empty string "" :-( I.e. I don't know how to get ahold of user id's and name's above to represent them in my customly rendered List. Any suggestions please? Regards Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Embedding Fonts, it should be easy...., right!
i've also found problems if you don't use the actual names (which can be viewed in the flash ide) for the font (which can be the same as long as the weights are different and matching the names in ) here is a sample from a font embed class that i used on a recent project note: the fontName for the regular and the bold are the same but the bold version also has a fontWeight - i used the names for the fonts found in the flash ide for each of the fontNames. Also, if these fonts are embedded in a textfield in the flash ide and included with this use, they will cancel each other out (like glen said, above) [Embed(source = "../fonts/HelveticaNeueLTStd-Roman.otf", fontName = "HelveticaNeueLT Std", mimeType = "application/x-font", unicodeRange="U+0020-U+007E, U+0080-U+00FF, U+2018-U+2019, U+201C-U+201D, U+2014, U+2122, U+2022, U+01CE, U+01CD, U+20AC")] private var _HelveticaRoman : Class; [Embed(source = "../fonts/HelveticaNeueLTStd-Bd.otf", fontName = "HelveticaNeueLT Std", fontWeight = "bold", mimeType = "application/x-font", unicodeRange="U+0020-U+007E, U+0080-U+00FF, U+2018-U+2019, U+201C-U+201D, U+2014, U+2122, U+2022, U+01CE, U+01CD, U+20AC")] private var _HelveticaBold : Class; [Embed(source = "../fonts/HelveticaNeueLTStd-LtIt.otf", fontName = "HelveticaNeueLT Std Lt", fontStyle = "italic", mimeType = "application/x-font", unicodeRange="U+0020-U+007E, U+0080-U+00FF, U+2018-U+2019, U+201C-U+201D, U+2014, U+2122, U+2022, U+01CE, U+01CD, U+20AC")] private var _HelveticaLightItalic : Class; hope this helps a On 15 September 2010 09:27, Glen Pike wrote: > Hi, > >I have had lots of problems with this in the past - be careful you are > not embedding the font in the IDE for any of your text fields, I think it > clashes. > >Where is "MyriadProFont" coming from in your App? > >Glen > > > > On 15/09/2010 08:46, Jiri wrote: > >> He Keith, >> >> thanks for pointing that out to me. I tried and it still wont show any >> text. >> >> When I enumerate the fonts, and using the code provided by Keith I get >> this output >> >> embeddedFontsArray (@367abf39) >>[0]flash.text.Font (@369a56c1) >>fontName"MyriadProFont" >>fontStyle"regular" >>fontType"embedded" >>[1]flash.text.Font (@369a5701) >>fontName"MyriadProBoldFont" >>fontStyle"bold" >>fontType"embedded" >>[2]flash.text.Font (@369a5761) >>fontName"MyriadProFont" >>fontStyle"bold" >>fontType"embedded" >>[3]flash.text.Font (@369a57a1) >>fontName"MyriadProRegularFont" >>fontStyle"regular" >>fontType"embedded" >>length4 >> >> So although regsitering two fonts to the Font class, it shows 4 Font >> instances in the embeddedFonts?? >> >> Anybody has another take? >> >> Jiri >> >> On 14-09-10 22:39, Keith Reinfeld wrote: >> >>> The fontNames for each embedded font need to be distinct from one >>> another. >>> Use Font.registerFont(Class); to make the embedded fonts available to >>> loaded swfs. >>> Use the fontName when assigning format.font; >>> >>> >>>[Embed( source='../../../../../fonts/myriad >>> pro/MyriadPro-Bold.otf', >>>fontName='MyriadProBoldFont', >>> unicodeRange='U+0010-U+00FC', fontWeight = >>> 'bold', >>>fontFamily="Myriad Pro Bold", >>>mimeType='application/x-font-truetype', >>>embedAsCFF="false" >>>)] >>> >>>public static var MyriadProBoldFont:Class; >>>// Make the font available to loaded swfs >>>Font.registerFont(MyriadProBoldFont); >>> >>>[Embed( source='../../../../../fonts/myriad >>> pro/MyriadPro-Regular.otf', >>>fontName='MyriadProRegularFont', >>> unicodeRange='U+0010-U+00FC', fontWeight >>> = 'normal', >>>fontFamily="Myriad Pro Regular", >>>mimeType='application/x-font-truetype', >>>embedAsCFF="false" >>>)] >>> >>>public static var MyriadProRegularFont:Class; >>>// Make the font available to loaded swfs >>>Font.registerFont(MyriadProRegularFont); >>> >>> >>> Then: >>> >>> >>> var tField:TextField = _sprite.getChildByName("field") as TextField; >>> addFormatting( treatmentTimeInfo , STD_LABEL_FONT_SIZE , WHITE); >>> >>> function addFormatting(tField:TextField):void{ >>> >>>var format:TextFormat = new TextFormat() >>>format.font = "MyriadProBoldFont"; >>>format.bold = true; >>> >>>tField.defaultTextFormat = format; >>>tField.embedFonts = true; >>>tField.setTextFormat( format ); >>> >>>tField.text = "some_text" >>>} >>> >>> >>> HTH >>> >>> Regards, >>> >>> Keith Reinfeld >>> Home Page: http://keithreinfeld.home.comcast.net >>> >>> >>> >>> >>> ___ >>> Flashco
Re: [Flashcoders] Embedding Fonts, it should be easy...., right!
Hi, I have had lots of problems with this in the past - be careful you are not embedding the font in the IDE for any of your text fields, I think it clashes. Where is "MyriadProFont" coming from in your App? Glen On 15/09/2010 08:46, Jiri wrote: He Keith, thanks for pointing that out to me. I tried and it still wont show any text. When I enumerate the fonts, and using the code provided by Keith I get this output embeddedFontsArray (@367abf39) [0]flash.text.Font (@369a56c1) fontName"MyriadProFont" fontStyle"regular" fontType"embedded" [1]flash.text.Font (@369a5701) fontName"MyriadProBoldFont" fontStyle"bold" fontType"embedded" [2]flash.text.Font (@369a5761) fontName"MyriadProFont" fontStyle"bold" fontType"embedded" [3]flash.text.Font (@369a57a1) fontName"MyriadProRegularFont" fontStyle"regular" fontType"embedded" length4 So although regsitering two fonts to the Font class, it shows 4 Font instances in the embeddedFonts?? Anybody has another take? Jiri On 14-09-10 22:39, Keith Reinfeld wrote: The fontNames for each embedded font need to be distinct from one another. Use Font.registerFont(Class); to make the embedded fonts available to loaded swfs. Use the fontName when assigning format.font; [Embed( source='../../../../../fonts/myriad pro/MyriadPro-Bold.otf', fontName='MyriadProBoldFont', unicodeRange='U+0010-U+00FC', fontWeight = 'bold', fontFamily="Myriad Pro Bold", mimeType='application/x-font-truetype', embedAsCFF="false" )] public static var MyriadProBoldFont:Class; // Make the font available to loaded swfs Font.registerFont(MyriadProBoldFont); [Embed( source='../../../../../fonts/myriad pro/MyriadPro-Regular.otf', fontName='MyriadProRegularFont', unicodeRange='U+0010-U+00FC', fontWeight = 'normal', fontFamily="Myriad Pro Regular", mimeType='application/x-font-truetype', embedAsCFF="false" )] public static var MyriadProRegularFont:Class; // Make the font available to loaded swfs Font.registerFont(MyriadProRegularFont); Then: var tField:TextField = _sprite.getChildByName("field") as TextField; addFormatting( treatmentTimeInfo , STD_LABEL_FONT_SIZE , WHITE); function addFormatting(tField:TextField):void{ var format:TextFormat = new TextFormat() format.font = "MyriadProBoldFont"; format.bold = true; tField.defaultTextFormat = format; tField.embedFonts = true; tField.setTextFormat( format ); tField.text = "some_text" } HTH Regards, Keith Reinfeld Home Page: http://keithreinfeld.home.comcast.net ___ 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 mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Embedding Fonts, it should be easy...., right!
He Keith, thanks for pointing that out to me. I tried and it still wont show any text. When I enumerate the fonts, and using the code provided by Keith I get this output embeddedFonts Array (@367abf39) [0] flash.text.Font (@369a56c1) fontName"MyriadProFont" fontStyle "regular" fontType"embedded" [1] flash.text.Font (@369a5701) fontName"MyriadProBoldFont" fontStyle "bold" fontType"embedded" [2] flash.text.Font (@369a5761) fontName"MyriadProFont" fontStyle "bold" fontType"embedded" [3] flash.text.Font (@369a57a1) fontName"MyriadProRegularFont" fontStyle "regular" fontType"embedded" length 4 So although regsitering two fonts to the Font class, it shows 4 Font instances in the embeddedFonts?? Anybody has another take? Jiri On 14-09-10 22:39, Keith Reinfeld wrote: The fontNames for each embedded font need to be distinct from one another. Use Font.registerFont(Class); to make the embedded fonts available to loaded swfs. Use the fontName when assigning format.font; [Embed( source='../../../../../fonts/myriad pro/MyriadPro-Bold.otf', fontName='MyriadProBoldFont', unicodeRange='U+0010-U+00FC', fontWeight = 'bold', fontFamily="Myriad Pro Bold", mimeType='application/x-font-truetype', embedAsCFF="false" )] public static var MyriadProBoldFont:Class; // Make the font available to loaded swfs Font.registerFont(MyriadProBoldFont); [Embed( source='../../../../../fonts/myriad pro/MyriadPro-Regular.otf', fontName='MyriadProRegularFont', unicodeRange='U+0010-U+00FC', fontWeight = 'normal', fontFamily="Myriad Pro Regular", mimeType='application/x-font-truetype', embedAsCFF="false" )] public static var MyriadProRegularFont:Class; // Make the font available to loaded swfs Font.registerFont(MyriadProRegularFont); Then: var tField:TextField = _sprite.getChildByName("field") as TextField; addFormatting( treatmentTimeInfo , STD_LABEL_FONT_SIZE , WHITE); function addFormatting(tField:TextField):void{ var format:TextFormat = new TextFormat() format.font = "MyriadProBoldFont"; format.bold = true; tField.defaultTextFormat = format; tField.embedFonts = true; tField.setTextFormat( format ); tField.text = "some_text" } HTH Regards, Keith Reinfeld Home Page: http://keithreinfeld.home.comcast.net ___ 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