Does this code look good for calling functions Func1 thru Func8 every time next_btn is clicked?
I get the following error: Argument count mismatch on FWA_fla::MainTimeline/nextReg(). Expected 0, got 1.
My research tells me its most likely bad syntax. Do I need "Private" function? Thanks so much, I'm lost !!!
var counter:Number = 0;
this.next1_btn.addEventListener (MouseEvent.CLICK, nextFunc);
function nextFunc(event:MouseEvent) : void
{
if (counter == 9) {
(counter == 0);
}
counter++;
trace(counter)
this["Func"+counter]();
}
//reg1 thru reg8 are defined below
function Func1 (event:MouseEvent) : void
{
do some thing
}
function Func1 (event:MouseEvent) : void
{
do some thing
}
// etc.
So sorry, I edited the code once I posted it to make more sense but I edited it poorly. lets try again:
Does this code look good for calling functions Func1 thru Func8 every time next_btn is clicked?
I get the following error: Argument count mismatch on FWA_fla::MainTimeline/nextFunc(). Expected 0, got 1.
My research tells me its most likely bad syntax. Do I need "Private" function? Thanks so much, I'm lost !!!
var counter:Number = 0;
this.next1_btn.addEventListener (MouseEvent.CLICK, nextFunc);
function nextFunc(event:MouseEvent) : void
{
if (counter == 9) {
(counter == 0);
}
counter++;
trace(counter)
this["Func"+counter]();
}
//Func1 thru Func8 are defined below
function Func1 (event:MouseEvent) : void
{
do some thing
}
function Func2 (event:MouseEvent) : void
{
do some thing
}
// etc. thru Func8
So sorry, I edited the code once I posted it to make more sense but I edited it poorly. lets try again:
Does this code look good for calling functions Func1 thru Func8 every time next_btn is clicked?
I get the following error: Argument count mismatch on FWA_fla::MainTimeline/nextFunc(). Expected 0, got 1.
My research tells me its most likely bad syntax. Do I need "Private" function? Thanks so much, I'm lost !!!
var counter:Number = 0;
this.next1_btn.addEventListener (MouseEvent.CLICK, nextFunc);
function nextFunc(event:MouseEvent) : void
{
if (counter == 9) {
(counter == 0);
}
counter++;
trace(counter)
this["Func"+counter]();
}
//Func1 thru Func8 are defined below
function Func1 (event:MouseEvent) : void
{
do some thing
}
function Func2 (event:MouseEvent) : void
{
do some thing
}
// etc. thru Func8
Seeing as how you seem to be unable to show actual code/error messages, the best I can offer is... the errror is indicating that you do not specify the argument that you show in the code you posted for the nextFunc function
Your other functions you show having an argument but you do not send one to them.
function nextFunc(event:MouseEvent) : void // this line requires the "event.MouseEvent"
function Func1 (event:MouseEvent) : void // these lines should not have "event.MouseEvent"
You were exactly right. My next problem is that I can't seem to reset the countReg var back to 0 once it hits 8. any ideas?
var countReg:Number = 0;
function nextReg(event:MouseEvent) : void
{
if (countReg == 9)
{
(countReg == 0);
}
countReg++;
trace (countReg) // it just keeps counting up. won't start over after 8
}
this.next1_btn.addEventListener (MouseEvent.CLICK, nextReg);
North America
Europe, Middle East and Africa
Asia Pacific