# Flash 8 simple collision not working

**URL:** <https://forum.kirupa.com/t/flash-8-simple-collision-not-working/226100>\
**Category:** Uncategorized\
**Created:** [May 18, 2007, 4:05am UTC](https://forum.kirupa.com/t/flash-8-simple-collision-not-working/226100 "2007-05-18T04:05:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![force10x](https://avatars.discourse-cdn.com/v4/letter/f/d07c76/32.png) [@force10x](https://forum.kirupa.com/u/force10x)\
**Post date:** [May 18, 2007, 4:05am UTC](https://forum.kirupa.com/t/flash-8-simple-collision-not-working/226100/1 "2007-05-18T04:05:56Z")

</div>

Hi,  
I am creating a simple game in flash 8.[URL=“[http://force10x.freehostia.com/flash/game\_v2.zip](http://force10x.freehostia.com/flash/game_v2.zip)”]

I dont have much skills in programming hence help required.

I have a game where users can drag and drop elements to build something.

when the user drags a part, on hitTest, that part becomes invisible while the other one becomes visible.  
I tried removing the movie clip but that wont work.

here is my code

```auto

stop();

this.onEnterFrame = function():Void{
    makeFinalPipeInvisible();
    checkPipePlacement();
}

//start dragging pipe peice 01
this.pipe01_mc.onPress = function():Void {
    trace("it");
    startDrag(this);
}
this.pipe01_mc.onRelease = function():Void {
    
    this.stopDrag();
}

//start dragging pipe piece 01
this.pipe01_mc.onPress = function():Void {
    trace("it");
    startDrag(this);
}
this.pipe01_mc.onRelease = function():Void {
    
    this.stopDrag();
}

//start dragging pipe peice 01
this.pipe02_mc.onPress = function():Void {
    trace("2");
    startDrag(this);
}
this.pipe02_mc.onRelease = function():Void {
    
    this.stopDrag();
}

//Functions start here ***

//This one sets the initial final pipe to invisible
function makeFinalPipeInvisible():Void{
    this.finpipe01_mc._visible = false;
    this.finpipe02_mc._visible = false;
    this.finpipe03_mc._visible = false;
    this.finpipe04_mc._visible = false;
    this.finpipe05_mc._visible = false;
    this.finpipe06_mc._visible = false;
    this.finpipe07_mc._visible = false;
    this.finpipe08_mc._visible = false;
    this.finpipe09_mc._visible = false;
}

//Checks for hit test and makes final piece visible
function checkPipePlacement():Void {
    
    if (this.pipe01_mc.hitTest(this.finpipe01_mc)){
        this.finpipe01_mc._visible = true;
        this.pipe01_mc._visible = false;
        
    }else if (this.pipe02_mc.hitTest(this.finpipe02_mc)){
        this.finpipe02_mc._visible = true;
        this.pipe02_mc._visible = false;
    }else if (this.pipe09_mc.hitTest(this.finpipe09_mc)){
        this.finpipe09_mc._visible = true;
        this.pipe09_mc._visible = false;
        trace("game over");
    }
        
    
}

```

A shove in the right direction would do a lot good.

thank you.

[here](http://force10x.freehostia.com/flash/game_v2.zip) is the fla
