Tuio Kinect with Rippler

Tuio是一個十分好的一個工具,有很多方法可以與它溝通,之前試用以iOS, Android 方式輸入gesture,今次便玩玩Kinect吧!

Estee Lauder - Cyber White 2011

我對這 Project 可說是又愛又恨...

Deeplinking in Flash with SWFAddress



import com.asual.swfaddress.*;
import gs.TweenMax;
import gs.easing.Back;

var linkArray:Array=["Page1","Page2","Page3","Page4","Page5","Page6","Page7","Page8"];
var total:int=linkArray.length;
var container: Sprite = new Sprite();
addChild(container);

init();
function init()
{
createNav();
createContent();
}

// create navigation
function createNav()
{
for (var i :int = 0; i < total; i++)
{
var btn: Btn = new Btn();
addChild(btn);
with (btn)
{
x = (i * 40)+50;
y=450;
name=i;
displayText.text=i+1;
displayText.mouseEnabled=false;
buttonMode=true;
addEventListener(MouseEvent.CLICK,onclick);
}
}
}
function onclick(evt: MouseEvent):void
{
moveContent(evt.target.name);
var selectItem:String=linkArray[evt.target.name];
SWFAddress.setValue("/"+selectItem+"/");
}

// create Content
function createContent():void
{
for (var i:int = 0; i<total; i++)
{
var contentmc : ContentMc = new ContentMc();
container.addChild(contentmc);
with (contentmc)
{
x = (i * 750) + 50;
y=50;
displayText.text=linkArray[i];
}
}
}
function moveContent(dx:int):void
{
TweenMax.to(container, 1, {x:dx*-750, ease:Back.easeInOut});
}

// swfaddress handler
function swfhandler(evt:SWFAddressEvent)
{
var temp=evt.value;
var address=temp.slice(1,temp.length-1);
var num=linkArray.indexOf(address);
trace(num);

if (temp=="/"||numɘ)
{
SWFAddress.setTitle("Index - " + linkArray[0].toUpperCase());
moveContent(0);
}
else
{
SWFAddress.setTitle("Index - " + address.toUpperCase());
moveContent(num);
}
}

SWFAddress.addEventListener(SWFAddressEvent.CHANGE, swfhandler);

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More