Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Remove Duplicate Movie Clips


in my movie iv got duplicate movie clips moving around the stage
you click on them and it adds to a score
when the score hits 10 it goes to next scene but the moives are still
playing in the background how do i get ride of them?




FlashKit > Flash Help > Flash ActionScript
Posted on: 11-10-2002, 06:34 PM


View Complete Forum Thread with Replies

Sponsored Links:

Remove Duplicate Movie Clips
Follwing is the script I have used for duplicating movieclips:

while (coalcount<2) {
_root.coal.duplicateMovieClip("coall"+coalcount, coalcount);
_root["coall"+coalcount]._x = random(550);
_root["coall"+coalcount]._y = random(500);
coalcount += 1;
}

on time-up it goes to the next scene following the script:
onEnterFrame = function () {
now = getTimer()/1000;
txt = countTotal-now;
p = parseInt(txt);
res = p;
if (p == 0) {
gotoAndPlay("scene 2", 1);
}
};

Th problem is I am not being able to remove the duplicate movieclips. I have tried using the script : _root["coall"+coalcount].removeMovieClip but it doesnot work. Help pls!

View Replies !    View Related
Duplicate And Remove Movie Clips Randomly
Hi

I want to make a sparkler button that shows twinkling stars around the button in random positions.

I have made two types of stars (movie clips)

1 - twinkle: this movie clips shows a star appear and disappear with some rotating and alpha channel so the overall effect is like twinkling and revolving star.

2 - same effect star moving on a small curved path.


now I want to use action script for onMouseOver event to duplicate these two movie clips in different X Y positions (very close to each other) with a magical sound. I can do the sound part but not the actionscript part in which i want to duplicate both clips in random positions and then remove them (if that is necessary to free the resources they are occupying) however the stars affect have a fade in and fade out effect so they disappear automatically.

any help is highly appreciated.

thank you.

View Replies !    View Related
How To Remove All Movie Clips/array: Movie Clips Carry Over To Next Frames/ Scenes
Hi: I am creating a small game. So far so good, but only problem I have come across is when I jump to another frame or scene, previous movieclips (using an array) that are still running carry over to the next frame/scene.

See attached if you have some time- start clicking on answers in the game, and when time runs out some movie clips that are still running will remain on top of my end frame and carry over to the next scene as well.

Is there any sort of remove all movie clips or "clear all" type of actionscript?

thanks in advance!

View Replies !    View Related
Duplicate And Remove Movie Clip
I am creating an effect for my website that has a button which, when pressed, duplicates a movieclip. This works fine, but I can't seem to get another button to remove the movieclips that have just been created.

Here is the code I a using:

add new mc's button:

