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?