Using a Flash 8 movieclip loaded in Flash 9 to use Kongregate APIs in AS3

Subscribe to Using a Flash 8 movieclip loaded in Flash 9 to use Kongregate APIs in AS3 18 posts

avatar for funfree123 funfree123 6 posts
Flag Post

Just a theory. You could use LocalConnection or something to talk to the Flash 8 SWF which implements the Kongregate API code, load the SWF into your Flash 9 game and effectively be able to use the APIs.

Has anybody thought about or even attempted this?

 
avatar for dazzer dazzer 724 posts
Flag Post

Alot of unecessary overhead though, but seems possible! Might try it ^^

 
avatar for funfree123 funfree123 6 posts
Flag Post

It’s not really unnecessary – because it’s the only way you can use the API from AS3 until Kongregate release a new version.

Overhead shouldn’t really be a problem, either – the Flash 8 SWF would be tiny, and would only be called when the game isn’t particularly busy (end of game menus seems to be the usual place).

 
avatar for yrudoy yrudoy 340 posts
Flag Post

I though you code in swf you imported wasn’t executed…

 
avatar for funfree123 funfree123 6 posts
Flag Post

I’m pretty sure that you can, using something like this: http://www.flashextensions.com/products/flashinterface.php

 
avatar for undersiege undersiege 122 posts
Flag Post

If you load a swf in to a container (movieclip or level) at runtime then the code inside it will run.

 
avatar for Moonkey Moonkey 1007 posts
Flag Post

Its a really good idea. I’m surprised no one has suggested it before.

I’m tempted to try it, but it might just be a waste of time depending on how far off the as3 support is.

 
avatar for arcaneCoder arcaneCoder 2354 posts
Flag Post

It wouldn’t work because I believe the API wont even load if your game is AS3. It must be an AS2 file, which then gets loaded into the APIs shell. The API then activates and is available to your swf.

Additionally, it would indeed be a waste of your time as the AS3 support is already pretty far along.

 
avatar for 5TonsOfFlax 5TonsOfFlax 3 posts
Flag Post

How far along? I’ve got a game I’m itching to publish somewhere. Kongregate would be my first choice if the API supported as3.

 
avatar for arcaneCoder arcaneCoder 2354 posts
Flag Post

Very close. I’m testing some changes right now and I will be putting together the game interface very soon. I’m hoping that you should be able to use it within the next couple of weeks.

 
avatar for dazzer dazzer 724 posts
Flag Post

Arcane: I think he means wrapping your AS3 file inside another AS2 file and using local connection to communicate with your wrapper. So technically the SWF is AS2. Technically.

In any case, that would probably be how Kongregate is planning to support AS3 with its AS2 api…

 
avatar for arcaneCoder arcaneCoder 2354 posts
Flag Post

Arcane: I think he means wrapping your AS3 file inside another AS2 file and using local connection to communicate with your wrapper. So technically the SWF is AS2. Technically.


He specifically said load your Flash 8 swf into your Flash 9 game, which is a sensible theory. However, even if it was the other way around, it wouldn’t work because you cannot load an AS3 game into an AS2 swf and expect it to function as it should.

In any case, that would probably be how Kongregate is planning to support AS3 with its AS2 api…


No, the AS3 API for the client is all AS3 and does not load or use any AS2 in any of the game portion (read my second post and you’ll pick up that I’m the one building it ;) )

 
avatar for dazzer dazzer 724 posts
Flag Post

Ah ^^ my bad.

I know who to whip now then – whips! – hurry up!

 
avatar for funfree123 funfree123 6 posts
Flag Post

arcaneCoder, I’m not sure what you’re talking about.

I’m suggesting that the AS3 game calls the Kongregate API through an AS2 proxy SWF. There is no “other way around”.

 
avatar for IndieFlashArcade IndieFlashAr... 433 posts
Flag Post

The “other way around” in this case would be loading an AS3 .swf into an AS2 (Flash 8) .swf, which is friggin’ impossible. It’s kind of tough to explain to you n00bs why exactly this can’t be done, but suffice to say, if arcaneCoder says it’s not possible, it’s not possible.

(With all due respect, of course)

 
avatar for dazzer dazzer 724 posts
Flag Post

I definately see how either wouldn’t work, and agree 100% with arcaneCoder.

 
avatar for arcaneCoder arcaneCoder 2354 posts
Flag Post

arcaneCoder, I’m not sure what you’re talking about. I’m suggesting that the AS3 game calls the Kongregate API through an AS2 proxy SWF. There is no “other way around”.


Yes, I see that; it is indeed what I am talking about and Indie is right regarding what the ‘other way around’ would be. As I said, your idea is sensible in theory, but due to the way the framework is setup it wouldn’t work. There is no game framework running when you upload an AS3 game, as the AS2 framework cannot load in an AS3 swf, so the proxy swf would be making API calls without anything listening.

Best to wait for the official framework.

 
avatar for funfree123 funfree123 6 posts
Flag Post

Right. Do you mean that the Kongregate loader puts a bunch of stuff in the root of an AS2 SWF for it to work? If so, I can see why my suggestion wouldn’t work.

I guess it’s a side effect of that sort of development practice. Hopefully something that will be phased out entirely as AS3 becomes more popular.