Unhandled message

fuloprichard zei

een tijd geleden | Bericht #1
I have problems with message handling.. flash saz that there is an unhandled meassage, but theres the code which have to handle that... i dont understand..

fuloprichard zei

een tijd geleden | Bericht #2
and another question: at server side, whats the problem with this:

public int[] playerid;


then in Userjoined:

playerid[player.UserId] = 1; <--------- it saz theres a problem with this but i dont know what..

CanzectoCanzecto zei

een tijd geleden | Bericht #3
I cannot tell you about the first part. However the second question, do you have a debug info to go with that error? Don't know which IDE you are using or simply going notepad->compiler. Guessing its C# with express edition?

It should tell you whats wrong, that information might be useful in giving you a right response.

Some things you can check so far. My experience is mostly with C++ and Java. Don't know if C# likes the [] (array accessor) to be after the type instead of after the identifier. Maybe try public int playerid[]. This however might be totally wrong and again, error information would be good help.

Other things to check is:

- That you have accessrights/within scope to/of the values you are trying to access.

- The problem might be in the code previous to the assignment, maybe you forgot some symbol in the code just before this segment, like forgetting to close an arguement?

- Out of bounds error? You enter a situation where you try to access data that doesnt exist and you are therefore out of the bounds of the array.


--- Is it a checked or unchecked error, like, does it happen at execution/testing whatever, or on compile-time.



Just alot of ideas for you to test out, just know that problems are easierly solved by providing the context and the effect.

:) Hope it helps, and good luck on your project.

rdzrdz zei

een tijd geleden | Bericht #4
In your 2nd question you show the declaration of 'playerid' and the you assign a value to 'UserId'... :-S

Either i simply do not get the question, or you are comparing apples to peres here.



edit: i see now i am a little late with responding here. :-X
Laatst gewijzigd een tijd geleden

CanzectoCanzecto zei

een tijd geleden | Bericht #5
Yeah i noticed too that it looks like his user is no longer active :) Just alittle too late. But to answer your question.

He is using the value of player.UserId in the array accessor. Its actually correct if its what he wants to do.

MyArray [ NUMBER OF ELEMENT ]

So, if I do this:

public int[] playerId = new int[5]; // however you do it :P

then you can access all 5 variables, within the array through the accessor by using another variable (or just constant), like this:

for ( int x = 0; x < 5; x++ )
{
println/cout/printf/trace playerId [ x ] ;
}


Please notice that in most languages the array must be initialized, as apposed to what the first poster did :) just noticed.

You need to have your object reference (in this case int[]) point at some memory for it to work usually. Again its dependent on your programming language.

Also please note that it is different between language whether or not they resets the memory assigned to your variables, meaning a new int my get reset to 0 at initialization, or it might regain the int value of the 4 bytes it has been granted as memory space.



--- Again the problem is that the original poster havent given us any sort of error message to follow, he is simply saying "this is wrong" <-- fix it

Antwoord op onderwerp

Schrijf je nu in om te kunnen antwoorden op onderwerpen

Nonoba

nonoba.nl is een onafhankelijke spelletjes site waar je zowel individueel als gezamenlijk spelletjes gratis kunt spelen.

Developer gereedschap

Als je een flash spelontwerper bent hebben we gave gereedschappen die je kunnen helpen om nog betere spellen te ontwikkelen.

Geweldige Spellen

Waarom probeer je niet een van de beste online flah spellen die wij hebben voor nop?

Copyright ©2007-2012 Nonoba™ - All rights reserved.46.8ms on SERVER34096