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.
John Trentini wrote:
Thank you Sebastian,
This questions would probably belong to the flashNewbie list but they
have Jason there who advocates the use of 'Delegate. create' and
sincerely that confuses the hell out of me and, at this stage I do not
have the time to sit down and do any more learning than I am (school
deadlines looming very ominously ;) )
So, to follow up onyour suggestion: I create an emptyMovieClip and then
attach my textFileds and relative buttons, am I understanding correctly?
something like:
_root.createEmptyMovieClip("container_mc", _root.getNextHighestDepth(),
thisOne._x-100, 0, 130, 25);
newId.createTextField("mySubText"+i, this.getNextHighestDepth());
subBtn = newId.attachMovie("butt_btn", dropMenuArray[i],
this.getNextHighestDepth());
Am, I on the right track here?
Thanks
JohnT
if instead of creating your items in the root, you created them in a
MC, you can then just delete/unload the MC holder and then create a
new one. That will instantly remove all the sub-movie clip/buttons.
and, yes, you should try learning how to encapsulate your code in
functions or, even better, objects since this will only save you time
and create more clarity.
Jo
_______________________________________________
[email protected]
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
_______________________________________________
[email protected]
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