Help ,SetChildIndex over movieclips not working properly..
The problem is simply,
the code which works over stage, is not working properly over a movieclip..
sample, i have many objects to stay at different indexes at flash..
with that code block below. I add 300 mc's to stage,
Code:
for (var j:Number = 0; j<300; j++) {
var mc2:MovieClip = new MovieClip();
stage.addChildAt(mc2, j);
}
TO be able to change indexes with different items.. i have random movieclips which have to be placed indexes between 5 and 300.. And everything goes great when i do this directly at stage..
But when i do this with a movieclip.. example;
Code:
for (var i:Number = 0; i<300; i++) {
var mc3:MovieClip = new MovieClip();
my_mc.addChildAt(mc3, i);
}
i can't see the movieclips inside.. but i know they are at their right indexes..
but somehow they are getting behind those fake movieclips..
What might the reason be? Does anyone have any idea HELP PLEASE...
Any effort will be appreciated :P
Note: the layer is at the highest position which i use..
Not sure what you are calling a fake movieclip, but remember if you have clips added to the stage manually (in the timeline) they will probably sit on top of the additional layers. However, you are manually adjusting the indexes of the MC so, a change should be apparent, so back to my original questions, what are fake movieclips? Can you post a stripped sample?
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
You can't use that ldr variable three times in a row like that. You're resetting it everytime you call the new Loader().
Try ldr1, ldr2, ldr3.
I still don't understand why you're creating 300 empty movieclips. What is the context of all this? There as to be a better way to be going about things. Don't worry, no one is gonna steal your idea.
You can't use that ldr variable three times in a row like that. You're resetting it everytime you call the new Loader().
Try ldr1, ldr2, ldr3.
I still don't understand why you're creating 300 empty movieclips.
I wonder if u checked the attacment,
Yes u can use the loader like that at least in this sample..
and i don't normally use it like that,
And it's working in that example,
but when everything is same, it's not working with the movieclip.
Because, the items which i ll add they all have their own properties.
some has to be added at 60. index. because it has to be in front of items which are lower 60..
and i create 300 emply movieclips because unless u create that indexes. i won't be able to add a mc directly to 15th or 250th index.
You can't use that ldr variable three times in a row like that. You're resetting it everytime you call the new Loader().
Try ldr1, ldr2, ldr3.
I still don't understand why you're creating 300 empty movieclips. What is the context of all this? There as to be a better way to be going about things. Don't worry, no one is gonna steal your idea.
In normal life,
can u wear ur t-shirt over your jacket?
t-shirt is at 60 jacket is at 100th index
can u wear ur t-shirt over your jacket?
t-shirt is at 60 jacket is at 100th index
enough?
Watch your attitude buddy I'm trying to help you here.
Depending on the requirement, I can think of a 100 better ways to go about it. However you're just providing a meaningless piece of code out of a bigger project with no scope as to what you're trying to accomplish.
You could set the index of stuff according to other stuff's index. So for instance, let's say jacket as to be over shirt.
var shirt:Sprite = new Sprite();
var jacket:Sprite = new Sprite();
ldr = new Loader();
ldr.load(new URLRequest("jacket.png"));
jacket.addChild(ldr);
ldr = new Loader();
ldr.load(new URLRequest("shirt.png"));
shirt.addChild(ldr);
You don't wanna load the memory with 300 movieclip instances for no good reason. As well, you're creating additional movieClips on top of those 300 original ones. You're not replacing them when you use the addChildAt method.
Watch your attitude buddy I'm trying to help you here.
Depending on the requirement, I can think of a 100 better ways to go about it. However you're just providing a meaningless piece of code out of a bigger project with no scope as to what you're trying to accomplish.
You could set the index of stuff according to other stuff's index. So for instance, let's say jacket as to be over shirt.
var shirt:Sprite = new Sprite();
var jacket:Sprite = new Sprite();
ldr = new Loader();
ldr.load(new URLRequest("jacket.png"));
jacket.addChild(ldr);
ldr = new Loader();
ldr.load(new URLRequest("shirt.png"));
shirt.addChild(ldr);
You don't wanna load the memory with 300 movieclip instances for no good reason. As well, you're creating additional movieClips on top of those 300 original ones. You're not replacing them when you use the addChildAt method.
I see u re helping me, and i m grateful for your help...
Sorry if i meant something rude...
And i know that i m not replacing them.. i ve passed many things for that project..
but just a newbie flash learners mistake is what i couldn't see, and won't be able to see unless someone shows me..
with that way u made up;
it's not that simple;
u just added the jacket over shirt..
but there won't be shirt, there will be t-shirt and won't be jacket , won't be coat there will be another thing which should be over all of these ,
what i try to mean is when u don't have a jacket but coat,
then you ll have to make tons of if else blog to check if there is next item ..
And all meaningless words that i m using are just because of my none-enough english..