Dynamic Menu Help

  • bjory
  • Born
  • Born
  • bjory
  • Posts: 3

Post 3+ Months Ago

I used the following codes to create my dynamic menu.

Quote:
GenerateMenu = function(container, name, x, y, depth)
{
var numBtns = Number(recData.c);
var currItem;
var currMenuTitle;
var currMenu = container.createEmptyMovieClip(name, depth);
var menuTitle = container.createEmptyMovieClip(name, depth);

for (var i = 0; i<numBtns; i++)
{
currItem = currMenu.attachMovie("menuBtn","btn" + i + "_mc", i + 1);
currMenuTitle = menuTitle.attachMovie("menuNameMC","title",0);
currMenuTitle._x = 100;
currMenuTitle._y = 100;
currMenuTitle.menuName.text = recData.MuscleDesc0;

currItem._x = x;
currItem._y = y + i*currItem._height;
currItem.trackAsMenu = true;
btnName = eval("recData.Name"+i);
currItem.btnName.text = btnName;
currItem.exerciseID = eval("recData.ExID" + i);
currItem.onRelease = function(){
_global.exeID = this.exerciseID;
loadMovie("Dynamic Menu 2.swf", 1);
}
}
}


Basically, to illustrate what it display:

Menu Title
Button 1
Button 2
Button 3
Button 4
Button 5
Button 6

I want to break the list of buttons up into 2 parts. Meaning starting will only display button 1 - 3 and when a next button pressed, display button 4 - 6.

I used the for loop highlighted in red inside the nextBtn.onRelease() to make it display the new set of 3 buttons. But it doesn't work. Can someone help me on this please!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 14 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.