- Home /
Kongregate Shared Content API
I am trying to access the Kongregate shared content API but this is only available to Flash AS3. So would it be possible to host the game elsewhere alongside a tiny flash window (1x1px) and then have them communicate via server side Javascript (I have only used Unityscript before). Does anyone think this would be possible without too much trouble? Thanks in advance, Will.
Answer by Bunny83 · Jan 30, 2011 at 02:43 PM
Well, i don't know anything about Kongregate but it should be possible, like you mentioned: run a small flash window and communicate via "client side javascript". You never have javascript or flash serversided. Flash is only executed on the client inside the browser (you will need the flashplayer like you need the Unity webplayer for Unity.
In Flash AS3 use the "ExternalInterface" to call a javascript function inside your webpage and offer the webpage a "channel" back into flash. The Unity docs have an great article about Unity webplayer and brownser communication.
That should be all you need.
So communication will be like:
Flash-->webpage-->unity
and
unity-->webpage-->flash
Cheers for the link, I'll have a look into it. Do you think you can pass several long arrays through?
It should be possible but i haven't tried it yet. Since the unity to javascript call is evaluated through a string that represents javascript code and is executed inside the browser, you can setup even a long string in a loop by adding each element of an array to the string and form a JScript like array deffinition.
Your answer
Follow this Question
Related Questions
JavaScript --> Unity Flash Build 2 Answers
Help with Kongregate API? 0 Answers
Unity WebGL Problem 0 Answers
how to use the listen port in this case? 0 Answers