I am using Flash 6 for development. I have created a tutorial which consists of five modules, all in one fla. I want the user to be able to navigate to the first module. Once completed the user can go to the second module, but also review the first whenever s/he wants. The idea is to be able to view current and previous modules, but not skip ahead (let's say from module 1 to module 4) without completing the prior modules (including end of module quiz). I have navigation tabs on top, but was thinking of dimming the ones not available (not imperative). The way it currently is set up is to allow access to any module, regardless of whether they covered the material or not. Any thoughts on how I should proceed? Thanks in advance for any help.
//frame 1
module=0;
say u have 5 modules, at the end of the
//module1
/:module=1;
//module2
/:module=2;
.. etc
//on those buttons
//button 1
on(release){
if (/:module >= 1) {
_root.module.gotoAndPlay("
// or whatever that is
}
}
//button 2
on(release){
if (/:module >= 2) {
_root.module.gotoAndPlay("
// or whatever that is
}
}
... etc & so on ...
just an alternative to save from using the array for 5 modules, looping etc.
rp's solution works perfect and is great for a lots for different modules and not in sequential access order, say user can do 1, 4, 5 .. etc, and go back to see those are done.
// but using boolean instead of string will make it a bit faster and easier ... don't have to assign initial value, no string comparison is needed
just a suggestion :)
//main frame1
button = new Array();
//module 1 last frame
/:button[1] = true;
// button 1
if (/:button[1]) {
// do something here
// allow switch of module, etc
}
cheers