- Home /
How to send data from flash to unity?
I'm a newbee of both flash and unity and I'm trying to do web AR using FLARToolkit and Unity. I have no idea on how to send FLARToolkit's data(the marker's position and rotation) to unity. Followed the faq of the thread http://forum.unity3d.com/threads/116650-UnityShared.swc-Communicating-between-Unity-Flash-Content-and-AS3.?p=922340&viewfull=1#post922340, it dose work that flash successfully sendmessage to active a function of unity but the data isnt there.
The AS looks like:
public class SimpleLite extends FLSketch
{
...
private function _onEnterFrame(e:Event = null):void
{
...
unityContentRef.sendMessage("FlashUICommunicator", "ChangeWallColour"); // works
var x:Number = this.markerPositionMatrix.m03;
unityContentRef.sendMessage("FlashUICommunicator", "UpdatePosition", {x:Number}); // dosent work
...
}
...
}
In the unity c# it looks like:
public void UpdatePosition(float exampleObj)
{
#if UNITY_FLASH
t.transform.position = new Vector3(exampleObj, 2.841496f, -54f);
#endif
}
I have scratched my head...
Your answer
Follow this Question
Related Questions
Call C# function from within as3? 1 Answer
Rotation problem 1 Answer
Flash to html communication 1 Answer
unity flash communication 0 Answers
Passing variable into Unity function from browser JS via ActionScript 1 Answer