# How to artificially set an event call

**URL:** https://forum.kirupa.com/t/how-to-artificially-set-an-event-call/301050
**Category:** Uncategorized
**Created:** [December 2, 2009, 9:24pm UTC](https://forum.kirupa.com/t/how-to-artificially-set-an-event-call/301050 "2009-12-02T21:24:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![phastings](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@phastings](https://forum.kirupa.com/u/phastings)
#### Post date: [December 2, 2009, 9:24pm UTC](https://forum.kirupa.com/t/how-to-artificially-set-an-event-call/301050/1 "2009-12-02T21:24:55Z")

</div>

hi, i’m creating a menu that of course calls some functions then items are clicked. the problem i’m having is i want to fake one of these menu click events from a function when the menu loads and i can’t figure out how to do it.

here’s a sample of the function(not complete).

function itemClicked(e:Event):void {  
trace(“activeMenu:”+e.target.name); //traces out menuItem0, menuItem1, etc.  
trace(“moveItems:”+e.currentTarget.name); //traces out menuItem0, menuItem1, etc.

```
        activeMenu=e.target;
        moveItems(e.currentTarget,"open");

```

}

here’s a sample of the function i’m trying to call:

function openInit():void {  
var tempClip:MovieClip= “menuitem0” as MovieClip;  
activeMenu=tempClip; [//e.target](https://e.target);  
moveItems(tempClip,“open”);  
}

so i guess what i’m asking is how do you artificially set an event call if you know the name of the movieclip that you want to simulate a click on?
