Re: [Flashcoders] Calling a Static Function

2010-11-15 Thread Kerry Thompson
Hi Ktu, I'm afraid I got pulled off that project on short notice--I'm doing a game for Shell with a short fuse, and had to set that aside for a couple of weeks. I'll report back as soon as I have a definitive answer. Cordially, Kerry Thompson On Mon, Nov 15, 2010 at 3:33 PM, Ktu wrote: > I'm c

Re: [Flashcoders] Calling a Static Function

2010-11-15 Thread Ktu
I'm curious if you solved the problem Kerry. Also, if the describeType helped you at all, and what your solution was. I'm doing a lot of swf loading nowadays and I will undoubtedly run into this same issue you are having/had. thanks Ktu On Wed, Nov 10, 2010 at 9:00 PM, Ktu wrote: > > http://help

Re: [Flashcoders] Calling a Static Function

2010-11-10 Thread Ktu
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/package.html#describeType%28%29 "If the value parameter is an instance of a type, the returned XML object includes all the instance properties of that type, but does not include any static properties" "The instance pro

Re: [Flashcoders] Calling a Static Function

2010-11-10 Thread Kerry Thompson
Ktu wrote: try using describeType() to find out whats in the class and if the method > has been compiled > > pEvent.target is a ContentLoaderInfo object right? You are using a Loader > object to load the swf right? > Yes, pEvent.target is a ContentLoaderInfo object. I'm downloading the swf with t

Re: [Flashcoders] Calling a Static Function

2010-11-10 Thread Ktu
try using describeType() to find out whats in the class and if the method has been compiled pEvent.target is a ContentLoaderInfo object right? You are using a Loader object to load the swf right? if so, import flash.utils.describeType; var swfContent:Object = LoaderInfo(pEvent.target).content;

Re: [Flashcoders] Calling a Static Function

2010-11-10 Thread Kerry Thompson
Keith Reinfeld wrote: > Have you tried calling the static function indirectly? > > // In the swf you are loading > public function callInitAssets():void{ >trace("\nLoadee:: callInitAssets() called"); >initAssets(); > } > > // In the swf you are loading into > private function hand

RE: [Flashcoders] Calling a Static Function

2010-11-10 Thread Keith Reinfeld
Kerry, Have you tried calling the static function indirectly? // In the swf you are loading public function callInitAssets():void{ trace("\nLoadee:: callInitAssets() called"); initAssets(); } // In the swf you are loading into private function handleLoadComplete(e:Eve

Re: [Flashcoders] Calling a Static Function

2010-11-10 Thread John McCormack
This might help: http://stackoverflow.com/questions/1270352/call-static-method-from-loaded-swf-or-how-to-expose-an-api-for-client-movies Also, I wonder if the static method is compiled into the swf, when the swf doesn't use it. Interesting. John Maybe I need to have the other developer make

Re: [Flashcoders] Calling a Static Function

2010-11-10 Thread Juan Pablo Califano
I see a couple of weird things in your code. First, I think your code, as is, should give you a compile error. At least, I get an error, with this code (which looks equivalent): var mathClass:Class = Math; //mathClass.random(); --> compile error It works if I workaround the compiler check, though

Re: [Flashcoders] Calling a Static Function

2010-11-09 Thread Kerry Thompson
Deepanjan Das wrote: Hi Kerry, > The problem is in these lines: > var AssetLibrary:Class; > > AssetLibrary=pEvent.target.applicationDomain.getDefinition("AssetLibrary") > as Class; > You are calling a stattic function; so this is correct > AssetLibrary.initAssets(); > But why are you defining the

Re: [Flashcoders] Calling a Static Function

2010-11-09 Thread Deepanjan Das
Hi Kerry, The problem is in these lines: var AssetLibrary:Class; AssetLibrary=pEvent.target.applicationDomain.getDefinition("AssetLibrary") as Class; You are calling a stattic function; so this is correct AssetLibrary.initAssets(); But why are you defining the same class variable ahead, thats wron

[Flashcoders] Calling a Static Function

2010-11-09 Thread Kerry Thompson
AS3, Flex 4. I have an asset swf I'm downloading. It has a public static function I want to call to initialize some stuff. FlashBuilder 4 is giving me an error, though, and an odd one--"Incorrect number of arguments. Expecting one." The function I'm trying to call is declared with no arguments: