lundi 20 mars 2017

Can I manipulate a single array from multiple classes in AS3?

I have a class which contains an array. I seem to be able to manipulate that array fine from multiple classes, but it is not without bugs. In my debugging efforts, I came across this which makes me think that what I'm trying to do is the "wrong" way. Am I to understand that I can access an array from multiple classes (via getter/setter functions or making it a public property) but that if it is manipulated by 2 different classes in one frame/loop/tick, that the Array "reference" (or whatever) will not be up to date across all "references"?

If I've understood this correctly, a simple "yup" will do. If I'm missing something, please help.

Any tips on how to structure a program so that you don't run into this kind of issue?

Aucun commentaire:

Enregistrer un commentaire