Depth was another problem I had,
When I use attachMovie in the Menu Class I have to specify a depth
But I also have to specify a depth when using attachMovie within the TabButton Class.
(I thought all the depths are relative to the root timeline, Therefore I needed to pass through a depth param as this class is called dynamically);

I couldn’t find a way to do pass a depth param to the TabButton constructor.
So instead I didn’t use attachMovie in the MovieClip constructor but ratherin a function I create setProps() where I pass through the depth as a param and then use attachMovie in that function.

This is where I think I’ve made a mistake.
This is the first time I have really used inheritance on the MovieClip Class.

Bjorn

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Lane
Sent: Monday, 23 May 2005 9:17 AM
To: Flash Developers List
Subject: [fugli] Re: extend mc

 

If Menu class doesn't extend MovieClip then I would have thought it wouldn't have access to attachMovie which is a method of MovieClip.  But you say it worked for a single instance.  If you don't have access to attachMovie I wouldn't have expected it to work at all.

 

How come you increment _depth twice when you have only used one depth?  It shouldn't affect the outcome but I'm just curious.

 

Bill Lane

>>> [EMAIL PROTECTED] 05/22/05 10:07 am >>>

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/ ---
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