<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>*drawlogic &#187; AJAX</title>
	<atom:link href="http://drawlogic.com/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://drawlogic.com</link>
	<description>interactive and game development technologies for the web - flash, flex, unity3d, silverlight, javascript</description>
	<lastBuildDate>Thu, 22 Dec 2011 21:55:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>AS3 Flash, Flex and Unity3D Browser Communication and Scripting with Javascript</title>
		<link>http://drawlogic.com/2008/11/28/as3-flash-flex-and-unity3d-browser-communication-with-javascript/</link>
		<comments>http://drawlogic.com/2008/11/28/as3-flash-flex-and-unity3d-browser-communication-with-javascript/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 08:57:15 +0000</pubDate>
		<dc:creator>drawk</dc:creator>
				<category><![CDATA[ACTIONSCRIPT]]></category>
		<category><![CDATA[ACTIONSCRIPT3]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[APPLICATIONS]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[DEVELOPMENT]]></category>
		<category><![CDATA[FLASH]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[GAMEDEV]]></category>
		<category><![CDATA[GAMES]]></category>
		<category><![CDATA[INTERACTIVE]]></category>
		<category><![CDATA[INTERFACE]]></category>
		<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[LIBRARIES]]></category>
		<category><![CDATA[OPEN SOURCE]]></category>
		<category><![CDATA[PROGRAMMING]]></category>
		<category><![CDATA[SILVERLIGHT]]></category>
		<category><![CDATA[SNIPPETS]]></category>
		<category><![CDATA[TECHNOLOGY]]></category>
		<category><![CDATA[TOOLS]]></category>
		<category><![CDATA[TUTORIAL]]></category>
		<category><![CDATA[unity3d]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[externalinterface]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[integrate]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://drawlogic.com/?p=284</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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 (<a href="http://unity3d.com/support/documentation/ScriptReference/WWW.html" target="_blank">WWW</a>/<a href="http://unity3d.com/support/documentation/ScriptReference/WWWForm.html" target="_blank">WWWForm </a>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 <a title="UnityObject" href="http://www.unifycommunity.com/wiki/index.php?title=UnityObject" target="_blank">UnityObject</a> 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.</p>
<p><a href="http://www.paultondeur.com/2008/11/12/unity3d-communication-with-browser-and-flash/" target="_blank">Paul Tondeur threw togetother a little sample</a> 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.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Flash adding callback for javascript code</span>
ExternalInterface.<span style="color: #660066;">addCallback</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;functionNameInBrowser&quot;</span><span style="color: #339933;">,</span> functionNameInFlash <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Unity3D calling javascript code</span>
Application.<span style="color: #660066;">ExternalCall</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;javascriptFunction&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;Parameter1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Nothing too tasking but <a href="http://www.paultondeur.com/2008/11/12/unity3d-communication-with-browser-and-flash/" target="_blank">if you want to see samples of this working together from flash, flex, javascript, unity3d</a> then check it out. Zip on over to Paul&#8217;s site to grab the files and more demos and samples. <a title="Download examples" href="http://www.paultondeur.com/files/Unity3DBrowserScripting/Unity3DBrowserScripting.zip">All examples are bundled in one download</a>, which includes all the Unity3D, Flash, Flex, Actionscript and Javascript files.</p>
<p><strong>Here&#8217;s some demos</strong></p>
<ul>
<li><a title="Unity3D Browserchat" href="http://www.paultondeur.com/files/Unity3DBrowserScripting/examples/UnityFlexChat/UnityFlexChat.html" target="_blank">Build a Unity3D &#8220;browserchat&#8221;</a></li>
<li><a title="Clickable Unity3D objects" href="http://www.paultondeur.com/files/Unity3DBrowserScripting/examples/UnityHandleClick/UnityHandleClick.html" target="_blank">Make Unity3D objects clickable and load content in Flash</a></li>
<li><a title="Drag Unity3D objects in Flash" href="http://www.paultondeur.com/files/Unity3DBrowserScripting/examples/DragUnity/DragUnity.html" target="_blank">Drag a rectangle in Flash and drag an cube in Unity3D</a></li>
<li><a title="Advanced Unity3D dragging in Flash" href="http://www.paultondeur.com/files/Unity3DBrowserScripting/examples/DragAdvancedUnity3D/DragAdvancedUnity.html" target="_blank">Add, delete and drag objects from the Flash interface and show this in Unity3D</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://drawlogic.com/2008/11/28/as3-flash-flex-and-unity3d-browser-communication-with-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

