2 Replies - 3670 Views - Last Post: 15 June 2016 - 03:19 PM

#1 rebeccah   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 14-June 16

INNCORRECT NUMBERS OF ARGUMENTS. No more than 0

Posted 15 June 2016 - 02:39 PM

Hello!

I am stuck and do not understand why my code wont work. This is my code in frame 1:
stop();
BTNStatistikk.addEventListener(MouseEvent.CLICK, neste);

var Undersøking:Array = new Array("Kjønn","Alder","Nøygd?","Anbefaling");//unødvendig arrayer inni her. Men det skaper system å se hva som er hva
Undersøking[0] = new Array("Jente", "Gutt");//da som står i sjølve rolldowngreia
Undersøking[1] = new Array ("Ja", "Nei");//osv
Undersøking[2] = new Array("Ja", "Nei");//osv

var Antall:Array = new Array();

function neste(e:MouseEvent) //gå til neste side for å vise tabellen
{
	Antall[0] = d1.text; //setter inn hvor mange av hver matvare vi har
	Antall[1] = d2.text;
	Antall[2] = d3.text;
	nextFrame(0); // går til neste side
}
:code:

-----

then in frame 2:
BTNTilbake.addEventListener(MouseEvent.CLICK, tilbake); //eventlistener for å komme seg tilbake til første side


stolpe1.scaleX=(Undersøking[0][0]*Antall[0])/2; //scaler opp hvor søylene mine. Deler på 2 slik at man kan få mer mat inn i diagrammet
stolpe3.scaleX=(Undersøking[1][0]*Antall[1])/2;
stolpe4.scaleX=(Undersøking[2][0]*Antall[2])/2;


var kjønn:Number = 0; //Variablene som blir outputta
var fornøyd:Number = 0;
var anb:Number = 0;


for (var i:int=0; i<Undersøking.length; i++) // for løkke for å telle sammen alle næringsstoffene
{
	kjønn +=  Undersøking[i][0] * Antall[i];
	fornøyd +=  Undersøking[i][1] * Antall[i];
	anb +=  Undersøking[i][2] * Antall[i];
}

TotKjønn.text = "" + kjønn;//setter inn verdiene i output boxene mine
TotNøygd.text = "" + fornøyd
TotAnbefaling.text = "" + anb

function tilbake(e:MouseEvent) //går tilbake til forrige frame, om man vil gjøre det på nytt
{
	prevFrame();
}

:code:
----

This is what my error says: Incorrect number of arguments. Expected no more than 0.

thanks for all the help!

This post has been edited by modi123_1: 15 June 2016 - 02:45 PM
Reason for edit:: please use the '[code]' tag button in the editor


Is This A Good Question/Topic? 0
  • +

Replies To: INNCORRECT NUMBERS OF ARGUMENTS. No more than 0

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,197
  • Joined: 12-June 08

Re: INNCORRECT NUMBERS OF ARGUMENTS. No more than 0

Posted 15 June 2016 - 02:45 PM

Really? No code tags? I thought I mentioned that last time. :/

What is the entire error message?
Where is the error happening?
Was This Post Helpful? 0
  • +
  • -

#3 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2397
  • View blog
  • Posts: 7,304
  • Joined: 15-January 14

Re: INNCORRECT NUMBERS OF ARGUMENTS. No more than 0

Posted 15 June 2016 - 03:19 PM

If you demonstrate that you understand how to post code using code tags then I'll be happy to point out the change you made to a function that doesn't accept any parameters.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1