Identifying Created Objects
I am working on a game where words are dropping from the top of the screen, and students have to shoot the correct ones. This will happen in waves. Each wave of correct words are loaded into a list object. The same with the incorrect words. I am creating active system objects and loading the text from the list objects. Everything works well, except for loading the text into the created AS objects. I can't seem to find a way to identify one from another. The text ends up being loaded into other AS objects as well, sometimes in a seemingly random fashion. Any ideas on how to get this under control. I tried to use a spread but that didn't seem to work. Any help appreciated.
Steve
Re: Identifying Created Objects
Are you loading the AS boxes via a loop? this should work...
this assumes you have your list loaded.
Start of Frame
- Spread Value AltValA of ASboxes.Group(1)
Trigger the Loop "Load ASboxes" the number of times that there are lines in the list obejct.
On Loop "Load ASboxes"
+ ASboxes.Group AltValA = LoopIndex("Load ASboxes")+1
- Set Text of ASboxes.Group to GetLine(LineNumber(LoopIndex of "Load ASboxes")+1)
My syntax is not exact, but you get the point.
Re: Identifying Created Objects
I'm using a loop to load the questions and answers into the list boxes. But I can't use a loop to create the ASBoxes since there needs to be a time delay. The questions and answers are being created one at a time after a random amount of time at the top of the screen and then dropping. Thats why I don't think that the spread value is working the way I would like. Thanks for the idea.
STeve
Re: Identifying Created Objects
ah! I think I see now...
could you throw in a Counter, and every time an AS box is created, it adds one to the counter and then sets it's AltValA to the counter value? Then use it's AltVal to pull from the right question to the list...
Re: Identifying Created Objects
Good idea, aidmm. I'll give it a try. I've simplified the problem a bit in my post, since there are 10 waves of questions, and the coding is all working EXCEPT for this problem of identifying the created objects.
I was trying to create 10 correct answer AO boxes and 10 incorrect answer boxes. But I can't find a way to create the boxes randomly without tons of lines of code. It would be nice to be able to create using an expression.
Thanks again.
Steve
Re: Identifying Created Objects
It worked! Not without some problems, but finally success. The counter idea did the trick. Thanks aidmm.
Steve
Re: Identifying Created Objects