# Pretend Button

**URL:** <https://forum.kirupa.com/t/pretend-button/282992>\
**Category:** flash\
**Created:** [March 1, 2009, 3:28am UTC](https://forum.kirupa.com/t/pretend-button/282992 "2009-03-01T03:28:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenBart](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@BenBart](https://forum.kirupa.com/u/BenBart)\
**Post date:** [March 1, 2009, 3:28am UTC](https://forum.kirupa.com/t/pretend-button/282992/1 "2009-03-01T03:28:41Z")

</div>

I have a function that is called by a CLICK eventListener. I want to call the function as if the button was clicked, but it wasn’t really clicked.

```auto

    var tempEvent:Object;
    tempEvent.target = printMC.getChildByName("print0");
    buttonFunction(tempEvent as Event);

```

Error:  
TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at index\_v1\_fla::MainTimeline/initPrint()  
at index\_v1\_fla::MainTimeline/frame4()
