# Random ITEM fall? with hitTest

**URL:** <https://forum.kirupa.com/t/random-item-fall-with-hittest/176241>\
**Category:** programming\
**Created:** [January 21, 2006, 10:11pm UTC](https://forum.kirupa.com/t/random-item-fall-with-hittest/176241 "2006-01-21T22:11:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![igotgames](https://avatars.discourse-cdn.com/v4/letter/i/91b2a8/32.png) [@igotgames](https://forum.kirupa.com/u/igotgames)\
**Post date:** [January 21, 2006, 10:11pm UTC](https://forum.kirupa.com/t/random-item-fall-with-hittest/176241/1 "2006-01-21T22:11:52Z")

</div>

ok, i got a game with balls falling, and u have to get them to fall into the hoop… and where do i post the AS code… i have Flash 8 pro

this is the code places on the MC of the hoop

onClipEvent (enterFrame) {  
if (Key.isDown(Key.LEFT)) {  
this.gotoAndStop(2);  
this.\_x -= 10;  
\_xscale = 100;  
} else if (Key.isDown(Key.RIGHT)) {  
this.gotoAndStop(2);  
this.\_x += 10;  
\_xscale = -100;  
} else {  
gotoAndStop(1);  
}  
}  
onClipEvent (load) {  
maximumBottom = Stage.height;  
minimumLeft = 0;  
maximumRight = Stage.width;  
minimumTop = 0;  
}  
onClipEvent (enterFrame) {  
if (this.\_x\<minimumLeft) {  
this.\_x = minimumLeft;  
} else if (this.\_x\>maximumRight) {  
this.\_x = maximumRight;  
}  
if (this.\_y\<minimumTop) {  
this.\_y = minimumTop;  
} else if (this.\_y\>maximumBottom) {  
this.\_y = maximumBottom;  
}  
}

thts for moving left and right, anda kinda hitTest with the FRAMES boundries… sense i jst want left and right… i could get raid of Ys right

ok… i got 10diff kinds of balls… i want them to fall at random times, places\< from a stright line fromt the top…\>… then when they hit the hoop… (disappear)
