# Simple problem totally defeat noob

**URL:** <https://forum.kirupa.com/t/simple-problem-totally-defeat-noob/314404>\
**Category:** flash\
**Created:** [September 27, 2010, 10:54pm UTC](https://forum.kirupa.com/t/simple-problem-totally-defeat-noob/314404 "2010-09-27T22:54:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamminBill](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@JamminBill](https://forum.kirupa.com/u/JamminBill)\
**Post date:** [September 27, 2010, 10:54pm UTC](https://forum.kirupa.com/t/simple-problem-totally-defeat-noob/314404/1 "2010-09-27T22:54:59Z")

</div>

This should be quite simple but I am at a loss.

I have several functions in a Flash interactive that fire in response to buttons being clicked or rolled over:

function firstFunction(evt:MouseEvent):void{  
someThing.happens.right.now;  
}  
firstButton.addEventListener(MouseEvent.ROLL\_OVER,firstFunction);

function secondFunction(evt:MouseEvent):void{  
someThingElse.happens.right.now;  
}  
secondButton.addEventListener(MouseEvent.ROLL\_OVER,secondFunction);

What I would like to do in addition to the button events is have, say, the first function open when the page loads. Of course when I do this:

firstfunction();  
function firstFunction(evt:MouseEvent):void{  
someThing.happens.right.now;  
}  
firstButton.addEventListener(MouseEvent.ROLL\_OVER,firstFunction);

function secondFunction(evt:MouseEvent):void{  
someThingElse.happens.right.now;  
}  
secondButton.addEventListener(MouseEvent.ROLL\_OVER,secondFunction);

Flash helpfully explains that it’s expecting and argument when I call the function without the button event.

I’ve tried this:

firstfunction(null);  
function firstFunction(evt:MouseEvent):void{  
someThing.happens.right.now;  
}  
firstButton.addEventListener(MouseEvent.ROLL\_OVER,firstFunction);

function secondFunction(evt:MouseEvent):void{  
someThingElse.happens.right.now;  
}  
secondButton.addEventListener(MouseEvent.ROLL\_OVER,secondFunction);

And sometimes it works and sometimes it doesn’t.

Any thoughts?
