# Usng clearTimeout onClick

**URL:** https://forum.kirupa.com/t/usng-cleartimeout-onclick/296160
**Category:** Uncategorized
**Created:** [September 10, 2009, 9:10am UTC](https://forum.kirupa.com/t/usng-cleartimeout-onclick/296160 "2009-09-10T09:10:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![donkeykong](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@donkeykong](https://forum.kirupa.com/u/donkeykong)
#### Post date: [September 10, 2009, 9:10am UTC](https://forum.kirupa.com/t/usng-cleartimeout-onclick/296160/1 "2009-09-10T09:10:37Z")

</div>

hi all

would anyone beable to help with this little bug

I have swf movies that load in on a timeDelay on Click, but can’t get to unload correclty when another click happens, I was directed to this adobe file:  
[[COLOR=#004477]http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/package.ht ml#clearTimeout[/COLOR]](http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/package.html#clearTimeout)()

but never used before and don’t really understand, would anyone beable to help implement to my onCLick script??

this is what I have on my onClick;

```auto
    [COLOR=#0000ff] private function onMenuItemClick(event:MouseEvent ):void {
            lastMoviePlaying.load(new URLRequest(images[lastMoveIndex].@path));
            for (var i:int = 0; i < circleMenu.numChildren; i++) {
                circleMenu.getChildAt(i).removeEventListener( MouseEvent.CLICK, onMenuItemClick );
            }
            circleMenu.scrollToItem(event.currentTarget as DisplayObject);
            lastMoviePlaying = event.target;
            lastMoveIndex = event.target.name;
            setTimeout(LoadMovieClip,250,event.target,(images[event.target.name].@swf));
        }
        private function LoadMovieClip(ldr:Loader, movieName:String):void {
            if (movieName !=null && ldr != null) {
                ldr.load(new URLRequest(movieName));
            }
            for (var i:int = 0; i < circleMenu.numChildren; i++) {
                circleMenu.getChildAt(i).addEventListener( MouseEvent.CLICK, onMenuItemClick );
            }
        }
    }
}[/COLOR]

```

[COLOR=#0000ff][/COLOR]  
[COLOR=#0000ff][/COLOR]would anyone beable to explain how to use it and help me include with my script??  
many thanks
