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

18 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?

 
Flag Post

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

 
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).

 
Flag Post

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

 
Flag Post

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

 
Flag Post

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

 
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.

 
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.

 
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.

 
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.

 
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…

 
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 ;) )

 
Flag Post

Ah ^^ my bad.

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

 
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”.

 
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)

 
Flag Post

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

 
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.

 
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.