Go Back   kirupaForum > Flash > Flash IDE

Reply
 
Thread Tools Display Modes
Old 03-18-2010, 02:14 PM   #1
izzeygarratt
Registered User
Children and go to next frame

Hi I am creating a breakout game and below is a part of my code:

function updateGame(e:Event) {
if (ball_mc.hitTestObject(brickone_mc)) {
beepSound.play();
yVel*=-1;
removeChild(brickone_mc);
}
if (ball_mc.hitTestObject(bricktwo_mc)) {
beepSound.play();
yVel*=-1;
removeChild(bricktwo_mc);
}
if (ball_mc.hitTestObject(brickthree_mc)) {
beepSound.play();
yVel*=-1;
removeChild(brickthree_mc);
}
if (ball_mc.hitTestObject(brickfour_mc)) {
beepSound.play();
yVel*=-1;
removeChild(brickfour_mc);
}
if (ball_mc.hitTestObject(brickfive_mc)) {
beepSound.play();
yVel*=-1;
removeChild(brickfive_mc);
}
if (ball_mc.hitTestObject(bricksix_mc)) {
beepSound.play();
xVel*=-1;
removeChild(bricksix_mc);
}
if (ball_mc.hitTestObject(bricksev_mc)) {
beepSound.play();
yVel*=-1;
removeChild(bricksev_mc);
}
if (ball_mc.hitTestObject(brickeig_mc)) {
beepSound.play();
yVel*=-1;
removeChild(brickeig_mc);
}

I have got it removing the bricks as each brick has an instance name, I am now wanting to go to an end screen once all the bricks have been removed, is there a way to count the children and then put a gotoAndStop() in?
izzeygarratt is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?

Old 03-18-2010, 09:42 PM   #2
fightclub
Registered User
Take a look at the numChildren property... should give you the information you need.
fightclub is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:52 AM.

SHARE:

SUPPORTERS:

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com