Menu Sections locked and unlocked

  • CPittman10
  • Born
  • Born
  • CPittman10
  • Posts: 3

Post 3+ Months Ago

I am looking for some help. I have created at menu with 6 sections

1. introduction
2. topic 1
3. topic 2
4. topic 3
5. summary
6. quiz (test)

Now each of these six sections is it own button and the user can choose to go to any section they like. But what I want to have happen is make the quiz (test) section locked until the other 5 sections have been taken.

I think that I have to make it a sharedobject with the lock and unlock component. Also I understand that there has to be some kind of a code where all the buttons start out at "0" and after they are click on they change to "1" and then when they add up to "5" or there is no more "0's" then the Quiz will open or be unlocked.

But I am not sure that is just how I have it happening in my head so far. So if someone can help me that would be great.

Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

woah settle down cowboy thats way more work than you need with the shared object and lock components, etc.

You just need to make an empty array and then add items to the array as buttons are clicked. The check if the array has a specific number of items and enable the quiz. Here's some example code. Just remember you'll have to set your own instance names and paths.

Code: [ Select ]
QuizBtnInstance.enabled = false;

var clickedBtns = new Array();

// example button code
btnInstanceName.onRelease = function(){
// give each button an ID number 0-4 (5 total)
clickedBtns[thisID] = this;

if(clickedBtns.length == 5){
     // enable the quiz btn
     path.to.quiz.btn.enabled = true;
}
}
  1. QuizBtnInstance.enabled = false;
  2. var clickedBtns = new Array();
  3. // example button code
  4. btnInstanceName.onRelease = function(){
  5. // give each button an ID number 0-4 (5 total)
  6. clickedBtns[thisID] = this;
  7. if(clickedBtns.length == 5){
  8.      // enable the quiz btn
  9.      path.to.quiz.btn.enabled = true;
  10. }
  11. }
  • CPittman10
  • Born
  • Born
  • CPittman10
  • Posts: 3

Post 3+ Months Ago

Thanks for your help. I appreciate it. I got another question.

This Flash menu that I am building is being plugged into a program called Lectora (basic elearning program).

And each menu buttons calls out to a specific Lectora page (which has about 5 or 6 pages behind the first one) and after the user finishes the section Lectora brings them back to the Flash menu.

So since the menu is not 100% contacted in Flash will that code above work? Because the flash menu has to remember which section has been visited and which one hasn't to be able "enabled = true"

Any thoughts?
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

ahh yes thats correct. It probably won't work. In that case I would use a serverside programing language (php, asp, etc) and have that pass a variable to flash indicating which buttons are locked or not.

Code: [ Select ]
buttonname.enabled = true // or false
will "lock" a button in that it won't allow you to use a click or hover action on the button as long as its not enabled.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 13 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.