Re: [Flashcoders] calling public static methods on Class using getDefinitionByName
On a related note, I noticed this syntax in Flash help this morning: var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass["getStyleDefinition"].call(this); On Tue, Jun 24, 2008 at 8:27 PM, Patrick Matte | BLITZ < [EMAIL PROTECTED]> wrote: > Ah ok, the reason it wasn't working was that I was casting ClassReference > as Class instead of Object... Now this works. > > var ClassReference:Object = getDefinitionByName("Test") as Object; > var bool:Boolean = ClassReference.parse("false"); //would return false; > > > BLITZ | Patrick Matte - 310-551-0200 x214 > > -Original Message- > From: [EMAIL PROTECTED] [mailto: > [EMAIL PROTECTED] On Behalf Of Wagner Amaral > Sent: Tuesday, June 24, 2008 7:18 AM > To: Flash Coders List > Subject: Re: [Flashcoders] calling public static methods on Class using > getDefinitionByName > > On Tue, Jun 24, 2008 at 6:14 AM, Kenneth Kawamoto < > [EMAIL PROTECTED]> > wrote: > > > trace(getDefinitionByName("Test").parse("false")); > > > > > Nice > Then maybe this works too (no compiler available right now, so just > guessing): > > var c:Class = getDefinitionByName("Test") as Class; > (c as Object).parse("false"); > ___ > 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 > -- -jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] calling public static methods on Class using getDefinitionByName
Ah ok, the reason it wasn't working was that I was casting ClassReference as Class instead of Object... Now this works. var ClassReference:Object = getDefinitionByName("Test") as Object; var bool:Boolean = ClassReference.parse("false"); //would return false; BLITZ | Patrick Matte - 310-551-0200 x214 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wagner Amaral Sent: Tuesday, June 24, 2008 7:18 AM To: Flash Coders List Subject: Re: [Flashcoders] calling public static methods on Class using getDefinitionByName On Tue, Jun 24, 2008 at 6:14 AM, Kenneth Kawamoto <[EMAIL PROTECTED]> wrote: > trace(getDefinitionByName("Test").parse("false")); > Nice Then maybe this works too (no compiler available right now, so just guessing): var c:Class = getDefinitionByName("Test") as Class; (c as Object).parse("false"); ___ 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] calling public static methods on Class using getDefinitionByName
On Tue, Jun 24, 2008 at 6:14 AM, Kenneth Kawamoto <[EMAIL PROTECTED]> wrote: > trace(getDefinitionByName("Test").parse("false")); > Nice Then maybe this works too (no compiler available right now, so just guessing): var c:Class = getDefinitionByName("Test") as Class; (c as Object).parse("false"); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] calling public static methods on Class using getDefinitionByName
trace(getDefinitionByName("Test").parse("false")); Output false Kenneth Kawamoto http://www.materiaprima.co.uk/ Patrick Matte | BLITZ wrote: Does anybody know if it's possible to call a static method of a reference to a class created with getDefinitionByName without actually creating an instance of the object? Something like this simple example: var ClassReference:Class = getDefinitionByName("Test") as Class; var bool:Boolean = ClassReference.parse("false"); //would return false; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] calling public static methods on Class using getDefinitionByName
On Mon, Jun 23, 2008 at 11:45 PM, Patrick Matte | BLITZ < [EMAIL PROTECTED]> wrote: > Ok I've found a way to do it, but it's not really clean. Would there be any > way to make the code better? > > Oh, right, you already found that out... That slow mail server from mine... ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] calling public static methods on Class using getDefinitionByName
Never really tried that, but an interesting question! Here's all I got so far: var c:Class = getDefinitionByName("MyClass") as Class; // or: var c:Class = MyClass; trace( c["parse"]("false") ); I'll keep trying, maybe I can find a cleaner way On Mon, Jun 23, 2008 at 11:16 PM, Patrick Matte | BLITZ < [EMAIL PROTECTED]> wrote: > Does anybody know if it's possible to call a static method of a reference > to a class created with getDefinitionByName without actually creating an > instance of the object? > > > Something like this simple example: > > var ClassReference:Class = getDefinitionByName("Test") as Class; > > var bool:Boolean = ClassReference.parse("false"); //would return false; > > ___ > 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] calling public static methods on Class using getDefinitionByName
Ok I've found a way to do it, but it's not really clean. Would there be any way to make the code better? So writing this : var ClassReference:Class = getDefinitionByName("Test") as Class; var bool:Boolean = ClassReference["parse"]("false"); // returns false is the same as this : var bool:Boolean = Test.parse("false"); // returns false BLITZ | Patrick Matte - 310-551-0200 x214 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Matte|BLITZ Sent: Monday, June 23, 2008 7:17 PM To: Flash Coders List Subject: [Flashcoders] calling public static methods on Class using getDefinitionByName Does anybody know if it's possible to call a static method of a reference to a class created with getDefinitionByName without actually creating an instance of the object? Something like this simple example: var ClassReference:Class = getDefinitionByName("Test") as Class; var bool:Boolean = ClassReference.parse("false"); //would return false; ___ 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