Sebastian,

I have tried implementing your idea but I don't seem to be able to create my dropdown menu any longer. Only the last button is created and without the appropriate label but also at 0,0.

Also, should I made the heigth of the container large enough to hold any number of buttons? At the moment it has a fixed height of 30.

Thanks
JohnT


sebastian wrote:

hi John,

well you want to attach all the sub clips to the holder.
so:

var containerDepth:Number = 1;
this.createEmptyMovieClip("container_mc", containerDepth,thisOne._x-100, 0, 130, 25); this.container_mc.createTextField("mySubText"+i,this.getNextHighestDepth());

subBtn = this.container_mc.attachMovie("butt_btn", dropMenuArray[i], this.getNextHighestDepth());

by using the same containerDepth every time you also effectively overwrite the existing depth [another way of deleting].

in general, avoid attaching anything directly to the root, always group thing in container movieclips because then its much easier to do anything to the group [like relocating the x or y position, or in this case, deleting it all].

Also avoid using root in 99% of all cases since you will only create issues later on when you try and nest movieclips in movieclips [for example you decide later to make a preloader and want to nest the menu with other clips in another movieclip... [or swf]; your _root will no longer point to the right location...

As far as the 'effort' to learn functions... its really not that hard, it's within your current knowledge if you are writing these kinds of commands already - so its a small step to add to your knowledge, and it will save you time! not cost you more time... trust us.

[delegate.create is a specific solution to AS2 code! if you are just adding functions to your existing code on the time line, you would never need to use that]

seb.




_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to