on (release) {
_root.target.Count = _root.target.Count+1;
if (_root.target.Count<50) {
duplicateMovieClip(_root.target.bugs, "bugs"+_root.target.Count, _root.target.Count);
}

delete mc's button:

on (release) {
_root.target.Count = _root.target.Count-1;
removeMovieClip ("bugs"+_root.target.Count);
}

Why does this not work? I have tried loads of slight adjustments to the code and the remove mc action never works. Am I referencing the file wrong?

Any help would be most appreciated.
Thanks,
Shaka

View Replies !    View Related
Can't Remove Duplicate Movie Clip
when I creat a MC and have it duplicate itself over and over repeatedly. (example: to create a vortex effect)
I can't make it go away using "remove movie clip" as I would expect.....

How does one make the duplicate movies go away....

thanks

View Replies !    View Related
Duplicate = Remove Movie Clip
i have a problem that i cant seem to figure out. whenever i duplicate a movie clip, and then i duplicate a different movie clip, the first one dissappears. like, if i have a flower, and i duplicate that. then, when i duplicate a square, the flower goes away.
here is a code for my "ship"

onClipEvent (load) {
sheight = getProperty(this, _height);
swidth = getProperty(this, _width);
speed = 5;
top_border = 1;
bottom_border = 399-(sheight);
left_border = 1;
right_border = 599-(swidth);
i = 1;
b = 1;
l = 1;
e = 1;
maxenemy = 4;
_root.bombfire = false;
}
onClipEvent (keyDown) {
if (Key.isDown(Key.SHIFT)) {
_root.enemy.duplicateMovieClip("enemy"+e, e);
_root["enemy"+e]._x = _root.ship._x + swidth;
_root["enemy"+e]._y = _root.ship._y + sheight;
e++;
}

if (Key.isDown(88)) {
_root.laser.duplicateMovieClip("laser"+l, l);
_root["laser"+l]._x = _root.ship._x + swidth;
_root["laser"+l]._y = _root.ship._y + sheight;
l++;
}
if (Key.isDown(90)) {
if (_root.bombfire == false) {
_root.bomb.duplicateMovieClip("bomb"+b, b);
_root["bomb"+b]._x = _root.ship._x + swidth;
_root["bomb"+b]._y = _root.ship._y + sheight;
_root.bombfire = true;
} else {
_root["bomb"+b].gotoAndStop(2);
b++;
}
}
}

i cant figure out what' going on.
i have attached my fla.
press shift to duplicate the "enemy", then press the space bar to shoot a bullet, then the enemy just dissappears.
thank you all very much.

View Replies !    View Related
Remove Duplicate Movie Problem
ok i have a dot on stage named "dot".

on the "dot" clip i have this.....

onClipEvent (load) {
if (this._name != "dot") {
this._x = Math.random()*1280;
this._y = Math.random()*768;
deedee = Math.random()*100;
this._xscale = deedee;
this._yscale = deedee;
}
}

on a blank clip named "actions" i have this ....

onClipEvent (enterFrame) {
var amount = 100;
for (i=0; i<amount; i++) {
_root.dot.duplicateMovieClip("dot"+i);
}
}


then later on i try to delete all instance of "dot" but there is always one left!!!!!

I tried this ........

onClipEvent (enterFrame) {
var amount = 100;
for (i=0; i<amount; i++) {
_root.dot["dot"+i].removeMovieClip;
}
}

or

onClipEvent (enterFrame) {
var amount = 100;
for (i=0; i<amount; i++) {
_root.dot["dot"+i]._alpha=0;
}
}

anyone??

View Replies !    View Related
Remove Dyn Dup Movie Clips All At Once
Ive created a button that on each press duplicates a movieclip called "cir".

I now want to create a button that clears all the dup mc at once.
Ive tried to do the same code witht he removeMovieClip but it only removes the dups one at a time

//to duplicate movie clip
on (press) {
i = i+1;
duplicateMovieClip ("cir", "cir"+i, i);
_root["cir"+i]._x += 100;
_root["cir"+i]._y += 0;
}

any ideas on where to get started

thanks
Dave

View Replies !    View Related
Remove ALL Movie Clips
hi, i was wondering if there was a way to remove ALL movie clips current on the stage. I attached all the movie clips using attachMovie, and i was wondering if there was a way to just remove them all or is attaching them into an empty movie clip and removing that movie clip the only way?

-thnx

View Replies !    View Related
Possible To Remove All Movie Clips?
I'm currently working on a project and I can't find any code that allows you to remove all movie clips that are on the stage at once. Does anyone know how to do this?

View Replies !    View Related
Cannot Remove Movie Clips
Hi!... I'm creating a game and am having issues removing a movie clips.

I currently have:

Code:
_root.attachMovie('slider', 'slider_mc', -1);
and I'm trying to remove it when the timer goes to "0"... like so:


Code:
var seconds = 10;
var miliseconds = 10;
function tellTime() {
if (miliseconds<10) {
time_txt.text = seconds+":"+"0"+miliseconds;
} else {
time_txt.text = seconds+":"+miliseconds;
}
miliseconds--;
if (miliseconds<0) {
miliseconds = 10;
seconds--;
}
if (seconds<0) {
clearInterval(id);
time_txt.text = "Game Over";
MovieClip.removeMovieClip("slider_mc");
}

}
id = setInterval(tellTime, 100);
I've tried so many variations... including:

- MovieClip.removeMovieClip("slider_mc");
- removeMovieClip("slider_mc");
- removeMovieClip('slider_mc');
- slider_mc.removeMovieclip();

but I am new to coding. Please help!

View Replies !    View Related
Remove Movie Clips
I am using Kirupa's random motion tutorial for creating 7 movie clips.

ActionScript Code:
i = 0;while (i <= 7) {    hydro.duplicateMovieClip("hydro"+i, i);    i++;}

I have a variable called "alter." If it is a positive number, it will add that number of movie clips. If it is negative, it will remove that many number of movie clips. So how do I modify the current code to do this?

View Replies !    View Related
Remove Movie Clips
lo all.. can anybody help with this.
its a friend of mine, he has a webcam, he wants to laod images in flash then remove a particular image, code so far:

counter = 2;

function update() {
newmovie = "JPG"+counter++;
duplicateMovieClip("JPG", newmovie, counter);
loadMovie(camurl, newmovie, "GET");
// NEED CODE HERE TO DELETE MOVIE CLIPS AFTER 5 MORE HAVE BEEN CREATED
}

as you can see he wants to remove mc's after 5 have been created. any ideas?

thnx in advance.

kev.

View Replies !    View Related
Remove Movie Clips
I have a flash movie. This is the code that goes with this flash movie:


Code:
//----------------PLACE SUBNAV FUNCTION
initiateSubNav = function() {
_root.subNavSelect_mc._x = 120;
_root.subNavSelect_mc._y = 45;
}



//------------A BUTTONS
aButtons = function() {

initiateSubNav();
subNavY = header_mc._height + padding - 3;

var btn0 = ["four_mc", "http://"];
var btn1 = ["seven_mc", "http://"];
var btn2 = ["eight_mc", "http://"];
var btn3 = ["eleven_mc", "http://"];
var btn4 = ["fifteen_mc", "http://"];
var btn5 = ["sixteen_mc", "http://"];


_root.attachMovie(btn0[0], btn0[0], 50);
this[btn0[0]]._x = 120;
this[btn0[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn1[0], btn1[0], 51);
this[btn1[0]]._x = 120;
this[btn1[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn2[0], btn2[0], 52);
this[btn2[0]]._x = 120;
this[btn2[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn3[0], btn3[0], 53);
this[btn3[0]]._x = 120;
this[btn3[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn4[0], btn4[0], 54);
this[btn4[0]]._x = 120;
this[btn4[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn5[0], btn5[0], 55);
this[btn5[0]]._x = 120;
this[btn5[0]]._y = subNavY;
subNavY += 23;
}





//------------B BUTTONS
bButtons = function() {

initiateSubNav();
subNavY = header_mc._height + padding - 3;

var btn0 = ["one_mc", "http://"];
var btn1 = ["two_mc", "http://"];
var btn2 = ["three_mc", "http://"];
var btn3 = ["four_mc", "http://"];
var btn4 = ["six_mc", "http://"];
var btn5 = ["eight_mc", "http://"];
var btn6 = ["ten_mc", "http://"];
var btn7 = ["thirteen_mc", "http://"];
var btn8 = ["seventeen_mc", "http://"];
var btn9 = ["eighteen_mc", "http://"];
var btn10 = ["twentyone_mc", "http://"];
var btn11 = ["twentytwo_mc", "http://"];


_root.attachMovie(btn0[0], btn0[0], 50);
this[btn0[0]]._x = 120;
this[btn0[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn1[0], btn1[0], 51);
this[btn1[0]]._x = 120;
this[btn1[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn2[0], btn2[0], 52);
this[btn2[0]]._x = 120;
this[btn2[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn3[0], btn3[0], 53);
this[btn3[0]]._x = 120;
this[btn3[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn4[0], btn4[0], 54);
this[btn4[0]]._x = 120;
this[btn4[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn5[0], btn5[0], 55);
this[btn5[0]]._x = 120;
this[btn5[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn6[0], btn6[0], 56);
this[btn6[0]]._x = 120;
this[btn6[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn7[0], btn7[0], 57);
this[btn7[0]]._x = 120;
this[btn7[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn8[0], btn8[0], 58);
this[btn8[0]]._x = 120;
this[btn8[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn9[0], btn9[0], 59);
this[btn9[0]]._x = 120;
this[btn9[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn10[0], btn10[0], 60);
this[btn10[0]]._x = 120;
this[btn10[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn11[0], btn11[0], 61);
this[btn11[0]]._x = 120;
this[btn11[0]]._y = subNavY;
subNavY += 23;
}





//------------C BUTTONS
cButtons = function() {

initiateSubNav();
subNavY = header_mc._height + padding - 3;

var btn0 = ["one_mc", "http://"];
var btn1 = ["two_mc", "http://"];
var btn2 = ["three_mc", "http://"];
var btn3 = ["seven_mc", "http://"];
var btn4 = ["nine_mc", "http://"];
var btn5 = ["twelve_mc", "http://"];
var btn6 = ["fourteen_mc", "http://"];


_root.attachMovie(btn0[0], btn0[0], 50);
this[btn0[0]]._x = 120;
this[btn0[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn1[0], btn1[0], 51);
this[btn1[0]]._x = 120;
this[btn1[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn2[0], btn2[0], 52);
this[btn2[0]]._x = 120;
this[btn2[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn3[0], btn3[0], 53);
this[btn3[0]]._x = 120;
this[btn3[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn4[0], btn4[0], 54);
this[btn4[0]]._x = 120;
this[btn4[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn5[0], btn5[0], 55);
this[btn5[0]]._x = 120;
this[btn5[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn6[0], btn6[0], 56);
this[btn6[0]]._x = 120;
this[btn6[0]]._y = subNavY;
subNavY += 23;
}



//------------D BUTTONS
dButtons = function() {

initiateSubNav();
subNavY = header_mc._height + padding - 3;

var btn0 = ["one_mc", "http://"];
var btn1 = ["five_mc", "http://"];
var btn2 = ["nine_mc", "http://"];
var btn3 = ["ten_mc", "http://"];
var btn4 = ["seventeen_mc", "http://"];
var btn5 = ["eighteen_mc", "http://"];
var btn6 = ["nineteen_mc", "http://"];
var btn7 = ["twentyone_mc", "http://"];
var btn8 = ["twentyfive_mc", ""];

_root.attachMovie(btn0[0], btn0[0], 50);
this[btn0[0]]._x = 120;
this[btn0[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn1[0], btn1[0], 51);
this[btn1[0]]._x = 120;
this[btn1[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn2[0], btn2[0], 52);
this[btn2[0]]._x = 120;
this[btn2[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn3[0], btn3[0], 53);
this[btn3[0]]._x = 120;
this[btn3[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn4[0], btn4[0], 54);
this[btn4[0]]._x = 120;
this[btn4[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn5[0], btn5[0], 55);
this[btn5[0]]._x = 120;
this[btn5[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn6[0], btn6[0], 56);
this[btn6[0]]._x = 120;
this[btn6[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn7[0], btn7[0], 57);
this[btn7[0]]._x = 120;
this[btn7[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn8[0], btn8[0], 58);
this[btn8[0]]._x = 120;
this[btn8[0]]._y = subNavY;
subNavY += 23;
}

//------------E BUTTONS
eButtons = function() {

initiateSubNav();
subNavY = header_mc._height + padding - 3;

var btn0 = ["five_mc", "http://"];
var btn1 = ["eight_mc", "http://"];
var btn2 = ["twelve_mc", "http://"];
var btn3 = ["thirteen_mc", "http://"];
var btn4 = ["fourteen_mc", "http://"];
var btn5 = ["twentyone_mc", "http://"];

_root.attachMovie(btn0[0], btn0[0], 50);
this[btn0[0]]._x = 120;
this[btn0[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn1[0], btn1[0], 51);
this[btn1[0]]._x = 120;
this[btn1[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn2[0], btn2[0], 52);
this[btn2[0]]._x = 120;
this[btn2[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn3[0], btn3[0], 53);
this[btn3[0]]._x = 120;
this[btn3[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn4[0], btn4[0], 54);
this[btn4[0]]._x = 120;
this[btn4[0]]._y = subNavY;
subNavY += 23;

_root.attachMovie(btn5[0], btn5[0], 55);
this[btn5[0]]._x = 120;
this[btn5[0]]._y = subNavY;
subNavY += 23;
}

//----------------MASTER BUTTONS
kickNav = function() {

var b0 = ["buttonA_mc", "http://"];
var b1 = ["buttonB_mc", "http://"];
var b2 = ["buttonC_mc", "http://"];
var b3 = ["buttonD_mc", "http://"];
var b4 = ["buttonE_mc", "http://"];

NavY = header_mc._height + padding - 3;

_root.attachMovie(b0[0], b0[0], 10);
this[b0[0]]._x = 5;
this[b0[0]]._y = NavY;
NavY += 46;
this[b0[0]].onRelease = function() {
aButtons();
}

_root.attachMovie(b1[0], b1[0], 11);
this[b1[0]]._x = 5;
this[b1[0]]._y = NavY;
NavY += 46;
this[b1[0]].onRelease = function() {
bButtons();
}

_root.attachMovie(b2[0], b2[0], 12);
this[b2[0]]._x = 5;
this[b2[0]]._y = NavY;
NavY += 46;
this[b2[0]].onRelease = function() {
cButtons();
}

_root.attachMovie(b3[0], b3[0], 13);
this[b3[0]]._x = 5;
this[b3[0]]._y = NavY;
NavY += 46;
this[b3[0]].onRelease = function() {
dButtons();
}

_root.attachMovie(b4[0], b4[0], 14);
this[b4[0]]._x = 5;
this[b4[0]]._y = NavY;
NavY += 46;
this[b4[0]].onRelease = function() {
eButtons();
}
}

//Build Background Clip
buildBackground = function () {
createEmptyMovieClip("background_mc", "background_mc", 0);
background_mc._x = 0;
background_mc._y = 0;
background_mc.lineStyle(1, 0x000000, 0);
background_mc.beginFill(backgroundColor, 100);
background_mc.lineTo(Stage.width, 0);
background_mc.lineTo(Stage.width, Stage.height);
background_mc.lineTo(0, Stage.height);
background_mc.lineTo(0, 0);
background_mc.endFill();
};

/*----- INITIATE ------*/
backgroundColor = 0x777777;
kickNav();

View Replies !    View Related
Is It Ok To Duplicate Movie Clips Inside Movie Clips?
is it ok to duplicate movie clips inside movie clips? Seems to be a problem here...

View Replies !    View Related
On Press, Remove ALL Movie Clips
Am looking for code that would ON Press,
remove all movie clips currently playing on the stage!


(I have 4 that all close from wothin, but I want the previous to close when another starts !)

View Replies !    View Related
How Can I Remove All Child Movie Clips?
Hi guys.. I tried to search but the search doesnt seem to be working for me at the moment so guess i gotta make another pointless thread.

What I want to do is remove all child movies of a chosen movie. How can I do this?

thanks
-Geoff

edit: btw, i'm using Flash MX. (not 2004)

View Replies !    View Related
Remove Movie Clips (AxnScpt)
How can I remove a movie clip dynamically? I need to use a global variable since different movie clips must be deleted at runtime. I'm using FLASH 8.

View Replies !    View Related
Duplicate Movie Clips
Right, this is for a project I have devised ago, and only now have I got round to working out how to achive it. It is like this.

I am creating a "Ransom Note Generator", as a joke, whereby people come along, create a message, save it or send it to someone else, anonymously. I'm not worried abnout the back-end just yet...it's the flash part that I am working on.

To create the note, there is a list of letters in the alphabet (1-26) and when pressed they will duplicate a movie clip with that letter in it. The user then drags these letters together to form a word. Follow me?

In basic terms, how could I have, say to create the letter A a button which when clicked duplicates a hidden movie clip somewhere onto the screen, which has the letter A in it? I can do dragging etc, but it's the actual duplication that stumps me.

I know I should know how to do this...it's fairly basic stuff!!

Thanks,
Nick

View Replies !    View Related
Duplicate Movie Clips?
Two Questions:
1. How do u duplicate a movie clip into another movie clip?

2. I have a dynamic textbox on the duplicated movie clip. Is there any way to set its variable within the code?

All answeres appreciated.
Zoo-man

View Replies !    View Related
Duplicate Movie Clips
hi,

i have created a tool bar which allows a user to duplicate certain movie clips, which in turn can be dragged around the screen.

However, i can only make it work when there is alredy a version of the movie clip visible on the screen.

How can i make it so that the movie clip only appears when the relevant button is pressed, and can then be duplicated?

View Replies !    View Related
Duplicate Movie Clips?
how do i duplicate movie clips after say,i press on a button.,and each time i duplicate a movie clip it appears randomly and moves around randomly? Can any 1 help me?

lets say the movie clip is a bee which i want to duplicate and make it move around randomly...and it only duplicates when i press a button for eg.

Thanks in advanced!

Blue Dragon

View Replies !    View Related
Duplicate 2 Different Movie-clips During While
am trying to duplicate two different movie clips (dynamic text boxes) in a "while" loop the values of the dynamic text variables come from an array, and i being the length of the first array.

It works for the first mc but not the 2nd which just returns 0

why?????????

View Replies !    View Related
Duplicate Movie Clips
I have a movie clip, which is a blue square, and inside the MC, I turned the blue square into a button. Then,I duplicated the MC in the library, and I changed a text written on the button in each duplicated MC.
Every change I made in the MCs changed the others.
Why does it happen, and how can I make the duplicated MCs independent?

thanks,

Berry

View Replies !    View Related
Can't Duplicate Movie Clips
Can you duplicate a movie clip, and within each duplicated movie clip, duplicate another movie clip?

example:

_root.buttons.buttons.duplicateMovieClip("newbutto n", 1);

_root.buttons["newbutton"].button.duplicateMovieClip("newbutton", 3);

I tried it, can't seem to get it right. any help would be appreciated.

- jeremy

View Replies !    View Related
Duplicate Movie Clips....
I'm making a game here, and the main guy is called Jay. When the 'x' button is pressed, the shot1 mc will be duplicated as so...


Code:
if (_root.jay1._visible == true) {
shotNum++;
_root.shot1.duplicateMovieClip("shot1"+shotNum, shotNum);
_root["shot1"+shotNum]._x = _root.jay1._x;
_root["shot1"+shotNum]._y = _root.jay1._y+30;
_root["shot1"+shotNum]._x += 30;
}


BUT....The duplicates won't respond to a hitTest function...(shot1 is the mc that all the duplicates derive from)


Code:
onClipEvent (enterFrame) {
//The line following line is wrong...
if (_root.square, hitTest(_root.shot1)) {
trace("ow");
}
}


How will the square be activated when it's hit by the duplicates?? Thanks for your help!

View Replies !    View Related
Get Rid Of Duplicate Movie Clips
movie called "winter'

instance called "snow"

around 50 duplicates.

How do you get rid of whole lot at one time

ie on pressing a button or entering a frame?



Many thanks

View Replies !    View Related
How To.. Duplicate Movie Clips
I have a simple shape tween in a movie clip.

Once its over, I want one just like it to appear 20px underneath.
But I want it done trough auctionscript.

So far, I came up with this, but I know it's not right:

var x = 4.7;
var y = 4.7;
var inc = 20;
for(i=0;i<5;++i){
if((_root.button[i]._currentframe)==20){
_root.button[i].stop();
duplicateMovieClip("button" + i, "button" + [i++], i);
_root.["button"+i]._x = x;
_root.["button"+i]._y = y + inc;
inc = inc + 20;
}
}

^ in the root frame

View Replies !    View Related
Duplicate Movie Clips
The eternal snow question...
I have one MC of snow, i want to duplicate it along the y axis at random locations. I want the duplication to not excede a certain amount of MC's and also to generate every half second or so. Anyone have any ideas?

Thanks in advance

View Replies !    View Related
Duplicate Movie Clips
Very simple...how do i get this code (function) to stop?

code:
var nNum = 1;
function mMove() {
nNum++;
mcSnow.duplicateMovieClip("mcSnow"+nNum, nNum);
_root["mcSnow"+nNum]._x = random(Stage.width);
}
setInterval(mMove, 2500);

View Replies !    View Related
Duplicate Movie Clips
This should be easy but I cannot figure it out.

I have created a button that dupe a mc and positions on the stage. I want to be able to dupe that same clip again so I can have multiple copies on the stage to drag around. I understand I have to change the level or depth each time I click the button. How can I do this?
code is:

duplicateButton_btn.onRelease = function() {
duplicateMovieClip(nerd_mc, "nerdCopy_mc", 1);
with (nerdCopy_mc) {
_x = 60;
_y = 220;

}
};

View Replies !    View Related
[f8] Max Duplicate Movie Clips?
Hello all,
Is it possible, by using the duplicateMovieClip method, to actually duplicate one form of movie clip in place of another? Regardless of how it's been scaled? What I am planning on doing is having some say red bubbles, and blue bubbles for instance. What I want to do is increase the blue bubbles which will in turn make the red bubbles disappear. A bit like survival of the fittest! Would this involve some sort of maxMovieClip command (if it exists?)
Regards
Adover

View Replies !    View Related
[MX] Duplicate Movie Clips
I made an ant squashing game where the ant moves left or right and gets squashed by a foot. But when I copy and paste the ant to make copies, they don't move or get squashed, only the original ant works fine. This happens with all my duplicates of anything.

View Replies !    View Related
Duplicate Movie Clips
Hello, I created a rating slider for one of my sites. It uses 4 layers that contain movie clips, masks and some actionscript. Now I need to duplicate all of this 5 times. I tried to select all the objects and create a movie and then duplicate it.. but it screws up.

Is there a way to properly group all these objects and duplicate them ?

Thank you for your time,
Armin

View Replies !    View Related
Help With Duplicate Movie Clips
Howdy. I have just completed this tutorial : http://www.kirupa.com/developer/mx/snow2.htm and I have the snow reversed to go up instead of down (in my case they are balloons) I was wondering, I have the event on say frame 6 of my flash file) but when I jump to the next scene (yes I used scenes I know deprecation issues) the duplicate movie clips keep going. I have tried

removeMovieClip("snow");

in the actions layer on the main timeline, but the (in my case) balloons just keep rising. How do I remove the duplicated movie clips created using this code:

for (k=0; k<7; k++) {
duplicateMovieClip(this.snow, "snow"+k, k);
}

Earlier in the timeline.
Sorry if this is a basic question but I am tearing y hair out here..I am a bit of a dunce when it comes to invoking AS on timeline frames.
Basically the balloons form part of a preloading sequence I want to end when time has passed or a user presses a skip button. The premise is that the skip button and the timer (built into another movieclip) take the flash file to a frame, which attempts to unload all copies of that movieclip.

Thanks

Roosterboy

View Replies !    View Related
Duplicate Movie Clips
I would like tohave duplicate movie clips appear automatically when an animation loads. I'd gone through the duplicate movie clips tutorial, but it just could not work. Do I need to add more in the Frame besides


Code:
amount = 50;
while(amount>0) {
duplicateMovieClip (target, new mc name, mc depth);
i = i + 1;
amount = amount-1;
}
?

By the way, I'm using flash mx. Please help, thanks.

View Replies !    View Related
Duplicate Movie Clips & XML
I guess this might seem like a simple question, but I've scrambled my brain trying to figure it out, how do i get the it to create a new row after every 5th movieclip :S, so it would create a grid of movie clips, 5 colums, the rows dependant on how many entries in the XML file.




Code:
fscommand("allowscale", "false");
function load_xml(success)
{
if (xmlStuff.loaded)
{
listcount = xmlStuff.childNodes;
InjectData();
AddNumber();
} // end if
} // End of the function
function AddNumber()
{
itemMax = xinfo.length - 1;
itemCounter = 0;
_root.itemThumb = xicon[0];
for (i = 0; i <= itemMax; i++)
{
mload.attachMovie("tabItem", "tabItem" + i, i);
mload["tabItem" + i]._x = 46 * i;
mload["tabItem" + i].itemName = xname[i];
mload["tabItem" + i].itemThumb = xicon[i];
mload["tabItem" + i].itemDesc = xinfo[i];
mload["tabItem" + i].itemLink = xlink[i];
if (i < 9)
{
mload["tabItem" + i].itemNum = "0" + (i + 1);
continue;
} // end if
mload["tabItem" + i].itemNum = i + 1;


} // end of for
} // End of the function
function InjectData()
{
xname = new Array();
xinfo = new Array();
xicon = new Array();
xlink = new Array();
for (k = 0; k <= listcount.length; k++)
{
if (listcount[k].nodename == "item")
{
xname.push(listcount[k].attributes.name.toString());
xicon.push(listcount[k].attributes.icon.toString());
xinfo.push(listcount[k].attributes.info.toString());
xlink.push(listcount[k].attributes.link.toString());
} // end if
} // end of for
} // End of the function
xmlFile = "menu_images.xml";
xmlStuff = new XML();
listcount = new Array();
xmlStuff.load(xmlFile);
xmlStuff.onload = load_xml;

my XML file below, simplified.


HTML Code:
<item
name="Kat"
icon="kat.jpg" ></item>

<item
name="Beauty"
icon="beauty.jpg" ></item>

<item
name="buggy"
icon="hibuggy.jpg" ></item>

<item
name="Issy"
icon="issy.jpg" ></item>

<item
name="file"
icon="file1.jpg" ></item>


Thanks my friends!

View Replies !    View Related
Duplicate Movie Clips
I want to make copies of a movie clip when the user clicks I imagine that this is very simlpe but I just dont know what the script would be for it

any help would be appreciated!!

View Replies !    View Related
Help With Duplicate Movie Clips
Howdy. I have just completed this tutorial : http://www.kirupa.com/developer/mx/snow2.htm and I have the snow reversed to go up instead of down (in my case they are balloons) I was wondering, I have the event on say frame 6 of my flash file) but when I jump to the next scene (yes I used scenes I know deprecation issues) the duplicate movie clips keep going. I have tried

removeMovieClip("snow");

in the actions layer on the main timeline, but the (in my case) balloons just keep rising. How do I remove the duplicated movie clips created using this code:

for (k=0; k<7; k++) {
duplicateMovieClip(this.snow, "snow"+k, k);
}

Earlier in the timeline.
Sorry if this is a basic question but I am tearing y hair out here..I am a bit of a dunce when it comes to invoking AS on timeline frames.
Basically the balloons form part of a preloading sequence I want to end when time has passed or a user presses a skip button. The premise is that the skip button and the timer (built into another movieclip) take the flash file to a frame, which attempts to unload all copies of that movieclip.

Thanks

Roosterboy

View Replies !    View Related
Duplicate Movie Clips
I would like to have a movie clip located on level 2 to be duplicated on level 1. Is it possible to do that using the duplicte movie clip action? If not, is there any other way to do this? If yes, what would the exact syntax look like?

Thank you for your help.

View Replies !    View Related
Remove Movie Clips From _root Dynamically
Hi Pals

I have attached the movie clips dynamically to the stage.

I have created a movie clip with name "textClip" and the linkage name as "textClip". I dragged that mc to the stage. I am having an XML file where the contents are stored. If I have the textcontent in the xml file I am attaching this mc with the new instance.

In the mc, I have placed one textbox to hold the contents. named "contentText"

See the code below for attaching the movie clip

itemText = _root.attachMovie("textClip", "textClip"+x, x);
itemText.contentText.html = true;
itemText.contentText.htmlText = strPageContents;

The problem is I need to remove this mc once another page is loaded. If I am having 4 contents in the page 1 and 2 contents in page 2, while clicking the page 1 I can see all the 4 contents but when I click the page 2, I am able to see the 2 contents from page 2 and remaining 2 contents from page 1.

The problem is likely to be in the depth i am using. I tried a lot but not able to sort this down.

Any guidance will be greatly appreciated.

Thanks
Babu Raju

View Replies !    View Related
Assigning Functions For Movie Clips Generated Through Duplicate Movie Clip Loop
I want to write different RollOver events for movie clips. These movie clips are generated by a for loop(duplicateMovieClip). My idea is to have a code like

clip_mc+i.onRollOver = function()
{
clip_mc+i.gotoAndPlay(2);
}

View Replies !    View Related
Duplicate Movie Clips Not Showing Up...?
Hey folks,

I've having a brutal time with the duplicateMovieClip function, hopefully someone will know what I'm doing wrong. Basically, I'm trying to duplicate a movie clip X number of times, once I've done that, I can set properties on the new movie clips, and the values will be held in the new clips when I do a trace. The BIG problem... the new movie clips are not visible and I can't figure out why! Here's my code:

j = 0;
for (i=0; i < ANSWERS.length; i++) {
// duplicate the original movie clip
duplicateMovieClip (root_answer, "answer_box"+i, j++);
setProperty ("answer_box"+i, _x, 400);
setProperty ("answer_box"+i, _y, (i*100)+200);
set("answer_box"+i+".anstext", ANSWERS[i]);
trace(i+"- X: "+getProperty("answer_box"+i, _x)+" Y: "+getProperty("answer_box"+i, _y));
}

... the trace at the bottom of the loop proves that the values are being set into the new clips, but still nothing is visible on the screen. Any ideas?

Cheers,
Anthony

View Replies !    View Related
Unload Duplicate Movie Clips?
Hi,
I've made a load of duplicate movie clips, but when I click on a button I want these duplicates to unload/delete.
How do I do this?
Thanks.

View Replies !    View Related
Hiding Duplicate Movie Clips
hello!
i am having trouble hiding duplicate movie clips.
the script hides the original symbols and replaces them with duplicate clips. i want to transition from the frame with the duplicate clips by having the clips slide away. i faked this by creating a different mc with the art sliding away, however i cannot get the duplicated clips to go away and therefore stay on the screen until the next movie loads. and being that the clips are not in the timeline i cannot simply tween them.

i hope this is clear! thanks for any help.

View Replies !    View Related
Duplicate Movie Clips And The Buttons They Contain
I have a script that duplicates a movie clip 8 times.
I n this movie clip there is a button. pon pressing the button I want tot tell the movie clip that contains the button to move to frame 2. sounds simple...
i have tried
on(press){
_parent.gotoAndStop(2);
}

but it dosen't seem to work
also tried

on(press){
_parent.iveBeenClicked = 1;
}

and then looked for the iveBeenClicked var in the AS on the movie clip but it dosen't see it.

I am assuming that I cn send a var to just one instance of the duplicated clip and not all, is that an incorrect assumption?

thanks for the help in advance
-nathan

View Replies !    View Related
How Do I Duplicate Movie Clips With Actionscripting?
I named the original movie clip, named the new movie clip but what do I put in depth? I thought it meant its co-ordinates but apparently it isn't because I'm only supposed to put one number.

Can anybody tell me how to specifically use it (examples would be appreciated).

Also, how do I target a movie clip created through action scripting if there are multiplte ones.

View Replies !    View Related
Positioning Duplicate Movie Clips
Hello. I have a movie clip (horiz_line) which I would like to duplicate 10 times, each resulting movie clip 25 pixels to the right and 5% smaller than the last. This is what I have so far, how do I set the properties? (If it isn't obvious, I've nicked this code from the Flash tutorial- originally the setProperty (s) were "random", which worked...)


amount = 10;
while (amount>0) {
duplicateMovieClip (_root.horiz_line, "mc"+i, i);
setProperty ("mc"+i, _y, ?????????);
setProperty ("mc"+i, _yscale, ?????????);
i++;
amount--;
}

Thank you in advance for your time and consideration.
Adam

View Replies !    View Related
Hit Detection Of Duplicate Movie Clips
Hello all, I am new here and I posted this question on the general flash help and then I found this forum--so I will try reposting here to see if any of you flash experts can help me out. I am using Flash 4 to make games and was wondering if there is another way of doing hit detection for games when you are dealing with 2 different sets of duplicate movie clips (i.e. duplicate bullets detecting duplicate enemies) right now I limit one of the duplicates(i.e. only 5 enemies at once) and every bullet detects if it is hitting each individual clip. Unfortuneately, -ofcourse-- when you have too many clips, the speed of the game gets very slow. I was hoping there was a way to have the bullets hit detection detect any movie clip that started with a common name (clip1, clip2, clip3) so instead of writing hit detection code for ech individual clip, you could right one line that would check if the bullet is hitting any duplicates of a particular clip.
Thanks
Jeff

View Replies !    View Related
Creating Duplicate Movie Clips
my code works to create teh clips becuase when i debug the movie i see the duplicates created in the debug window.

The problem is i dunno the _x and _y position relative to the stage.

fla is attached, have a look and lemme know what ive done wrong.

Tks

View Replies !    View Related
Limit On Duplicate Movie Clips?
I was wondering if there was a limit
on the duplication of mc's. I'm pulling
a dynamic list, and in some cases the
entries may be over 3 or 4 thousand.

If there is a limit, is there a way
around it, or do i have to upgrade
to a more robust app like director?

just checking because i'm going to have
to answer these questions in the next
couple of day.


Thanks everyone,
leon:.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved