Posts Tagged ‘JAVASCRIPT’

Friday, November 28th, 2008

I am working with lots of content now that is flash and unity3d in game development for the web, and occasionally systems built in flash, javascript or other have to communicate with Unity3D and vice versa.  You can do this from the server side (WWW/WWWForm class or sockets) OR you can also communicate client side for many things such as sending name value pairs or variables into Unity3D, Flash or the javascript in page as needed. There are some great tools like UnityObject that is like swfobject (only you have to update it to work with latest browsers) that make this more simple to send in params and messages. The same can be applied to Silverlight. It is pretty simple all in all but having a sample to start with is good with all these technologies.

Paul Tondeur threw togetother a little sample that shows how you can integrate Unity3D, Flash and javascript in the page fairly simply with lots of great demos.  It really is just about passing parameters around into the objects from javascript, then within Flash calling ExternalInterface to call external javascript or within Unity3D calling Application.ExternalCall.

//Flash adding callback for javascript code
ExternalInterface.addCallback("functionNameInBrowser", functionNameInFlash );
//Unity3D calling javascript code
Application.ExternalCall("javascriptFunction", "Parameter1");

Nothing too tasking but if you want to see samples of this working together from flash, flex, javascript, unity3d then check it out. Zip on over to Paul’s site to grab the files and more demos and samples. All examples are bundled in one download, which includes all the Unity3D, Flash, Flex, Actionscript and Javascript files.

Here’s some demos

Thursday, August 14th, 2008

Well, ES4 and ES3 battles are over for javascript.  ES4 being the spec that AS3 Actionscript 3 is based on.  From the two people that are most in this Douglas Crockford and Brendan Eich, Crockford states “ES4 is no more”.

It is more a merging of the two ideas (continuing ES3 javascript or jumping to a new and improved ES4 Javascript 2 spec).  But still hopefully it retains the fun of AS3 scripting.  Javascripting with ES3 is fun but it has some quirks that make it a bit needy of frameworks to make development faster.  With ES4 based AS3 I have really enjoyed the improvement and simplification of things like event handling and typing.  We shall see what happens over time.  Maybe the NBL of Javascript2 just isn’t going to happen, or it will slow down now.

Discussion at reddit about this

More from Eich about this