Re: [Flashcoders] Flash oddness with URLvariables
On 26/03/2010 03:35, Helmut Granda wrote: I personally haven't seen this behavior and it is hard to debug something that we can't see. My principle concern was whether there was some known quirk with the Mac/G5/CS4 that may have been known about. Looks like that is not the case. As for debugging the system, the debugger works just fine, LOL. I would suspect timing issues when the debugger is involved, but this is a very simple system. I will look over it again with fresh eyes today. Paul -h On Mar 25, 2010, at 6:24 PM, Paul Andrews wrote: I'm usually a Flash CS3 user on a PC, but have been using a Mac G5 and CS4 recently. Today I came across some really weird behaviour. I'm pulling some XML from a server and passing some variables (URLVariables). Nothing special, except that today I found that one of my variable values was not being passed to the PHP. No matter what, it didn't appear to the PHP code. OK, off I go with the debugger. Now the PHP sees all of the values passed. Just running the debugger always gives the right behaviour. Sometimes, it'll work without the debugger. Anyone seen this kind of behaviour - the code is not that complex (sadly I can't post it). ___ 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] Flash oddness with URLvariables
On 26/03/2010 05:52, Karl DeSaulniers wrote: Sounds like a cache issue. The debugger is going to probably pull a fresh file every time while whatever your previewing in caches. I am a mac user and I have the same issue with Safari. It holds on to the cache file like there is no tomorrow. I sometimes have to quit safari to fix this problem. Or rename the file. Not sure exactly what you are running into, but that is what it sounds like to me. Thanks, something to consider, though I think I'm adding a cache-buster to the end of the url. Best, Karl On Mar 25, 2010, at 6:24 PM, Paul Andrews wrote: I'm usually a Flash CS3 user on a PC, but have been using a Mac G5 and CS4 recently. Today I came across some really weird behaviour. I'm pulling some XML from a server and passing some variables (URLVariables). Nothing special, except that today I found that one of my variable values was not being passed to the PHP. No matter what, it didn't appear to the PHP code. OK, off I go with the debugger. Now the PHP sees all of the values passed. Just running the debugger always gives the right behaviour. Sometimes, it'll work without the debugger. Anyone seen this kind of behaviour - the code is not that complex (sadly I can't post it). ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ 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] Counting xml attributes
Hi Theodore, Something like (code not tested): var counter:uint = 0; for each (node in myXml..*) { if(no...@myatt == givenValue) { counter++; } } trace(counter); HTH Willem van den Goorbergh On 23-mrt-2010, at 14:20, Lehr, Theodore wrote: Is there a way to loop through xml and count how many times an attribute has a given value? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Geografiek is a Dutch, Utrecht-based map and chart design company. Willem van den Goorbergh can be contacted by telephone: (+31) 30-2719512 or cell phone: (+31)6-26372378 or by fax: (+31)302719687 snail mail: Hooghiemstraplein 89 3514 AX UTRECHT Visit our website at: http://www.geografiek.nl =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Events can be tedious, general thoughts on best practice?
Signals gets a big plus from me. Takes a lot of the donkey-work out of setting up custom events. On 24 Mar 2010, at 22:21, Taka Kojima wrote: You bring up some valid points, however some of them are irrelevant for this example, i.e. multiple listeners. I could be a minority, but I don't think I am when I say that I have never used multiple listeners for when I load in an XML file. Secondly, if I were to implement events for this XMLLoader class, I would most likely write a custom event class, which is even more work and I don't feel like it is necessary. The reason I say I'd write a custom event class is, let's say I wanted to implement caching into my XMLLoader class, I can't use the Event.COMPLETE event anymore as the second time I make the request it won't even call a URLLoader, as it's reading from an array/dictionary/vector stored in the class to grab the content. I totally agree with you on the familiarity/consistency point, it makes working with others a lot easier. The other option is as3-signals, which I'm looking into and looks rather promising. On Wed, Mar 24, 2010 at 1:02 PM, Mark Winterhalder mar...@gmail.com wrote: On Wed, Mar 24, 2010 at 7:03 PM, Taka Kojima t...@gigafied.com wrote: I'm curious as to other people's thoughts on this in terms of good/bad practice and what the pros/cons to this approach might be. My thoughts are that it's OK for the very common cases which don't need the flexibility of events. Advantages of events: * multiple listeners * one listener for multiple targets/types * progress events etc. * you'll have events all over your project anyway, period. * it's what other coders are familiar with The last one's important if other devs /might/ have to work with your code. For this it will only take me a minute to look up that strange loader class I don't know, but if you use too many of those it adds up, and at some point I won't want to play with you no more. Personally, I'll stick with events, and I don't mind them at all. ___ 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] Events can be tedious, general thoughts on best practice?
in my mvc setup, i use a set of public static constants for event types on the model object and dispatch(new Event(ModelObject.CUSTOM_EVENT_TYPE)); when the listening object receives it, it goes and retrieves the data from a public variable / accessor on the model. There are plenty of reasons to use custom events but they're not necessary for every event situation even without using the Signals object a On 26 March 2010 09:54, Mark Burvill m...@antifuzz.com wrote: Signals gets a big plus from me. Takes a lot of the donkey-work out of setting up custom events. On 24 Mar 2010, at 22:21, Taka Kojima wrote: You bring up some valid points, however some of them are irrelevant for this example, i.e. multiple listeners. I could be a minority, but I don't think I am when I say that I have never used multiple listeners for when I load in an XML file. Secondly, if I were to implement events for this XMLLoader class, I would most likely write a custom event class, which is even more work and I don't feel like it is necessary. The reason I say I'd write a custom event class is, let's say I wanted to implement caching into my XMLLoader class, I can't use the Event.COMPLETE event anymore as the second time I make the request it won't even call a URLLoader, as it's reading from an array/dictionary/vector stored in the class to grab the content. I totally agree with you on the familiarity/consistency point, it makes working with others a lot easier. The other option is as3-signals, which I'm looking into and looks rather promising. On Wed, Mar 24, 2010 at 1:02 PM, Mark Winterhalder mar...@gmail.com wrote: On Wed, Mar 24, 2010 at 7:03 PM, Taka Kojima t...@gigafied.com wrote: I'm curious as to other people's thoughts on this in terms of good/bad practice and what the pros/cons to this approach might be. My thoughts are that it's OK for the very common cases which don't need the flexibility of events. Advantages of events: * multiple listeners * one listener for multiple targets/types * progress events etc. * you'll have events all over your project anyway, period. * it's what other coders are familiar with The last one's important if other devs /might/ have to work with your code. For this it will only take me a minute to look up that strange loader class I don't know, but if you use too many of those it adds up, and at some point I won't want to play with you no more. Personally, I'll stick with events, and I don't mind them at all. ___ 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Events can be tedious, general thoughts on best practice?
Could you describe a little working example how to do this? Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of allandt bik-elliott (thefieldcomic.com) Sent: vrijdag 26 maart 2010 11:07 To: Flash Coders List Subject: Re: [Flashcoders] Events can be tedious, general thoughts on best practice? in my mvc setup, i use a set of public static constants for event types on the model object and dispatch(new Event(ModelObject.CUSTOM_EVENT_TYPE)); when the listening object receives it, it goes and retrieves the data from a public variable / accessor on the model. There are plenty of reasons to use custom events but they're not necessary for every event situation even without using the Signals object a On 26 March 2010 09:54, Mark Burvill m...@antifuzz.com wrote: Signals gets a big plus from me. Takes a lot of the donkey-work out of setting up custom events. On 24 Mar 2010, at 22:21, Taka Kojima wrote: You bring up some valid points, however some of them are irrelevant for this example, i.e. multiple listeners. I could be a minority, but I don't think I am when I say that I have never used multiple listeners for when I load in an XML file. Secondly, if I were to implement events for this XMLLoader class, I would most likely write a custom event class, which is even more work and I don't feel like it is necessary. The reason I say I'd write a custom event class is, let's say I wanted to implement caching into my XMLLoader class, I can't use the Event.COMPLETE event anymore as the second time I make the request it won't even call a URLLoader, as it's reading from an array/dictionary/vector stored in the class to grab the content. I totally agree with you on the familiarity/consistency point, it makes working with others a lot easier. The other option is as3-signals, which I'm looking into and looks rather promising. On Wed, Mar 24, 2010 at 1:02 PM, Mark Winterhalder mar...@gmail.com wrote: On Wed, Mar 24, 2010 at 7:03 PM, Taka Kojima t...@gigafied.com wrote: I'm curious as to other people's thoughts on this in terms of good/bad practice and what the pros/cons to this approach might be. My thoughts are that it's OK for the very common cases which don't need the flexibility of events. Advantages of events: * multiple listeners * one listener for multiple targets/types * progress events etc. * you'll have events all over your project anyway, period. * it's what other coders are familiar with The last one's important if other devs /might/ have to work with your code. For this it will only take me a minute to look up that strange loader class I don't know, but if you use too many of those it adds up, and at some point I won't want to play with you no more. Personally, I'll stick with events, and I don't mind them at all. ___ 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.791 / Virusdatabase: 271.1.1/2770 - datum van uitgifte: 03/25/10 21:50:00 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] possible to create faux bold using meta [Embed] statement?
hey guys does anyone know if there is a way of using faux fontstyle (italic for me) using a font that has been [Embed]'ed. my DynamicFonts class uses the setup suggested by colin moock - i've tried embedding the font with fontStyle = italic but as that isn't part of the font, it errors out. am i going to have to add a custom property into the css and then do some sprite skewing to get what i need or is there a way of adding a faux italic into the copy (like there is in the IDE)? hope you can help thanks a class fyi - this is compiled with the flex compiler and then loaded in to the main class with a Loader object and as soon as it INITs, it adds all of it's fonts to the available fontlist so it avoids all of the getDefinition craziness: package { import flash.display.Sprite; import flash.text.Font; public class DynamicFonts extends Sprite { [Embed(source = ../fonts/HelveticaNeueLTStd-Roman.otf, fontName = HelveticaNeueLT Std, mimeType = application/x-font, unicodeRange=U+0020-U+002F, U+0030-U+0039, U+003A-U+0040, U+0041-U+005A, U+005B-U+0060, U+0061-U+007A, U+007B-U+007E)] private var _HelveticaRoman : Class; public function DynamicFonts() { Font.registerFont(_HelveticaRoman); var ar:Array = Font.enumerateFonts(); for (var i:int = 0; i ar.length; i++) trace(font: + ar[i]); } } } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Events can be tedious, general thoughts on best practice?
example model package { import flash.events.EventDispatcher; public class SiteModel extends EventDispatcher { public static const PAGE_CHANGE : String = pageChange; public static const LOAD_UPDATE : String = loadUpdate; public var sPageName : String; public var nLoadPercent : Number; public function SiteModel() {} public function sendPageChange():void { dispatchEvent(new Event(SiteModel.PAGE_CHANGE)); } public function sendLoadUpdate():void { dispatchEvent(new Event(SiteModel.LOAD_UPDATE)); } } } set the data in one class: private function changePage():void { model.sPageName = newPageName; model.sendPageChange(); } or to update load percentages: Loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, handleProgress); private function handleProgress(e: ProgressEvent):void { model.nLoadPercent = Math.round(e.bytesLoaded / e.bytesTotal * 100); model. sendLoadUpdate(); } to get the data from another class: model.addEventListener(SiteModel.PAGE_CHANGE, handlePageChange); model.addEventListener(SiteModel. LOAD_UPDATE, handleLoadUpdate); public function handlePageChange(e:Event):void { var newPageName:String = model.sPageName; } public function handleLoadUpdate(e:Event):void { var loadedPercent:String = model. nLoadPercent; } On 26 March 2010 10:19, Cor c...@chello.nl wrote: Could you describe a little working example how to do this? Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of allandt bik-elliott (thefieldcomic.com) Sent: vrijdag 26 maart 2010 11:07 To: Flash Coders List Subject: Re: [Flashcoders] Events can be tedious, general thoughts on best practice? in my mvc setup, i use a set of public static constants for event types on the model object and dispatch(new Event(ModelObject.CUSTOM_EVENT_TYPE)); when the listening object receives it, it goes and retrieves the data from a public variable / accessor on the model. There are plenty of reasons to use custom events but they're not necessary for every event situation even without using the Signals object a On 26 March 2010 09:54, Mark Burvill m...@antifuzz.com wrote: Signals gets a big plus from me. Takes a lot of the donkey-work out of setting up custom events. On 24 Mar 2010, at 22:21, Taka Kojima wrote: You bring up some valid points, however some of them are irrelevant for this example, i.e. multiple listeners. I could be a minority, but I don't think I am when I say that I have never used multiple listeners for when I load in an XML file. Secondly, if I were to implement events for this XMLLoader class, I would most likely write a custom event class, which is even more work and I don't feel like it is necessary. The reason I say I'd write a custom event class is, let's say I wanted to implement caching into my XMLLoader class, I can't use the Event.COMPLETE event anymore as the second time I make the request it won't even call a URLLoader, as it's reading from an array/dictionary/vector stored in the class to grab the content. I totally agree with you on the familiarity/consistency point, it makes working with others a lot easier. The other option is as3-signals, which I'm looking into and looks rather promising. On Wed, Mar 24, 2010 at 1:02 PM, Mark Winterhalder mar...@gmail.com wrote: On Wed, Mar 24, 2010 at 7:03 PM, Taka Kojima t...@gigafied.com wrote: I'm curious as to other people's thoughts on this in terms of good/bad practice and what the pros/cons to this approach might be. My thoughts are that it's OK for the very common cases which don't need the flexibility of events. Advantages of events: * multiple listeners * one listener for multiple targets/types * progress events etc. * you'll have events all over your project anyway, period. * it's what other coders are familiar with The last one's important if other devs /might/ have to work with your code. For this it will only take me a minute to look up that strange loader class I don't know, but if you use too many of those it adds up, and at some point I won't want to play with you no more. Personally, I'll stick with events, and I don't mind them at all. ___ 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
Re: [Flashcoders] possible to create faux bold using meta [Embed] statement?
Hi, You probably have to embed the italic font file - I don't have Helvetica, but in my windows font's folder there is an italic version of my Arial font called ARIALI.TTF Glen allandt bik-elliott (thefieldcomic.com) wrote: hey guys does anyone know if there is a way of using faux fontstyle (italic for me) using a font that has been [Embed]'ed. my DynamicFonts class uses the setup suggested by colin moock - i've tried embedding the font with fontStyle = italic but as that isn't part of the font, it errors out. am i going to have to add a custom property into the css and then do some sprite skewing to get what i need or is there a way of adding a faux italic into the copy (like there is in the IDE)? hope you can help thanks a class fyi - this is compiled with the flex compiler and then loaded in to the main class with a Loader object and as soon as it INITs, it adds all of it's fonts to the available fontlist so it avoids all of the getDefinition craziness: package { import flash.display.Sprite; import flash.text.Font; public class DynamicFonts extends Sprite { [Embed(source = ../fonts/HelveticaNeueLTStd-Roman.otf, fontName = HelveticaNeueLT Std, mimeType = application/x-font, unicodeRange=U+0020-U+002F, U+0030-U+0039, U+003A-U+0040, U+0041-U+005A, U+005B-U+0060, U+0061-U+007A, U+007B-U+007E)] private var _HelveticaRoman : Class; public function DynamicFonts() { Font.registerFont(_HelveticaRoman); var ar:Array = Font.enumerateFonts(); for (var i:int = 0; i ar.length; i++) trace(font: + ar[i]); } } } ___ 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] possible to create faux bold using meta [Embed] statement?
hey glen i'm not using helvetica, it's actually a custom cut of bryant with no italic variant. I just didn't know if there was a way i could make it faux italic (like the designer has in photoshop - sigh) with css / actionscript a On 26 March 2010 12:42, Glen Pike g...@engineeredarts.co.uk wrote: Hi, You probably have to embed the italic font file - I don't have Helvetica, but in my windows font's folder there is an italic version of my Arial font called ARIALI.TTF Glen allandt bik-elliott (thefieldcomic.com) wrote: hey guys does anyone know if there is a way of using faux fontstyle (italic for me) using a font that has been [Embed]'ed. my DynamicFonts class uses the setup suggested by colin moock - i've tried embedding the font with fontStyle = italic but as that isn't part of the font, it errors out. am i going to have to add a custom property into the css and then do some sprite skewing to get what i need or is there a way of adding a faux italic into the copy (like there is in the IDE)? hope you can help thanks a class fyi - this is compiled with the flex compiler and then loaded in to the main class with a Loader object and as soon as it INITs, it adds all of it's fonts to the available fontlist so it avoids all of the getDefinition craziness: package { import flash.display.Sprite; import flash.text.Font; public class DynamicFonts extends Sprite { [Embed(source = ../fonts/HelveticaNeueLTStd-Roman.otf, fontName = HelveticaNeueLT Std, mimeType = application/x-font, unicodeRange=U+0020-U+002F, U+0030-U+0039, U+003A-U+0040, U+0041-U+005A, U+005B-U+0060, U+0061-U+007A, U+007B-U+007E)] private var _HelveticaRoman : Class; public function DynamicFonts() { Font.registerFont(_HelveticaRoman); var ar:Array = Font.enumerateFonts(); for (var i:int = 0; i ar.length; i++) trace(font: + ar[i]); } } } ___ 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] possible to create faux bold using meta [Embed] statement?
Typical designers giving you fonts that won't work outside of photoshop, grr, had that problem in the past and got told off for telling an esteemed designer that their font sucked ;) allandt bik-elliott (thefieldcomic.com) wrote: hey glen i'm not using helvetica, it's actually a custom cut of bryant with no italic variant. I just didn't know if there was a way i could make it faux italic (like the designer has in photoshop - sigh) with css / actionscript a On 26 March 2010 12:42, Glen Pike g...@engineeredarts.co.uk wrote: Hi, You probably have to embed the italic font file - I don't have Helvetica, but in my windows font's folder there is an italic version of my Arial font called ARIALI.TTF Glen allandt bik-elliott (thefieldcomic.com) wrote: hey guys does anyone know if there is a way of using faux fontstyle (italic for me) using a font that has been [Embed]'ed. my DynamicFonts class uses the setup suggested by colin moock - i've tried embedding the font with fontStyle = italic but as that isn't part of the font, it errors out. am i going to have to add a custom property into the css and then do some sprite skewing to get what i need or is there a way of adding a faux italic into the copy (like there is in the IDE)? hope you can help thanks a class fyi - this is compiled with the flex compiler and then loaded in to the main class with a Loader object and as soon as it INITs, it adds all of it's fonts to the available fontlist so it avoids all of the getDefinition craziness: package { import flash.display.Sprite; import flash.text.Font; public class DynamicFonts extends Sprite { [Embed(source = ../fonts/HelveticaNeueLTStd-Roman.otf, fontName = HelveticaNeueLT Std, mimeType = application/x-font, unicodeRange=U+0020-U+002F, U+0030-U+0039, U+003A-U+0040, U+0041-U+005A, U+005B-U+0060, U+0061-U+007A, U+007B-U+007E)] private var _HelveticaRoman : Class; public function DynamicFonts() { Font.registerFont(_HelveticaRoman); var ar:Array = Font.enumerateFonts(); for (var i:int = 0; i ar.length; i++) trace(font: + ar[i]); } } } ___ 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Events can be tedious, general thoughts on best practice?
Thank you!! I will start playing with this. Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of allandt bik-elliott (thefieldcomic.com) Sent: vrijdag 26 maart 2010 13:30 To: Flash Coders List Subject: Re: [Flashcoders] Events can be tedious, general thoughts on best practice? example model package { import flash.events.EventDispatcher; public class SiteModel extends EventDispatcher { public static const PAGE_CHANGE : String = pageChange; public static const LOAD_UPDATE : String = loadUpdate; public var sPageName : String; public var nLoadPercent : Number; public function SiteModel() {} public function sendPageChange():void { dispatchEvent(new Event(SiteModel.PAGE_CHANGE)); } public function sendLoadUpdate():void { dispatchEvent(new Event(SiteModel.LOAD_UPDATE)); } } } set the data in one class: private function changePage():void { model.sPageName = newPageName; model.sendPageChange(); } or to update load percentages: Loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, handleProgress); private function handleProgress(e: ProgressEvent):void { model.nLoadPercent = Math.round(e.bytesLoaded / e.bytesTotal * 100); model. sendLoadUpdate(); } to get the data from another class: model.addEventListener(SiteModel.PAGE_CHANGE, handlePageChange); model.addEventListener(SiteModel. LOAD_UPDATE, handleLoadUpdate); public function handlePageChange(e:Event):void { var newPageName:String = model.sPageName; } public function handleLoadUpdate(e:Event):void { var loadedPercent:String = model. nLoadPercent; } On 26 March 2010 10:19, Cor c...@chello.nl wrote: Could you describe a little working example how to do this? Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of allandt bik-elliott (thefieldcomic.com) Sent: vrijdag 26 maart 2010 11:07 To: Flash Coders List Subject: Re: [Flashcoders] Events can be tedious, general thoughts on best practice? in my mvc setup, i use a set of public static constants for event types on the model object and dispatch(new Event(ModelObject.CUSTOM_EVENT_TYPE)); when the listening object receives it, it goes and retrieves the data from a public variable / accessor on the model. There are plenty of reasons to use custom events but they're not necessary for every event situation even without using the Signals object a On 26 March 2010 09:54, Mark Burvill m...@antifuzz.com wrote: Signals gets a big plus from me. Takes a lot of the donkey-work out of setting up custom events. On 24 Mar 2010, at 22:21, Taka Kojima wrote: You bring up some valid points, however some of them are irrelevant for this example, i.e. multiple listeners. I could be a minority, but I don't think I am when I say that I have never used multiple listeners for when I load in an XML file. Secondly, if I were to implement events for this XMLLoader class, I would most likely write a custom event class, which is even more work and I don't feel like it is necessary. The reason I say I'd write a custom event class is, let's say I wanted to implement caching into my XMLLoader class, I can't use the Event.COMPLETE event anymore as the second time I make the request it won't even call a URLLoader, as it's reading from an array/dictionary/vector stored in the class to grab the content. I totally agree with you on the familiarity/consistency point, it makes working with others a lot easier. The other option is as3-signals, which I'm looking into and looks rather promising. On Wed, Mar 24, 2010 at 1:02 PM, Mark Winterhalder mar...@gmail.com wrote: On Wed, Mar 24, 2010 at 7:03 PM, Taka Kojima t...@gigafied.com wrote: I'm curious as to other people's thoughts on this in terms of good/bad practice and what the pros/cons to this approach might be. My thoughts are that it's OK for the very common cases which don't need the flexibility of events. Advantages of events: * multiple listeners * one listener for multiple targets/types * progress events etc. * you'll have events all over your project anyway, period. * it's what other coders are familiar with The last one's important if other devs /might/ have to work with your code. For this it will only take me a minute to look up that strange loader class I don't know, but if you use too many of those it adds up, and at some point I won't want to play with you no more. Personally, I'll stick with events, and I don't mind them at all. ___ Flashcoders mailing list
Re: [Flashcoders] possible to create faux bold using meta [Embed] statement?
lol - we've made an accord and switched to the body copy font (helvetica) which does have an italic font thanks for the input and the chuckles a On 26 March 2010 12:51, Glen Pike g...@engineeredarts.co.uk wrote: Typical designers giving you fonts that won't work outside of photoshop, grr, had that problem in the past and got told off for telling an esteemed designer that their font sucked ;) allandt bik-elliott (thefieldcomic.com) wrote: hey glen i'm not using helvetica, it's actually a custom cut of bryant with no italic variant. I just didn't know if there was a way i could make it faux italic (like the designer has in photoshop - sigh) with css / actionscript a On 26 March 2010 12:42, Glen Pike g...@engineeredarts.co.uk wrote: Hi, You probably have to embed the italic font file - I don't have Helvetica, but in my windows font's folder there is an italic version of my Arial font called ARIALI.TTF Glen allandt bik-elliott (thefieldcomic.com) wrote: hey guys does anyone know if there is a way of using faux fontstyle (italic for me) using a font that has been [Embed]'ed. my DynamicFonts class uses the setup suggested by colin moock - i've tried embedding the font with fontStyle = italic but as that isn't part of the font, it errors out. am i going to have to add a custom property into the css and then do some sprite skewing to get what i need or is there a way of adding a faux italic into the copy (like there is in the IDE)? hope you can help thanks a class fyi - this is compiled with the flex compiler and then loaded in to the main class with a Loader object and as soon as it INITs, it adds all of it's fonts to the available fontlist so it avoids all of the getDefinition craziness: package { import flash.display.Sprite; import flash.text.Font; public class DynamicFonts extends Sprite { [Embed(source = ../fonts/HelveticaNeueLTStd-Roman.otf, fontName = HelveticaNeueLT Std, mimeType = application/x-font, unicodeRange=U+0020-U+002F, U+0030-U+0039, U+003A-U+0040, U+0041-U+005A, U+005B-U+0060, U+0061-U+007A, U+007B-U+007E)] private var _HelveticaRoman : Class; public function DynamicFonts() { Font.registerFont(_HelveticaRoman); var ar:Array = Font.enumerateFonts(); for (var i:int = 0; i ar.length; i++) trace(font: + ar[i]); } } } ___ 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 ___ 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] Events can be tedious, general thoughts on best practice?
have fun On 26 March 2010 13:39, Cor c...@chello.nl wrote: Thank you!! I will start playing with this. Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of allandt bik-elliott (thefieldcomic.com) Sent: vrijdag 26 maart 2010 13:30 To: Flash Coders List Subject: Re: [Flashcoders] Events can be tedious, general thoughts on best practice? example model package { import flash.events.EventDispatcher; public class SiteModel extends EventDispatcher { public static const PAGE_CHANGE : String = pageChange; public static const LOAD_UPDATE : String = loadUpdate; public var sPageName : String; public var nLoadPercent : Number; public function SiteModel() {} public function sendPageChange():void { dispatchEvent(new Event(SiteModel.PAGE_CHANGE)); } public function sendLoadUpdate():void { dispatchEvent(new Event(SiteModel.LOAD_UPDATE)); } } } set the data in one class: private function changePage():void { model.sPageName = newPageName; model.sendPageChange(); } or to update load percentages: Loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, handleProgress); private function handleProgress(e: ProgressEvent):void { model.nLoadPercent = Math.round(e.bytesLoaded / e.bytesTotal * 100); model. sendLoadUpdate(); } to get the data from another class: model.addEventListener(SiteModel.PAGE_CHANGE, handlePageChange); model.addEventListener(SiteModel. LOAD_UPDATE, handleLoadUpdate); public function handlePageChange(e:Event):void { var newPageName:String = model.sPageName; } public function handleLoadUpdate(e:Event):void { var loadedPercent:String = model. nLoadPercent; } On 26 March 2010 10:19, Cor c...@chello.nl wrote: Could you describe a little working example how to do this? Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of allandt bik-elliott (thefieldcomic.com) Sent: vrijdag 26 maart 2010 11:07 To: Flash Coders List Subject: Re: [Flashcoders] Events can be tedious, general thoughts on best practice? in my mvc setup, i use a set of public static constants for event types on the model object and dispatch(new Event(ModelObject.CUSTOM_EVENT_TYPE)); when the listening object receives it, it goes and retrieves the data from a public variable / accessor on the model. There are plenty of reasons to use custom events but they're not necessary for every event situation even without using the Signals object a On 26 March 2010 09:54, Mark Burvill m...@antifuzz.com wrote: Signals gets a big plus from me. Takes a lot of the donkey-work out of setting up custom events. On 24 Mar 2010, at 22:21, Taka Kojima wrote: You bring up some valid points, however some of them are irrelevant for this example, i.e. multiple listeners. I could be a minority, but I don't think I am when I say that I have never used multiple listeners for when I load in an XML file. Secondly, if I were to implement events for this XMLLoader class, I would most likely write a custom event class, which is even more work and I don't feel like it is necessary. The reason I say I'd write a custom event class is, let's say I wanted to implement caching into my XMLLoader class, I can't use the Event.COMPLETE event anymore as the second time I make the request it won't even call a URLLoader, as it's reading from an array/dictionary/vector stored in the class to grab the content. I totally agree with you on the familiarity/consistency point, it makes working with others a lot easier. The other option is as3-signals, which I'm looking into and looks rather promising. On Wed, Mar 24, 2010 at 1:02 PM, Mark Winterhalder mar...@gmail.com wrote: On Wed, Mar 24, 2010 at 7:03 PM, Taka Kojima t...@gigafied.com wrote: I'm curious as to other people's thoughts on this in terms of good/bad practice and what the pros/cons to this approach might be. My thoughts are that it's OK for the very common cases which don't need the flexibility of events. Advantages of events: * multiple listeners * one listener for multiple targets/types * progress events etc. * you'll have events all over your project anyway, period. * it's what other coders are familiar with The last one's important if other devs /might/ have to work with your code. For this it will only take me a minute to look up that strange loader class I don't know, but if you use too many of those it adds up, and at some point I
Re: [Flashcoders] Flash oddness with URLvariables
Paul Andrews wrote: I'm usually a Flash CS3 user on a PC, but have been using a Mac G5 and CS4 recently. Today I came across some really weird behaviour. I'm pulling some XML from a server and passing some variables (URLVariables). Nothing special, except that today I found that one of my variable values was not being passed to the PHP. No matter what, it didn't appear to the PHP code. OK, off I go with the debugger. Now the PHP sees all of the values passed. Just running the debugger always gives the right behaviour. Sometimes, it'll work without the debugger. Anyone seen this kind of behaviour - the code is not that complex (sadly I can't post it). Intermittent behavior depending on if the debugger is attached or not? Sounds like a possible timing issue to me. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Events can be tedious, general thoughts on best practice?
I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file with this in it: package events { import flash.events.Event; /** * ... * @author Jason Merrill */ public class NewEvent extends Event { public function NewEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new NewEvent(type, bubbles, cancelable); } public override function toString():String { return formatToString(NewEvent, type, bubbles, cancelable, eventPhase); } } } Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Events can be tedious, general thoughts on best practice?
Thanks Jason, I am still investigating/trying to learn the MVC pattern and I noticed the same handling as far as the model aspect. So if you can elaborate on that too, it is highly appreciated. Kind regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 16:10 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file with this in it: package events { import flash.events.Event; /** * ... * @author Jason Merrill */ public class NewEvent extends Event { public function NewEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new NewEvent(type, bubbles, cancelable); } public override function toString():String { return formatToString(NewEvent, type, bubbles, cancelable, eventPhase); } } } Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.791 / Virusdatabase: 271.1.1/2770 - datum van uitgifte: 03/25/10 21:50:00 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Events can be tedious, general thoughts on best practice?
flashdevelops templates are an awesome way to speed up coding, especially as you can update them (i add headings for constants, properties, constructor, methods, handlers and accessors / mutators into mine so that i can easily find everything within a class a On 26 March 2010 15:40, Cor c...@chello.nl wrote: Thanks Jason, I am still investigating/trying to learn the MVC pattern and I noticed the same handling as far as the model aspect. So if you can elaborate on that too, it is highly appreciated. Kind regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 16:10 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file with this in it: package events { import flash.events.Event; /** * ... * @author Jason Merrill */ public class NewEvent extends Event { public function NewEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new NewEvent(type, bubbles, cancelable); } public override function toString():String { return formatToString(NewEvent, type, bubbles, cancelable, eventPhase); } } } Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.791 / Virusdatabase: 271.1.1/2770 - datum van uitgifte: 03/25/10 21:50:00 ___ 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] Events can be tedious, general thoughts on best practice?
In basic MVC, the controller listens to both the model and view for events. Since Flash doesn't have data binding like Flex has, the model might dispatch an event when a value changes, and the controller would then tell the view how to change and might send a value to it. Also, the view might dispatch an event that the controller would be listening for, and the controller might then tell another view or the model (or both) to change. So the controller controls the view and the model, but the controller does not get controlled. In more advanced patterns and frameworks, you have things like commands (like in Cairngorm), façades, proxies etc. to also facilitate these communications. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 11:41 AM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I am still investigating/trying to learn the MVC pattern and I noticed the same handling as far as the model aspect. So if you can elaborate on that too, it is highly appreciated. Kind regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 16:10 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file with this in it: package events { import flash.events.Event; /** * ... * @author Jason Merrill */ public class NewEvent extends Event { public function NewEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new NewEvent(type, bubbles, cancelable); } public override function toString():String { return formatToString(NewEvent, type, bubbles, cancelable, eventPhase); } } } Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.791 / Virusdatabase: 271.1.1/2770 - datum van uitgifte: 03/25/10 21:50:00 ___ 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] Events can be tedious, general thoughts on best practice?
Thanks Jason, I understand the theory, but have a problem creating a MVC myself. I don't want to use other frameworks, I want to learn to OOP in Flash and how to create an MVC from scratch. I am really looking for some simple, but completely working examples. Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 17:04 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? In basic MVC, the controller listens to both the model and view for events. Since Flash doesn't have data binding like Flex has, the model might dispatch an event when a value changes, and the controller would then tell the view how to change and might send a value to it. Also, the view might dispatch an event that the controller would be listening for, and the controller might then tell another view or the model (or both) to change. So the controller controls the view and the model, but the controller does not get controlled. In more advanced patterns and frameworks, you have things like commands (like in Cairngorm), façades, proxies etc. to also facilitate these communications. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 11:41 AM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I am still investigating/trying to learn the MVC pattern and I noticed the same handling as far as the model aspect. So if you can elaborate on that too, it is highly appreciated. Kind regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 16:10 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file with this in it: package events { import flash.events.Event; /** * ... * @author Jason Merrill */ public class NewEvent extends Event { public function NewEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new NewEvent(type, bubbles, cancelable); } public override function toString():String { return formatToString(NewEvent, type, bubbles, cancelable, eventPhase); } } } Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.791 / Virusdatabase: 271.1.1/2770 - datum van uitgifte: 03/25/10 21:50:00 ___ 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 Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.791 / Virusdatabase: 271.1.1/2770 - datum van uitgifte: 03/25/10 21:50:00 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Counting xml attributes
Actually, another option, you already have that information with E4X syntax, so this could nerdily be handled in a single line. So for example, if you wanted to see how many nodes had an firstName attribute with the value of Hank ( mynode firstName=Hank /) then you can do this: xml..*.(attribute(firstName)==Hank).length(); Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Geografiek Sent: Friday, March 26, 2010 5:09 AM To: Flash Coders List Subject: Re: [Flashcoders] Counting xml attributes Hi Theodore, Something like (code not tested): var counter:uint = 0; for each (node in myXml..*) { if(no...@myatt == givenValue) { counter++; } } trace(counter); HTH Willem van den Goorbergh On 23-mrt-2010, at 14:20, Lehr, Theodore wrote: Is there a way to loop through xml and count how many times an attribute has a given value? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Geografiek is a Dutch, Utrecht-based map and chart design company. Willem van den Goorbergh can be contacted by telephone: (+31) 30-2719512 or cell phone: (+31)6-26372378 or by fax: (+31)302719687 snail mail: Hooghiemstraplein 89 3514 AX UTRECHT Visit our website at: http://www.geografiek.nl =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= ___ 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] Events can be tedious, general thoughts on best practice?
www.lynda.com/home/DisplayCourse.aspx?lpk2=759 Chapter 4 Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com -Original Message- From: Cor c...@chello.nl Date: Fri, 26 Mar 2010 17:10:34 To: 'Flash Coders List'flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? Thanks Jason, I understand the theory, but have a problem creating a MVC myself. I don't want to use other frameworks, I want to learn to OOP in Flash and how to create an MVC from scratch. I am really looking for some simple, but completely working examples. Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 17:04 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? In basic MVC, the controller listens to both the model and view for events. Since Flash doesn't have data binding like Flex has, the model might dispatch an event when a value changes, and the controller would then tell the view how to change and might send a value to it. Also, the view might dispatch an event that the controller would be listening for, and the controller might then tell another view or the model (or both) to change. So the controller controls the view and the model, but the controller does not get controlled. In more advanced patterns and frameworks, you have things like commands (like in Cairngorm), façades, proxies etc. to also facilitate these communications. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 11:41 AM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I am still investigating/trying to learn the MVC pattern and I noticed the same handling as far as the model aspect. So if you can elaborate on that too, it is highly appreciated. Kind regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 16:10 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file with this in it: package events { import flash.events.Event; /** * ... * @author Jason Merrill */ public class NewEvent extends Event { public function NewEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new NewEvent(type, bubbles, cancelable); } public override function toString():String { return formatToString(NewEvent, type, bubbles, cancelable, eventPhase); } } } Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.791 / Virusdatabase: 271.1.1/2770 - datum van uitgifte: 03/25/10 21:50:00 ___ 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 Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.791 / Virusdatabase:
RE: [Flashcoders] Events can be tedious, general thoughts on best practice?
Hi Cor, I'm sending you a very basic MVC template I wrote offlist. You can start building off that if you like. I can't send you any actual projects I am working on obviously. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 12:11 PM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I understand the theory, but have a problem creating a MVC myself. I don't want to use other frameworks, I want to learn to OOP in Flash and how to create an MVC from scratch. I am really looking for some simple, but completely working examples. Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 17:04 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? In basic MVC, the controller listens to both the model and view for events. Since Flash doesn't have data binding like Flex has, the model might dispatch an event when a value changes, and the controller would then tell the view how to change and might send a value to it. Also, the view might dispatch an event that the controller would be listening for, and the controller might then tell another view or the model (or both) to change. So the controller controls the view and the model, but the controller does not get controlled. In more advanced patterns and frameworks, you have things like commands (like in Cairngorm), façades, proxies etc. to also facilitate these communications. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 11:41 AM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I am still investigating/trying to learn the MVC pattern and I noticed the same handling as far as the model aspect. So if you can elaborate on that too, it is highly appreciated. Kind regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 16:10 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file with this in it: package events { import flash.events.Event; /** * ... * @author Jason Merrill */ public class NewEvent extends Event { public function NewEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new NewEvent(type, bubbles, cancelable); } public override function toString():String { return formatToString(NewEvent, type, bubbles, cancelable, eventPhase); } } } Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.791 / Virusdatabase: 271.1.1/2770 - datum van uitgifte: 03/25/10 21:50:00 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com
RE: [Flashcoders] Events can be tedious, general thoughts on best practice?
WOW, thanks Jason. You're the best! This will keep me of the street for some time. :-) Thanks again, I appreciate this very much!!! Grateful regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 17:20 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? Hi Cor, I'm sending you a very basic MVC template I wrote offlist. You can start building off that if you like. I can't send you any actual projects I am working on obviously. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 12:11 PM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I understand the theory, but have a problem creating a MVC myself. I don't want to use other frameworks, I want to learn to OOP in Flash and how to create an MVC from scratch. I am really looking for some simple, but completely working examples. Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 17:04 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? In basic MVC, the controller listens to both the model and view for events. Since Flash doesn't have data binding like Flex has, the model might dispatch an event when a value changes, and the controller would then tell the view how to change and might send a value to it. Also, the view might dispatch an event that the controller would be listening for, and the controller might then tell another view or the model (or both) to change. So the controller controls the view and the model, but the controller does not get controlled. In more advanced patterns and frameworks, you have things like commands (like in Cairngorm), façades, proxies etc. to also facilitate these communications. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 11:41 AM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I am still investigating/trying to learn the MVC pattern and I noticed the same handling as far as the model aspect. So if you can elaborate on that too, it is highly appreciated. Kind regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 16:10 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file with this in it: package events { import flash.events.Event; /** * ... * @author Jason Merrill */ public class NewEvent extends Event { public function NewEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new NewEvent(type, bubbles, cancelable); } public override function toString():String { return formatToString(NewEvent, type, bubbles, cancelable, eventPhase); } } } Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only)
RE: [Flashcoders] Events can be tedious, general thoughts on best practice?
Sure - I didn't have time to fill it in with any examples, so it doesn't do anything yet, but if I have time I could do that. So ask me off list if you have questions on using it. Felt bad I said I would send you something a while back and never had time to get around to it. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 12:26 PM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? WOW, thanks Jason. You're the best! This will keep me of the street for some time. :-) Thanks again, I appreciate this very much!!! Grateful regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 17:20 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? Hi Cor, I'm sending you a very basic MVC template I wrote offlist. You can start building off that if you like. I can't send you any actual projects I am working on obviously. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 12:11 PM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I understand the theory, but have a problem creating a MVC myself. I don't want to use other frameworks, I want to learn to OOP in Flash and how to create an MVC from scratch. I am really looking for some simple, but completely working examples. Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 17:04 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? In basic MVC, the controller listens to both the model and view for events. Since Flash doesn't have data binding like Flex has, the model might dispatch an event when a value changes, and the controller would then tell the view how to change and might send a value to it. Also, the view might dispatch an event that the controller would be listening for, and the controller might then tell another view or the model (or both) to change. So the controller controls the view and the model, but the controller does not get controlled. In more advanced patterns and frameworks, you have things like commands (like in Cairngorm), façades, proxies etc. to also facilitate these communications. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 11:41 AM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I am still investigating/trying to learn the MVC pattern and I noticed the same handling as far as the model aspect. So if you can elaborate on that too, it is highly appreciated. Kind regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 16:10 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file with this in it: package events { import flash.events.Event; /** * ... * @author Jason Merrill */ public class NewEvent extends Event { public function NewEvent(type:String, bubbles:Boolean=false,
Re: [Flashcoders] Events can be tedious, general thoughts on best practice?
jason's been doing it for a lot longer than me but mine is basically the following: var model:Model = new Model(); var controller1:Controller = new Controller(model); var controller2:Controller = new Controller(model); var view1:View = new View(model, controller1); var view2:View = new View(model, controller1); var view3:View = new View(model, controller2); var view4:View = new View(model, controller2); every class will save the references passed into them as class properties. The views delegate their actions to their controllers which update the model which fires events to update the views. Common view types should use common controllers to avoid duplicating functionality code from one controller to the next. The more traditional mvc will use singleton models and controllers and the controllers will keep a list of registered views and update them (so the view will call some kind of register() method on the controller) or the views will simply listen to the controller to update themselves On 26 March 2010 16:25, Cor c...@chello.nl wrote: WOW, thanks Jason. You're the best! This will keep me of the street for some time. :-) Thanks again, I appreciate this very much!!! Grateful regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 17:20 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? Hi Cor, I'm sending you a very basic MVC template I wrote offlist. You can start building off that if you like. I can't send you any actual projects I am working on obviously. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 12:11 PM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I understand the theory, but have a problem creating a MVC myself. I don't want to use other frameworks, I want to learn to OOP in Flash and how to create an MVC from scratch. I am really looking for some simple, but completely working examples. Regards Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 17:04 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? In basic MVC, the controller listens to both the model and view for events. Since Flash doesn't have data binding like Flex has, the model might dispatch an event when a value changes, and the controller would then tell the view how to change and might send a value to it. Also, the view might dispatch an event that the controller would be listening for, and the controller might then tell another view or the model (or both) to change. So the controller controls the view and the model, but the controller does not get controlled. In more advanced patterns and frameworks, you have things like commands (like in Cairngorm), façades, proxies etc. to also facilitate these communications. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Friday, March 26, 2010 11:41 AM To: 'Flash Coders List' Subject: RE: [Flashcoders] Events can be tedious,general thoughts on best practice? Thanks Jason, I am still investigating/trying to learn the MVC pattern and I noticed the same handling as far as the model aspect. So if you can elaborate on that too, it is highly appreciated. Kind regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: vrijdag 26 maart 2010 16:10 To: Flash Coders List Subject: RE: [Flashcoders] Events can be tedious, general thoughts on best practice? I missed the beginning of this thread somehow, but FWIW, FlashDevelop has an Add New Event menu option in the project pane when you right click on a package folder which makes creating custom events a snap. All you really have to do is enter the static event constants you want the event to have and you're done. When you select this option, it auto-generates a file
RE: [Flashcoders] Counting xml attributes
And also, here's a full example of what I mean- with E4X syntax, you can take advantage of XMLLists within your XML: var xml:XML = xml node node firstName=WALDO lastName=Williams/ node firstName=Bill lastName=Smith/ node firstName=Susan lastName=Jones/ /node node firstName=WALDO lastName=Peterson node node firstName=Larry lastName=Anderson/ node firstName=Mary lastName=Williams/ node firstName=Mary lastName=WALDO/ node firstName=WALDO lastName=Williams/ /node /node node node node firstName=Larry lastName=WALDO/ node firstName=WALDO lastName=WALDO/ node firstName=Larry lastName=WALDO/ node firstName=WALDO lastName=Perkins/ node firstName=Jenny lastName=WALDO node firstName=Hank lastName=Smith / node firstName=WALDO lastName=Smith / /node /node /node /xml trace(How many firstName WALDOs? +xml..*.(attribute(firstName)==WALDO).length()); trace(How many lastName WALDOs? +xml..*.(attribute(lastName)==WALDO).length()); trace() trace(Here are all the nodes (with their subnodes) that have WALDO as the value for firstName or lastName: \r\r+xml..*.(attribute(firstName)==WALDO || attribute(lastName)==WALDO)); //traces: How many firstName WALDOs? 6 How many lastName WALDOs? 5 Here are all the nodes (with their subnodes) that have WALDO as the value for firstName or lastName: node firstName=WALDO lastName=Williams/ node firstName=WALDO lastName=Peterson node node firstName=Larry lastName=Anderson/ node firstName=Mary lastName=Williams/ node firstName=Mary lastName=WALDO/ node firstName=WALDO lastName=Williams/ /node /node node firstName=Mary lastName=WALDO/ node firstName=WALDO lastName=Williams/ node firstName=Larry lastName=WALDO/ node firstName=WALDO lastName=WALDO/ node firstName=Larry lastName=WALDO/ node firstName=WALDO lastName=Perkins/ node firstName=Jenny lastName=WALDO node firstName=Hank lastName=Smith/ node firstName=WALDO lastName=Smith/ /node node firstName=WALDO lastName=Smith/ Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: Friday, March 26, 2010 12:14 PM To: Flash Coders List Subject: RE: [Flashcoders] Counting xml attributes Actually, another option, you already have that information with E4X syntax, so this could nerdily be handled in a single line. So for example, if you wanted to see how many nodes had an firstName attribute with the value of Hank ( mynode firstName=Hank /) then you can do this: xml..*.(attribute(firstName)==Hank).length(); Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Geografiek Sent: Friday, March 26, 2010 5:09 AM To: Flash Coders List Subject: Re: [Flashcoders] Counting xml attributes Hi Theodore, Something like (code not tested): var counter:uint = 0; for each (node in myXml..*) { if(no...@myatt == givenValue) { counter++; } } trace(counter); HTH Willem van den Goorbergh On 23-mrt-2010, at 14:20, Lehr, Theodore wrote: Is there a way to loop through xml and count how many times an attribute has a given value? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Geografiek is a Dutch, Utrecht-based map and chart design company. Willem van den Goorbergh can be contacted by telephone: (+31) 30-2719512 or cell phone: (+31)6-26372378 or by fax: (+31)302719687 snail mail: Hooghiemstraplein 89 3514 AX UTRECHT Visit our website at: http://www.geografiek.nl =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com
Re: [Flashcoders] Flash oddness with URLvariables
On 26/03/2010 15:01, Henrik Andersson wrote: Paul Andrews wrote: I'm usually a Flash CS3 user on a PC, but have been using a Mac G5 and CS4 recently. Today I came across some really weird behaviour. I'm pulling some XML from a server and passing some variables (URLVariables). Nothing special, except that today I found that one of my variable values was not being passed to the PHP. No matter what, it didn't appear to the PHP code. OK, off I go with the debugger. Now the PHP sees all of the values passed. Just running the debugger always gives the right behaviour. Sometimes, it'll work without the debugger. Anyone seen this kind of behaviour - the code is not that complex (sadly I can't post it). Intermittent behavior depending on if the debugger is attached or not? Sounds like a possible timing issue to me. I would agree, but it turns out that I'd not explicitly told flash to post or get the variables, so it seemed to do a half-hearted job of it. Not entirely sure why using the debugger improved the situation, but there you are. Running perfectly now. Thanks to everyone for the suggestions. Paul ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] NoCache XML
Hey everyone, I am loading in an external xml doc via loadXML(url of xml); To prevent browsers from caching the xml, I add at the end of the url string a Date object like: loadXML(url of xml+?nocache=+new Date().getTime()); This sometimes works and other times doesn't. The xml is the backbone to the colors used in the UI of my site which goes black when the load doesn't work properly. I have tried to add an IOERROREvent function to catch the error and then supply the url to the load function without the Date object appended. Is there any checks or different directions I can take to prevent visitors from sometimes having to refresh until the xml gets loaded correctly? Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] NoCache XML
It should always work. Perhaps the url of the xml has a ? already in it? public function nocache(url:String):String { var d:Date = new Date(); var nc:String = nocache= + d.getTime(); if (url.indexOf(?) -1) return url + + nc; return url + ? + nc; } On 3/26/2010 2:27 PM, Nathan Mynarcik wrote: Hey everyone, I am loading in an external xml doc via loadXML(url of xml); To prevent browsers from caching the xml, I add at the end of the url string a Date object like: loadXML(url of xml+?nocache=+new Date().getTime()); This sometimes works and other times doesn't. The xml is the backbone to the colors used in the UI of my site which goes black when the load doesn't work properly. I have tried to add an IOERROREvent function to catch the error and then supply the url to the load function without the Date object appended. Is there any checks or different directions I can take to prevent visitors from sometimes having to refresh until the xml gets loaded correctly? Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ 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] NoCache XML
That's similar to what I am doing. I know for a fact that the url doesn't already have a ? in it. I have no clue why on some visits, the colors and other xml data is not pulled. Then on a refresh it pulls them. --Original Message-- From: Steven Sacks To: Nathan Mynarcik To: Flash Coders List Subject: Re: [Flashcoders] NoCache XML Sent: Mar 26, 2010 5:27 PM It should always work. Perhaps the url of the xml has a ? already in it? public function nocache(url:String):String { var d:Date = new Date(); var nc:String = nocache= + d.getTime(); if (url.indexOf(?) -1) return url + + nc; return url + ? + nc; } On 3/26/2010 2:27 PM, Nathan Mynarcik wrote: Hey everyone, I am loading in an external xml doc via loadXML(url of xml); To prevent browsers from caching the xml, I add at the end of the url string a Date object like: loadXML(url of xml+?nocache=+new Date().getTime()); This sometimes works and other times doesn't. The xml is the backbone to the colors used in the UI of my site which goes black when the load doesn't work properly. I have tried to add an IOERROREvent function to catch the error and then supply the url to the load function without the Date object appended. Is there any checks or different directions I can take to prevent visitors from sometimes having to refresh until the xml gets loaded correctly? Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash oddness with URLvariables
Oh, I see. Well just remember, if your just adding the date to the end of the url, if its the same day, it will cache that file. I usually include the time, because every second it changes. GL, Karl On Mar 26, 2010, at 3:21 AM, Paul Andrews wrote: On 26/03/2010 05:52, Karl DeSaulniers wrote: Sounds like a cache issue. The debugger is going to probably pull a fresh file every time while whatever your previewing in caches. I am a mac user and I have the same issue with Safari. It holds on to the cache file like there is no tomorrow. I sometimes have to quit safari to fix this problem. Or rename the file. Not sure exactly what you are running into, but that is what it sounds like to me. Thanks, something to consider, though I think I'm adding a cache- buster to the end of the url. Best, Karl On Mar 25, 2010, at 6:24 PM, Paul Andrews wrote: I'm usually a Flash CS3 user on a PC, but have been using a Mac G5 and CS4 recently. Today I came across some really weird behaviour. I'm pulling some XML from a server and passing some variables (URLVariables). Nothing special, except that today I found that one of my variable values was not being passed to the PHP. No matter what, it didn't appear to the PHP code. OK, off I go with the debugger. Now the PHP sees all of the values passed. Just running the debugger always gives the right behaviour. Sometimes, it'll work without the debugger. Anyone seen this kind of behaviour - the code is not that complex (sadly I can't post it). ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ 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 Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] NoCache XML
Safari doesn't honor nocache. Safari is a jerk. Are you using Safari? On 3/26/2010 3:35 PM, Nathan Mynarcik wrote: That's similar to what I am doing. I know for a fact that the url doesn't already have a ? in it. I have no clue why on some visits, the colors and other xml data is not pulled. Then on a refresh it pulls them. --Original Message-- From: Steven Sacks To: Nathan Mynarcik To: Flash Coders List Subject: Re: [Flashcoders] NoCache XML Sent: Mar 26, 2010 5:27 PM It should always work. Perhaps the url of the xml has a ? already in it? public function nocache(url:String):String { var d:Date = new Date(); var nc:String = nocache= + d.getTime(); if (url.indexOf(?) -1) return url + + nc; return url + ? + nc; } On 3/26/2010 2:27 PM, Nathan Mynarcik wrote: Hey everyone, I am loading in an external xml doc via loadXML(url of xml); To prevent browsers from caching the xml, I add at the end of the url string a Date object like: loadXML(url of xml+?nocache=+new Date().getTime()); This sometimes works and other times doesn't. The xml is the backbone to the colors used in the UI of my site which goes black when the load doesn't work properly. I have tried to add an IOERROREvent function to catch the error and then supply the url to the load function without the Date object appended. Is there any checks or different directions I can take to prevent visitors from sometimes having to refresh until the xml gets loaded correctly? Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ 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] NoCache XML
I've tested it in all browsers. IE, Safari, Opera, Chrome, FireFox Anything else I don't really care about. But first tests are in chrome and it is doing it in that. IE has been the worse but all work after refreshing one or two times. --Original Message-- From: Steven Sacks To: Nathan Mynarcik To: Flash Coders List Subject: Re: [Flashcoders] NoCache XML Sent: Mar 26, 2010 8:36 PM Safari doesn't honor nocache. Safari is a jerk. Are you using Safari? On 3/26/2010 3:35 PM, Nathan Mynarcik wrote: That's similar to what I am doing. I know for a fact that the url doesn't already have a ? in it. I have no clue why on some visits, the colors and other xml data is not pulled. Then on a refresh it pulls them. --Original Message-- From: Steven Sacks To: Nathan Mynarcik To: Flash Coders List Subject: Re: [Flashcoders] NoCache XML Sent: Mar 26, 2010 5:27 PM It should always work. Perhaps the url of the xml has a ? already in it? public function nocache(url:String):String { var d:Date = new Date(); var nc:String = nocache= + d.getTime(); if (url.indexOf(?) -1) return url + + nc; return url + ? + nc; } On 3/26/2010 2:27 PM, Nathan Mynarcik wrote: Hey everyone, I am loading in an external xml doc via loadXML(url of xml); To prevent browsers from caching the xml, I add at the end of the url string a Date object like: loadXML(url of xml+?nocache=+new Date().getTime()); This sometimes works and other times doesn't. The xml is the backbone to the colors used in the UI of my site which goes black when the load doesn't work properly. I have tried to add an IOERROREvent function to catch the error and then supply the url to the load function without the Date object appended. Is there any checks or different directions I can take to prevent visitors from sometimes having to refresh until the xml gets loaded correctly? Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders