# My hitTest needs a 2nd function

**URL:** <https://forum.kirupa.com/t/my-hittest-needs-a-2nd-function/283129>\
**Category:** flash\
**Created:** [March 2, 2009, 11:16pm UTC](https://forum.kirupa.com/t/my-hittest-needs-a-2nd-function/283129 "2009-03-02T23:16:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![somnamblst](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@somnamblst](https://forum.kirupa.com/u/somnamblst)\
**Post date:** [March 2, 2009, 11:16pm UTC](https://forum.kirupa.com/t/my-hittest-needs-a-2nd-function/283129/1 "2009-03-02T23:16:44Z")

</div>

I have a bouncing basketball that when “dunked” launches a nested net animation. In the nested animation is a loadMovie of a subSWF, the empty mc called mySUB is on the main timeline. It is working but because the 3rd party API that is going to be serving these files does not play nice with \_root I am thinking a more elegant solution is to use the hitTest to also launch the subSWF.

I tried simply repeating the hitTest function with loadMovie added but nothing happened.

This is my hitTest AS that plays the net stretching animation

```auto
onClipEvent(enterFrame) {
  if(this.hitTest(_root.net_mc)){

    _root.net_mc.gotoAndPlay("net");    
    delete this.onEnterFrame
  }

}

```

Adding the following did not launch my subSWF called youWin2

```auto
onClipEvent(enterFrame) {
  if(this.hitTest(_root.net_mc)){
mySUB.loadMovie(_root.myPR.absolutePath +"youWin2.swf");   
    delete this.onEnterFrame
  }

```
