I’m having some trouble applying these new (to me) best practices I watched the other night.

I am trying to build a dynamic menu;

 

I have a Main.as class that extends movieClip that calls a menu class

new HorizontalTabMenu(model.getMenuArray(), this, 200, 20, 20);

 

The menu class doesn’t extend movieClip and its purpose is to manage the menu and attach the buttons.

 

The button movieClip has a class attached; “TabButton” is the mc, with “TabButton.as” attached

 

So I’m trying to attach the clips from the menu class but it isn’t working

(BTW I had it working on a single instances, it’s this example where I’m creating multiple instances is where I’m making a mistake)

 

Menu class ~

for (var i:Number = 0; i<mData.length; i++)

{

               tab = target_mc.attachMovie("TabButton", "tab"+i+"_mc", _depth);

               _depth++;

               tab.setProps(this, mData[i].LABEL, mData[i].ID, _depth);

               _depth++;

               tab._x = _x;

               tab._y = _y;

               _x += tab.returnNextX();

               tabs_array.push(tab)

}

 

^ here im trying to attach the mc from the library into the tab var so that I can add it to the array

^ without doing that I wasn’t sure how I could reference the movieclip without placing it in the mc_variable

 

I have a trace running on the TabButton class constructor and it doesn’t instantiate.

 

 

 

---
You are currently subscribed to fugli as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

 

---
You are currently subscribed to fugli as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to