开发者

Actionscript folder system

Getting a bit stuck here on the idea...

I'm trying to create a flash card game / study material program where users are able to load lists of questions/answers. I want to organize the lists in a folder-like system. I imagine folders as arrays and the lists of questions and answers as text files.

My problem is that I know that with a single array, I can dynamically create an infinite amount of arrays... but how do I write data to the last array in the line? The idea is that the USER creates their own organization (dynamic, for differ开发者_开发技巧ent classes, subjects, etc)

I thought about something like myArray[i][j][k][l] but I don't know how to make it dynamic, such as if it was like myArray[3][4] has no subclasses or child arrays, or if [l] had 20 more subclasses/child arrays.

I was thinking about writing a function that has a loop that calls itself if there are children, but, I don't know how to make said unique for [i], [j], [k], etc.

Sorry if the information is a bit underwhelming, but I'm not sure how to express any more information.


Actionscript is object oriented and I will not try to create an array if it has to be dynamic. I will create an object called 'Questions' and will have the question text, text file location or whatever you want to maintain. I will create an ArrayCollection attribute called children with in the 'Question' class, which in turn is a list of Question objects. This way I can maintain hierarchy and add and remove children without much hassle.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