Quantcast
Channel: Adobe Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 238792

bring object to front air for ios

$
0
0

i have mc on stage called team which has 11 children "(players[myNum])" that are randomly  triggered by button called "caller".

 

what script do i have to add to function"calling" in order to bring the randomly child to front?

 

 

stop()

var players:Array = [team.christian,team.danny,team.davinson,team.dele,team.harry,team.heung,team.hugo,team.j an,team.kieran,team.moussa,

team.tanguy]

var chosen

var picture

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

 

 

team.addEventListener(TouchEvent.TOUCH_BEGIN, BeginHandler);

team.addEventListener(TouchEvent.TOUCH_END, EndHandler);

 

 

caller.addEventListener(TouchEvent.TOUCH_BEGIN, calling);

 

 

var orech:Number=11;

var DragBounds:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);

 

 

function calling(event:TouchEvent):void

{

var myNum:Number = Math.floor(Math.random()*orech);

orech= orech-1;

players[myNum].x=200;

players[myNum].y=750;

 

this is the place i want to add the bring to front script

caller.x=1200

........

    chosen=players[myNum];

players.splice(myNum,1)

if (orech==0)

{

gotoAndStop(2)

}

}

 

 

function BeginHandler(event:TouchEvent):void

 

 

{

event.target.startTouchDrag(event.touchPointID, false, DragBounds);

event.target.width=135

event.target.height=135

 

 

}

 

 

function EndHandler(event:TouchEvent):void

{

event.target.stopTouchDrag(event.touchPointID);

 

 

 

if (chosen.hitTestPoint(picture.x,picture.y)) { 

      

 

......

      

melel.text="wrong"

chosen.x=200;

chosen.y=750;

chosen.width=290

chosen.height=295

 

    }

}


Viewing all articles
Browse latest Browse all 238792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>