>>
|
No. 6694
var one:movieClip = new one_mc();
var two:movieClip = new two_mc();
var tree:movieClip = new tree_mc();
var four:movieClip = new four_mc();
one.addEventListener("Movieclip_stopped", _stopHandler);
function _stopHandler(e:Event):void
{
addChild (two);
two.x = 768;
two.y = 0;
TweenLite.to(two, 0.75, {x:0, y:0});
TweenLite.to(one, 0.75, {x:-768, y:0});
}
two.addEventListener(TransformGestureEvent.GESTURE_SWIPE, oneortree);
function oneortree(event:TransformGestureEvent):void {
if(event.offsetX == 1)
{
addChild (one);
one.gotoAndPlay(1);
one.x = -768;
one.y = 0;
TweenLite.to(two, 0.75, {x:768, y:0});
TweenLite.to(one, 0.75, {x:0, y:0});
}
if(event.offsetX == -1)
{
reoneeChild (one);
addChild (tree);
tree.x = 768;
tree.y = 0;
TweenLite.to(tree, 0.75, {x:0, y:0});
TweenLite.to(two, 0.75, {x:-768, y:0});
}
}
tree.addEventListener(TransformGestureEvent.GESTURE_SWIPE, twoorfour);
function twoorfour(event:TransformGestureEvent):void {
if(event.offsetX == 1)
{
addChild (two);
two.addEventListener(TransformGestureEvent.GESTURE_SWIPE, oneortree);
two.x = -768;
two.y = 0;
TweenLite.to(two, 0.75, {x:0, y:0});
TweenLite.to(tree, 0.75, {x:768, y:0});
}
if(event.offsetX == -1)
{
reoneeChild (two);
addChild (four);
four.x = 768;
four.y = 0;
TweenLite.to(four, 0.75, {x:0, y:0});
TweenLite.to(tree, 0.75, {x:-768, y:0});
reoneeChild (two);
}
}
four.addEventListener(TransformGestureEvent.GESTURE_SWIPE, treeorfour);
function treeorplateone(event:TransformGestureEvent):void {
if(event.offsetX == 1){
TweenLite.to(tree, 0.75, {x:0, y:0});
TweenLite.to(four, 0.75, {x:768, y:0});
}
}
|