sorry another AS Q :E
- Started
- Last post
- 25 Responses
- Mojo
Sorry guys, I'm stuck again.
i = i + 1;
eaglename = "eagle" + i;
_root.eagle.duplicateMovieClip(e... 1, );In theory this should make dupes with instances of 'eagle2', 'eagle3' etc.
But it appear to just move one MC around - which makes
me think my instance name is the same each time.any help appreciated
- acescence0
they're all assigned to the same depth and are overwriting eachother
- UndoUndo0
for(i=o;i
- acescence0
i++;
_root.eagle.duplica teMovieClip("eagle"+i, i);
- UndoUndo0
_root.eagle.duplica teMovieClip("eagle"+i, getNextHighestDepth() );
- Mojo0
oh right, I must be confusing levels with depth. I'll do some research.
I will try the i loop with depth.
- Mojo0
Thanks for your replies guys! really appreciate it, I used to program in qbasic when I was a kid, so that has somewhat affected how I code!
love you all!
:)
- Mojo0
Works! but after 4 dupes, it starts dropping frames..
so I gotta find a way to have a max amount of dupes on stage, and remove them.. hopefully should be relatively easy
- UndoUndo0
dont call yr duplicating function repeatadly it'll put too much load on the player. use setInterval() to find a happy repeat time
- acescence0
just remember you can't use removeMovieClip on mcs that were assigned depth using getNextHighestDepth... i think
- UndoUndo0
removeMovieClip will work on with movies duplciated with getNextHighestDepth.
myMCname.removeMovieClip();
doesnt need a depth specified
- weestu0
you could also reset the depth to zero after a specified number of clips have been created, that way they would overwrite the existing clips...
- acescence0
i had a little problem before, check this out:
- UndoUndo0
thanks acesence hadn't seen that, or new about that issue
:)
- Mojo0
Awesome thanks guys - but my code:
mouseClick = new Object();
Mouse.addListener(mouseClick);
mouseClick.onMouseDown = function () {
newx2 = _root._xmouse;
newy2 = _root._ymouse;if (i == 3){
i == 1;
}
else {
i++;
}_root.eagle.duplicateMovieClip... + i, getNextHighestDepth(), );
}
doesn't seem to work, any advice would be good! sorry!
- UndoUndo0
if (i == 3){
i = 1;
}
else {
i++;
}== (comparison)
= (assignment)
- Mojo0
oh uh.. i can see the problem with that code.. duh.. i need to do something with the gethighestdepth and i..
- UndoUndo0
you've got too many commas and you should use i incase you get the scenario mentioned above
_root.eagle.duplica teMovieClip("eagle" + i, i );
}
- Mojo0
mouseClick = new Object();
Mouse.addListener(mouseClick);
mouseClick.onMouseDown = function () {
newx2 = _root._xmouse;
newy2 = _root._ymouse;if (i == 3){
i = 1;
_root.eagle.duplicateMovieClip... + i, i, {_x:newx2,_y:newy2});
}
else {
i++;
_root.eagle.duplicateMovieClip... + i, getNextHighestDepth(), {_x:newx2,_y:newy2});
}
}
- Mojo0
_root.eagle.duplicateMovieClip... + i, i, {_x:newx2,_y:newy2});
using i instead of getNextHighestDepth doesn't appear to work..
arg
- UndoUndo0
look at my code dude and the last i
yrs has too many commas
_root.eagle.duplica teMovieClip("eagle" + i, i );
}