Skip to main content
Known Participant
June 30, 2009
Question

Need advice on setting up a new project

  • June 30, 2009
  • 2 replies
  • 868 views

Hello,


I'm creating a rather complicated project in flash and as3 and would like some advice on how I should set it up.

It requires a login and based on the information the user puts in the login, I need to build a drop down menu.


While logging into the program, the user has to select from one of three categories and one of 10 locations. The main buttons for the drop down are dictated by the categories, each of these buttons have specific modules which will go under each topic. 


example:
category1
category2
category3

category1 uses buttons catA catB catC
category2 uses buttons catA catB
category3 uses buttons catA catC

under cata
module 1
module 2
module 3
module 4

under catb
module 1
module 2
module 3

under catc
module 1
module 2
module 3
module 4
module 5
module 6
module 7

Based on the location the user chooses, a module may have to be added under cata and/or catb and/or catc


The user can click on the buttons in the drop down to skip to different modules, but if they do not it will play in order. Each module has a video, once the video is complete there is an activity/quiz (each of the activities are quite different). Once the activity/quiz is complete, the next module loads until they reach the final module and a lovely final quiz.

Any advice on how to set up a complicated project would be great I've spent a couple of days hunting online and looking at/ trying examples, but all I did was confuse myself.

Warning: I come from an AS2 background... (but not minding as3 so far)

This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
June 30, 2009
var categoryObj:Object={};
var subcategoryObj:Object={};

subcategoryObj["A"]=["mod1","mod2","mod3","mod4"];
subcategoryObj["B"]=["mod1","mod2","mod3"];
subcategoryObj["C"]=["mod1"];

categoryObj["1"]=["A","B","C"];
categoryObj["2"]=["A","B"];
categoryObj["3"]=["A","C"];


var moduleA:Array = moduleF(numX.toString());

function moduleF(numS:String):Array{
var a:Array = [];
for(var i:uint=0;i<categoryObj[numS].length;i++){
for(var j:uint=0;j<subcategoryObj[categoryObj[numS]].length;j++){
a.push(subcategoryObj[categoryObj[numS]]);
}
}
// use the filter method to remove duplicates
return a;
}

Known Participant
July 1, 2009

Thanks for all your help.

I'm testing your code now and I'm having problems with this line

var moduleA:Array = moduleF(numX.toString());

its giving me this lovely error:

TypeError: Error #1010: A term is undefined and has no properties.

I was wondering what I might be doing wrong.

kglad
Community Expert
Community Expert
July 1, 2009

numX is your category number.  so, if you want to know all the modules for category1, use:

moduleF(1.toString());  // or moduleF("1");

for category2, use:

moduleF("2");

etc.

kglad
Community Expert
Community Expert
June 30, 2009

use an associative array (or arrays) to associate the users choice(s) and your menu.

Known Participant
June 30, 2009

would you have a simple example?