RE: [flexcoders] Re: addEventListener and additional arguments?

2007-02-15 Thread Francis Cheng
Another reason the anonymous function technique is not recommended for event handlers is that the 'this' keyword in an anonymous function refers to the global object whereas if you use a method, the 'this' keyword refers to that method's associated object. Francis _

RE: [flexcoders] Re: Object.addEventListener vs.. adding them inline via MXML

2007-02-09 Thread Francis Cheng
It is documented, in two places: 1) ActionScript Language Reference: http://www.adobe.com/livedocs/flex/201/langref/flash/events/EventDispatc her.html In the method detail for flash.events.EventDispatcher.addEventListener() see the description of the priority parameter: "If two or more l

RE: [flexcoders] Functions as objects

2006-12-08 Thread Francis Cheng
You should be able to add properties to function objects, just as the docs suggest. Unfortunately, it looks like this isn't working in strict mode anymore. Oddly, it does work in standard mode, but that may not be a viable workaround for you. I had a brief discussion about this with the engineers t

RE: [flexcoders] bug in Array.splice?

2006-09-26 Thread Francis Cheng
Hi Jason,   This is a mistake in the documentation. Thanks for pointing it out. I’ll file a documentation bug to ensure that it gets fixed.   Thanks,   Francis Cheng | Senior Technical Writer | Adobe Systems, Inc.   From: flexcoders@yahoogroups.com [mailto:flexcoders

RE: [flexcoders] Re: Help on Illegal assignment to function

2006-06-08 Thread Francis Cheng
It’s probably because there is a difference between fixed properties and properties added at runtime. Fixed properties are variables, methods, or constants that you define as part of a class definition. These are fixed in the sense that you cannot remove them or replace them at runtime. T

RE: [flexcoders] selectedIndices are Strings???

2006-06-08 Thread Francis Cheng
Don’t forget that the Array.sort() method sorts using string values by default, so even when sorting an array of numbers or ints, they will be sorted as if they were strings. To get numeric sorting, so that “10” comes after “2”, use the Array.NUMERIC sort option, e.g.:   myArray.sort(Ar

RE: [flexcoders] is "delete" really the best/only way to remove a node in e4x?

2006-05-25 Thread Francis Cheng
Title: is "delete" really the best/only way to remove a node in e4x? The E4X standard allows the addition of APIs in certain circumstances, but not this one. The standard explicitly prohibits the addition of methods to the XML or XMLList prototype objects, which are where the other method

RE: [flexcoders] Array filter method

2006-05-16 Thread Francis Cheng
Hi Sergio, Perhaps I'm misunderstanding your question, but I can't reproduce issue #1. The following call to the filter method returns a multidimensional array: import flash.display.Sprite; var arr:Array = [[-1,-2,-3],[3,5,4], "foo"]; function isArray(elem:*, index:int, arr:Array):Boolean {

RE: [flexcoders] Re: delete class instances

2006-05-16 Thread Francis Cheng
In ActionScript 3.0, the delete operator only works on properties of objects, not on instances of a class. Setting the ‘ping’ variable to null is the way to go. As long as the variable ‘ping’ is the only reference to the PingTime instance you created in your init() function, you can make

RE: [flexcoders] How can I sort a hash in Actionscript?

2006-05-08 Thread Francis Cheng
ActionScript 3.0 does have a hash class, named Dictionary, which you can find in the flash.utils package. You can rewrite your "o" Object as a Dictionary, but ActionScript 3.0 doesn't have the equivalent of the 'sort' keyword in Perl where you can do something like: // Perl code foreach $key (s

RE: [flexcoders] Re: Singleton not usable?

2006-04-17 Thread Francis Cheng
t; { > CursorManager.removeBusyCursor(); > this.dispatchEvent(fault); > } > public override function toString():String > { > return "DataServices"; > } > } > } > > /** PrivateClass i

RE: [flexcoders] Re: Singleton not usable?

2006-04-14 Thread Francis Cheng
That works in C# because the default access specifier for class members in C# is private. It won't work in ActionScript 3.0 because the constructor is always public, whether or not you declare it as such. Francis > -Original Message- > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTE

RE: [flexcoders] About Flash Player 8.5

2006-03-30 Thread Francis Cheng
Flash Player 8.5 is still in beta, and we'd greatly appreciate any feedback about problems you are having with it. If you have a minute, there is a brief web form you can use to report these kinds of errors: http://www.macromedia.com/go/fp_public_beta_feedback Thanks, Francis > -Original Me

RE: [flexcoders] Re: FB2 :: Error subclass :: What is 'native' attribute FB2 inserts

2006-03-10 Thread Francis Cheng
It’s a doc bug that it’s missing from the “Statements, Keywords and Directives” page. I’ll add it soon.   Francis   From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Schmalle Sent: Friday, March 10, 2006 11:36 AM To: flexcoders@yahoogroups.com S