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








Remove A Duplicated MovieClip


Code:
on (release) {
name of mc0, mc1, etc
target.duplicateMovieClip("target"+depth, depth);
this._parent["target"+depth]._x = random(400);
this._parent["target"+depth]._y = random(234);
depth++;
}
How do i remove all the duplicate MovieClip when i enter a next frame?




FlashKit > Flash Help > Flash ActionScript
Posted on: 09-04-2005, 05:37 PM


View Complete Forum Thread with Replies

Sponsored Links:

Remove Duplicated Mc`s
Hi all
I have two mc`s 1 is main circle and other is small circle
the small circle gets 25 times duplicated.
coden frame 1
max = 25;
for (i=0; i<=max; i++) {
duplicateMovieClip ("follow", "follow" + i, i);
}

instance
main circle=lead
small circle=follow

everything is placed on frame 1....the animation happens while preloading....after it has finished loading, it jumps to frame three.....(at this time I want both mc to remove from the stage)
the code on small circle:
onClipEvent (load) {
this._x = random(700) + 25;
this._y = random(325) + 25;
speed = random(10) + 10;
diff = 100;
}
onClipEvent (enterFrame) {
rand = random(20);
if (rand == 1) {
overshootx = random(diff) - diff/2;
}
if (rand == 2) {
overshooty = random(diff) - diff/2;
}
// chase
target_x = _root.lead._x + overshootx;
target_y = _root.lead._y + overshooty;
this_x = GetProperty(/:this,_x);
this_y = GetProperty(/:this,_y);
distance_x = target_x - this_x;
distance_y = target_y - this_y;
setProperty (/:this, _x, this_x + (distance_x/speed));
setProperty (/:this, _y, this_y + (distance_y/speed));
// rotate
theta = Math.atan(distance_y/distance_x) * (180/Math.PI);
if (distance_x > 0) {
theta = theta + 90;
}
if (distance_x < 0) {
theta = theta - 90;
}
setProperty (/:this, _rotation, theta);
}

thanks all for the reply
PilotX
[Edited by PilotX on 03-01-2002 at 05:50 AM]

View Replies !    View Related
How Do I Remove All Duplicated MCs?
Hi all

Got myself a wee flash intro (yeah whatever) which uses an AS loop to duplicate an animation MC several times, then remove all the duplicates one by one. Fine.

I have a "Skip Intro" button which I need, when clicked, to remove all the duplicated MCs at once. How do I do that then?

Many, many thanks

beauchamp

View Replies !    View Related
How Do I Remove All Duplicated MCs?
Hi all

Got myself a wee flash intro (yeah whatever) which uses an AS loop to duplicate an animation MC several times, then remove all the duplicates one by one. Fine.

I have a "Skip Intro" button which I need, when clicked, to remove all the duplicated MCs at once. How do I do that then?

Many, many thanks

beauchamp

View Replies !    View Related
How Can I Remove A Duplicated Mc?
Hey guys.

Sorry for posting something that probably already exists in the deeps of the forum, but the situation requires urgency, so here it is:

HOW CAN I F***ING REMOVE A MOVIE CLIP THAT WAS DUPLICATED FROM ANOTHER?

Goddamn, i already used removeMovieClip() and unloadMovie(), none worked.

The duplicated movie is instanced as "objecto". I already tried:

objecto.removeMovieClip();
removeMovieClip(objecto);
removeMovieClip("objecto");

objecto.unloadMovie();
unloadMovie(objecto);
unloadMovie("objecto");

Nothing works! It may be something REALLY stupid, but I cannot figure it!

View Replies !    View Related
How Do I Remove Duplicated Movieclips
Here's the problem.

I have a 2 frame movie. The first is a welcome type of page. The second has a feature where the user can duplicate a variety of different movie clips and move them about etc.

However, when the user goes back to the first frame, all of the duplicated clips created in the 2nd frame are still there.

How can i make tham go away?

View Replies !    View Related
Duplicated Movie, Can't Remove
I duplicated a movie using .duplicateMovieClip, and now I can't remove it using .removeMovieClip(). Any ideas?

View Replies !    View Related
Can't Remove Duplicated Moviclips
mornin

i'm using this code to create duplicate movieclips depending on a variable called totalRecords, which i get from an asp page counting the number of records in a database:

function thumbMov() {
var a = parseInt(_parent.totalRecords);
var b = 0;
var c = 0;
while(a>0){
thumb.duplicateMovieClip("thumb"+b,b);
this["thumb"+b]._x = c;
this["thumb"+b].mya = a;
this["thumb"+b].myb = b;
this["thumb"+b].onRelease = function(){
_root.images.gotoAndPlay(1);
_root.images.strImage = "images/gallery/" add _parent.strRecord add this.mya add ".jpg", "thumb"+this.myb;
}
a--;
b++;
c += 36;
}
thumb._visible = false;
}
thumbMov();
stop();


I am using three buttons in the code's _parent movie (called 'reel') to load in different values for totalRecords. The only problem I am having is that when the new value of totalRecords is less than the previous, i.e. 14 records to 5 records, the 14 duplicated movieclips still remain. I would like them to be deleted and replaced with the correct number.

I've tried adding a 'removeMovieClip(thumb)' and 'this.reel.thumb.removeMovieClip();' but nowt happens.

The code on the buttons currently looks like this:

on (release) {
this.reel.thumb.removeMovieClip();
strCategory = "sport";
loadVariables("gallery.asp?Record=" add strCategory, _root.gallery);
_root.gallery.reel.gotoAndPlay(1);
gotoAndPlay(2);
}


thanks for your help

View Replies !    View Related
Remove Movies Duplicated Using I = I + 1;
Hi,

Im using the following functions to duplicate movieclips which is working fine. But how do i remove them?


ActionScript Code:
function dupeONE(){
        i = i + 1;
        duplicateMovieClip (_root.heartONE, "heartONE" + i, i);
}
function dupeTWO(){
        i = i + 1;
        duplicateMovieClip (_root.heartTWO, "heartTWO" + i, i);
}
function dupeTHREE(){
        i = i + 1;
        duplicateMovieClip (_root.heartTHREE, "heartTHREE" + i, i);
}

View Replies !    View Related
Problems With Remove Duplicated Clip
Hi,
I found a great fla on flash kit that has got a clip that gets duplicated like this:

objects = 35;
loop = 1;
while(loop <= objects){
duplicateMovieClip("bar","bar"add loop,loop);
loop = loop + 1;
}
//if(_root._framesloaded = 7) {
//removeMovieClip(bar);

//}

stop();

This clip named "bar" keeps duplicating itself and moves across the screen through:

onClipEvent(load){
_x = Math.random()*800;
speed = Math.random()*5 + 1;
_y = Math.random()*50 - (_height/2);
_xscale = Math.random()*15;
_yscale = Math.random()*150;
_alpha = Math.random()*15+4;
}
onClipEvent(enterFrame){
_x += speed;
if(_x >= 800){
_xscale = Math.random()*150;
_yscale = Math.random()*150;
speed = Math.random()*15 + 5;
_y = Math.random()*100 - (_height/2);
_x = _width*-1;
_alpha = Math.random()*15+5;
}
}

My problem: I want to stop this clip duplicating itself when it gets to a certain frame on the main timeline. I've tried various things like:

objects = 35;
loop = 1;
while(loop <= objects){
duplicateMovieClip("bar","bar"add loop,loop);
loop = loop + 1;
}
if(_root._framesloaded = 7) {
removeMovieClip(bar);

}

stop();

but it wouldn't work, any ideas?
(I have also tried to make this clip invisible to no avail)

View Replies !    View Related
Duplicated Movieclip Doesn't Inherit Loaded Movieclip
I'm loading an image into a blank_mc within a movieclip called 'background_mc' using the MovieClipLoader object; when the onLoadInit for the MovieClipLoader object is fired, i then attempt to clone my 'backgound_mc' object and the loaded image it contains so i can do something with it (i,e a funky masky/blur thing, not important right now)

I'm successfully loading my image into the blank clip within background_mc, the onLoadInit behaviour fires and duplicates background_mc once the image has been loaded, but in a disappointing turn of events, my clone of background_mc no longer has an image attached, and has instead reverted back to it's original form, just as ti was before it had the jpeg image loaded in.

Has anyone ever encountered something like this this before regarding the duplicateMovieClip command, and if so can anyone suggest a workaround?

*goes off to boost karma by helping others*

Thanks!

Chris

View Replies !    View Related
Duplicated Movieclip Question
Hi. I have an actionscript movie loop ( onClipEvent(enterframe)) and each time it goes into it, it is supposed to increment its coordinates and place a color image (movie clip) down. I have the whole thing working really good except that each time I duplicate the movie clip, it only lasts for one frame, giving me the effect of a moving image. I have the actual SWF on the web so you can see what I'm talking about. What I want is for each time and movie clip is duplicated, for it to stay there. Think of it kinda like the screen filling up with these color blocks.

http://www.venra.com/sp/man.html

-Scaaven

View Replies !    View Related
Duplicated MovieClip Disapearing
Hello,
I am making a "shooting in space" type game, but I am having a problem with my ennemies.
I have 4 ennemies on screen, which are 1 movieClip and 3 duplicates. They are created on initialization and are recycle whether they get my hero - or are hit by its shot tarjet : reset variable so it is alive and healthy again, reset to a start position, and go to play the MovieClip first frame.
According to my comments in the output window(I have put few trace statements where needed), the code is excecuting OK. Except that after a while, my duplicate disappear off the stage . Supposingly they have gone through the reset function, and the reposition and back to frame 1, but they are no where on stage. They are nowhere either when I list my variables. Gone. Always left with the one and only movieClip that was not a duplicate.
And nowhere in my code do I ever remove those movie clips.
So far, there is no end! I 've been looking all day for some pattern for this to happen, but no luck!
Any idea out there??
Thanks
Geraldine

View Replies !    View Related
How Do You Target A Duplicated Movieclip
Hi, I was wondering if there is a way I can dynamically assign an instance name to a duplicated movieclip so I can target it later?

View Replies !    View Related
Setting The _X,_Y Of A Duplicated MovieClip
How would I go about doing this? And where would I enter the value? In the TARGET, NEW NAME, or the DEPTH cells?

If you folks could point me in the right direction I will give you free chocolate marmots. Or something like that

View Replies !    View Related
Drag Duplicated Movieclip
hello,

i want to build a sort of flash game. one of the functions
of this game is the following:

you click on an item. in this moment (on(Press)) a copy
of that item appears directly below the mouse pointer
and you can drag it into a bowl. when you release it,
it stay at the bowl.

i tried the following:

i made a movieclip, and inside that mc a button with the
graphic. the movieclip is named item. i put a on (Press)
action on the button inside the movie clip and added the
folling code:


Code:

on (Press)

{

_root.addMe("c_"+(this._name),"t_"+(this._name));

name = (this._name) + "_";

this.duplicateMovieClip (name, count);

_parent[name+count].startDrag();

nameAll = [name+count];

count +=1;

}

on (Release)

{

trace (nameAll);
_parent[nameAll].stopDrag();

}
the first scene on the timeline where the button sits has
the following code


Code:

var nameAll;
var count = 1;

everything works fine so far: the duplicated clip appears,
i can drag it, and when i add a swapDepths action to the
on(Press) code for the original mc, i still can click it
and produce more clips. but the on(Release) action doesn't
seem to work, because i'm adressing the wrong instance.

hope i made my problem clear.

any hints?

thanks

View Replies !    View Related
Controlling A Duplicated MovieClip
I am creating a basic flash game. I have a tank (tank_mc) that I can move up and down. On the tank, I have a turret (turret_mc) that I can rotate. I would like to fire a weapon(weapon_mc)from the turret and have it go in the direction the turret is facing. I know there is a trig. formula to detect an angle. If anyone would care to share this scripting, I could use the help.

Any Help will be greatly apprieciated.

Thanks,
Shontar

View Replies !    View Related
HitTest Two Duplicated Movieclip
ok i have to duplicated movie clips (a bullet and enemy) i want the bullet to hitTest when any bullet hits any enemy

i tried many things so plz help

View Replies !    View Related
Controlling Duplicated Movieclip
ActionScript Code:
stop();
var n = 0;
this.onEnterFrame = function () {
    if (n < 20) {
    duplicateMovieClip(markerpack_mc, "new_mc"+n,n);
    n += 1;
    _root["new_mc"+n]._x += 15;
    }
    }

When the movie enters the frame I want 20 clips to be duplicated and spaced out at 15 pixels a part. The problem is the clips are duplicated but not spaced out. I have used code similar to this before and it has worked....what could be the problem with this? Probably just a mental lapse...

View Replies !    View Related
[FMX] Getting A Duplicated Movieclip's Name On Event
Hi all,

Normally I don't bother posting a question which seems as trivial as mine, because usually Google or some forums / tutorial sites are my best friend.

However, I cannot find a solution anywhere for this issue. Searching the forum yields: "The following words are either very common, too long, or too short and were not included in your search: name"

Anyway, the thing is this.

I duplicate a movieclip several times, which is a button, and name the instances c0, c1, c2, etc. I want to use substring to extract the number behind this name when someone clicks on one of these buttons. I have the following function in the button:


Code:
on(rollOver) {
x = substring(this._name,1);
ripples._x = coords[x].split(",")[0];
ripples._y = coords[x].split(",")[1];
}
As you may guess, I need the number in the variable x. However, the pointer "this" apparently points to the level this button is on (_level0), and not the button itself. So "this._name" gives me nothing.

My question to you all is, how do I obtain the buttons instance name the user has clicked on? Or for that matter, any other property. How do I address the button itself, from the on(XXXX) function?

The code to spawn the buttons is (in a loop):


Code:
duplicateMovieClip("clickdot","c"+x,x+10);
setProperty("c"+x,_x,coords[x].split(",")[0]-8);
setProperty("c"+x,_y,coords[x].split(",")[1]-8);
Obtaining the coordinates instead of it's name would suffice as well.

Thanks for any help you can offer.

View Replies !    View Related
Using LoadMovie In Duplicated MovieClip
I can't manage to load jpg in some duplicated mc. I tried to add the as to the container mc "img"

ActionScript Code:
onClipEvent (load){ this.loadMovie(_parent._name+".jpg");}

which trace the correct path to the jpg but the jpg don't show up. (Which would be wrong as if I remember well, the mc when being duplicated loses the loadMovie part????To be confirm)
So I thought that maybe the best would be to have it done while duplicating the movie but whatever I have beeen trying has been unsucessful. Here is the codes with duplicating mc.

ActionScript Code:
onClipEvent(enterFrame){//CODE GENERAZIONE QUARDATI//tot=10;for(var i=1;i<tot+1;i++){ e="foto"+i; if(i%2!=0){  if(i!=1 && i!=2){   yp=0;   xp=_parent["foto"+String(i-2)]._x+68;  }else{   xp=0;   yp=0;  } }else{  if(i!=1 && i!=2){   yp=68;   xp=_parent["foto"+String(i-2)]._x+68;  }else{   yp=68;   xp=0;  } }; duplicateMovieClip(_parent.foto,e,i); _parent[e]._x = xp; _parent[e]._y = yp; _parent[e].img._xscale=64; _parent[e].img._yscale=64; _parent[e].n=i; _parent[e].dataa=dataa[i]; _parent[e].link=link[i]; };//}

A little push in the right direction would do me good please.

View Replies !    View Related
Duplicated Movieclip Ontop
whenever i duplicate this movie clip
the duplicated movie clip goes ontop of everything else

how do i duplicate it in a manner that prevents it from sitting
on top of everything else in my screen?

View Replies !    View Related
Add Code To Duplicated Movieclip?
is there a way to add code to MCs created with code? Specifically onClipEvent?

thought this would work but it dont¿?

many thanks!



ActionScript Code:
tgt.onClipEvent(load) = function():
 
trace(this._name);
 
}

View Replies !    View Related
Function Within Duplicated Movieclip
Hi you guys,

Problem :

i have a movieclip, a rectangle on on layer, and the following actionscript on the other layer :

function lDMV(wCH) {
trace(wCH);
iMG.loadMovie("img/" + wCH);
}

This complete MC is duplicated a number of times, according to the items that are available in the database(mysql/php) at the moment.

My duplicateMovieClip code :


ePY = 0;
for (var i = 1; i <= mAXpORT; i++) {
var MC = _root.tHUMB.duplicateMovieClip("tHUMB" + i, i + 1);
MC._x = ePY;
MC._y = 200;

ePY = ePY + 170;

if(pORT[i].pSMALL != undefined) {
_root["MC"+i].lDMV(pORT[i].pSMALL);
}
}

[ mAXpORT is 8 in this example]

The function should be doing the following :

Duplicate the movieclip, adjust the X position, an load the image that is given trough the function, so there will be 8 MC's with each an image... I've tried everything i know to "adress" the function within the duplicated MC's , but nothing works...

If you understand what i mean, could you please point me in the right direction?

View Replies !    View Related
Accessing A Variable In A Duplicated Movieclip
Hi..I am duplicating a movie clip several times..and need to change a local variable in each duplication.. my code is

for (i=1; i<=length(_level0.text); i++) {
duplicateMovieClip ("_level0.letter", "letter"+i, 1);
setProperty ("letter"+i, _x, _root.letter._x+(i*50));
setProperty ("letter"+i, _y, _root.letter._y);
newmc = "letter"+i;
newmc.intext = "fg";
}
stop ();

I am having problems with the
newmc = "letter"+i;
newmc.intext = "fg";
bit..

intext is a variable that is in the movie clip that is being duplicated..how do i actually access it?

Thanks

View Replies !    View Related
Moving Duplicated Movieclip Out Of Mask
Hi

I have a MC inside a Masked area, when i click it i want to duplicate it and drag it out side the mask!

Is that possible? My code works exept its still inside the masked area!!

greats
Pvanden

View Replies !    View Related
Preloader In Duplicated Movieclip Which Has A Loaded Jpg In It
Hello,

I have a button which duplicates x number of times and has a jpg loaded into each one. The jpg loads into a blank mc named ".blank". All I want is a preloader in each duplicated button for each loaded jpg. I'll want to add a load bar or preloader animation later but I want to get this sorted first.

I have attached a basic version of it below, I have removed the duplicateMovie actionscript.

Thanks

View Replies !    View Related
Preloader In Duplicated Movieclip Which Has A Loaded Jpg In It
Hello,

I have a button which duplicates x number of times and has a jpg loaded into each one. The jpg loads into a blank mc named ".blank". All I want is a preloader in each duplicated button for each loaded jpg. I'll want to add a load bar or preloader animation later but I want to get this sorted first.

I have attached a basic version of it below, I have removed the duplicateMovie actionscript.

Thanks

View Replies !    View Related
Duplicated MovieClip/variable Troubles
Hi,
I need my Flash MX application to have a varying number of input boxes to put their data into so I created a movie clip with an embedded input text box.

On creation the duplicated MC names itself "line"+i and then names the textbox's variable "answer" + i. (where i is an increasing integer.

So the path to first one is _root.line1.answer1,
second one is
_root.line2.answer2 etc.

Problem comes when I want to extract that data into a variable on the root level, as Flash doesn't like a path name like this:

_root."line"+i."answer"+i


Any ideas?

View Replies !    View Related
Adding Actions To A Duplicated Movieclip
Hi

I have to duplicate a rectangle movie clip that I have and then put different actions on them. My code can't seem to do it. It doesn't even do the onLoad function... Help me please. Thanks


Quote:





// this is on frame 1

_root.speed = 10;

// duplicate the rectangle which is outside the stage
rect.duplicateMovieClip("rect1",1,{_x:400,_y:350}) ;

_root.rect1.onLoad = function() {
oldX = this._x;
oldY = this._y;
toX = 150;
toY = 150;
}

_root.rect1.onEnterFrame = function() {
this._x += (this.toX-this._x)/_root.speed;
this._y += (this.toY-this._y)/_root.speed;
}

stop();

View Replies !    View Related
Duplicated Movieclip And Goto Command
i have it set up so that when the duplicated bullet hits the limitMC
it makes the duped bullet goto and play break.

onClipEvent (enterFrame) {
if (this.hitTest("_root.bullet")) {
tellTarget ("_root.bullet") {
nextFrame();
}
}
}

but it doesnt work! is it because its a duplicate?

View Replies !    View Related
Strange Duplicated Movieclip Behaviour...
Hi all,

i have a movieclip of a spaceship, with other clips inside, ie rotating radar dish etc. I have attached code to the clip, so it moves down the screen.

when i place the clip (with code) on the scene, it works.

If i make it invisible, then duplicate it onto the screen later on........it just sits like a graphic.

i have checked all my clip behaviours, because to me it really does look like this is the problem(not saying it is).

I also tried using the attached ship clip (instead of a duplicated copy). Making it invisible upon movie startup, then making it visible, and moving to right place, when it was needed. Again it just sat there like a graphic.

what could make it act this way?


here is the attached ship code:

code:
onClipEvent(load){
var issdamage=50;
}

onClipEvent(enterFrame){

if(this._y>=300){

if(_global.shipflashing==false){
if(this.isspic.hitTest(_root.game_ship)){
_root.game_ship.enemyhitship=true;
this.issdamage-=1;
}//end hittest if
}//end flashing if

if(this.issdamage<=0){
_root.attachMovie("shipexplosion_exp","issexplo_at t",150);
_root["issexplo_att"]._x=this._x;
_root["issexplo_att"]._y=this._y;
this.removeMovieClip();
}

}else{
this._y=this._y+2;
}//end outer if else

}//end event

View Replies !    View Related
Checking The Status Of A Duplicated Movieclip
I need to access a function in a movie clip I am duplicating and the function isn't being called. From what I understand the movie clip takes about a frame to be loaded and thus, for the function to exist. I was wondering if anyone knew how to check the status of the movie being loaded so that I could call the function after the clip has been loaded.

Any help would be appreciated.

Thanks

View Replies !    View Related
Can't Access Properties In Duplicated Movieclip
I can't seem to access the properties within duplicated movie clips. This is part of a loop that parses a XML document and then creates movie clips based on the number of nodes. I then want to put some of the data from sub nodes within each movie clip such as an image and some text. Right now I'm just trying to rename the instance of the dynamic text box within the movieclips. Whenever I try to access instances or properties within the movieclip it returns "Undefined." Note: I already have the movie clip on the stage that needs to be duplicated ( "pCamera0" ) and I know that it will be overwritten the first time the loop goes through which is what I want to happen. Any suggustions?


Code:
pCamera = "pCamera" + n;
pNewName = "pName" + n;

if ((i == 0) or (i == 1)) {
duplicateMovieClip("pCamera0", pCamera, 10+n);
setProperty(pCamera, _x, curX);
setProperty(pCamera, _y, curY);
setProperty(pCamera.pName, _name, pName);

trace(pCamera.pNewName._name); // Always returns "Undefined"

curX = curX + 131;
i++;
} else if (i == 2) {
duplicateMovieClip("pCamera0", pCamera, 10+n);
setProperty(pCamera, _x, curX);
setProperty(pCamera, _y, curY);
curX = 0;
curY = curY + 105;
i = 0;
}

View Replies !    View Related
Help On Path Of Movieclip Within Duplicated Button
I need help on path of movieclip within a duplicated button. I need to access the movieclip so I can say gotoandplay(10); the duplicated buttons instance name is "mc"+i(mc1,mc2,...).the movieclip instance name is idiot.

Ive tried _root["mc"+i].idiot.gotoandplay(10); but no luck. zny help would be greatly appreciated.

View Replies !    View Related
Changing Properties Of A Duplicated Movieclip
guys, help!

i have this code in a MC which dups a MC called blob which is in _root level. n has already been declared elsewhere:

n+=1;
duplicateMovieClip(_root.blob,"blob"+n, _root.n);

ok, so now i want to change the _x of the "blob+n" duplicates to the same _x as another MC which I called "gun". how do i do that?

_root."blob"+n._x = _root.gun._x

does NOT work.

I tried this also:

setProperty("blob"+n,_x,(getProperty(_root.gun,_x) );

no luck with any of these code

any help would be appreciated thanks =>

View Replies !    View Related
[FMX]how To Drag And Move Duplicated Movieclip Help
i wanted to drag and move duplicated movieclips but was unable to do it. But i able to duplicate movieclip on the stage. Is there anyone who can show me how or could direct me to any tutorial site.

Below is my code is there steps which i miss out that unable me to move and drag my duplicate movieclips?

var mySelection = "";//Global declaration
var totalmc = 0;
var depth = 40;

wire.onPress = function ()
{
this.createEmptyMovieClip(["mc"+totalmc], this.getNextHighestDepth(mc)); //Create a newMovieClip with variable name "mc1""
duplicate(mc);
//trace(["mc"+totalmc]);
mc = attachMovie("idwire", ["wire"+totalmc++], this.getNextHighestDepth(mc)); //store the Movie into mc1 by attaching
mc._x = 273;//(Stage.width - mc1._width)/2;
mc._y = 196.5;//(Stage.height - mc1._height)/2; //setting the corrdinates for x and y axis
dragging(mc); //calling the dragging function
//trace(mc1._x +","+ mc1._y);
//trace(mc1._width +","+ mc1._height);
}

//Function for dragging
function dragging(mc)
{
mc.onPress = function()
{
this.startDrag(true);
mySelection = this;
}
mc.onRelease = mc.onReleaseOutside = function()
{
stopDrag();
}
}
//Function for getting nxt highest depth
function getNextHighestDepth()
{
depth++;
return depth;
}
function duplicate(mc)
{

mc.duplicateMovieClip (["mc"+i], i);
i++;

//trace("mc"+i);
//trace(x);


}
//Btn function for flipping
flip.onRelease = function()
{
mySelection._rotation += 10;
}
//Btn function for delete
del.onRelease = function()
{
mySelection.removeMovieClip();
}

View Replies !    View Related
Link To Duplicated MovieClip In Loop Help
Hi,
I've got a form with radio buttons which were duplicated depending on the response from the database. However, when they are selected (even though they have the same group name) it is possible to select more than one. I've got round this problem by adding the selected one to a blank array and removing it from an array with all the possible radio buttons in. This then enables me to get the selected value and use it, and However, the other values (which are in another array) still show as selected (i.e. the dot is in the middle of the button) which isnt good.

I've set up a loop which should go through each value in the "unclicked" array and set the radiobutton corresponding to it to unselected. The code I have is below:

for (i=0; i < unclicked.length; i++)
{
_root.RB[i].radioButtoni.selected = false;
}

Which gets the correct array, correct values but I can't seem to reference it properly. The duplicated movie clips are named RB1, RB2 etc...
The code works if it is hard coded in, and I've tried declaring a variable in the loop like:

thename = "RB"+i;
_root.thename.radioButtoni.selected = false;

But it doesn't like that either. Any ideas?

Also...am I going about the selected but the right way? I want the one I select to show the dot and not the others. The way I have it it can't be selected at all even when another is not selected.

Thanks in advance,
Sarah

View Replies !    View Related
Remove Movieclip, Then Attach Another Movieclip
I'm attaching a few MC's one at a time depending which one is being called on by clicking of a button. After I have attached an MC and i want to go to another MC, I want to remove the MC at the end of some animation inside that MC; then I want to attach a new MC. Everything works except when I want to attach the new MC.

Here's my code, please let me know what I'm doing wrong.


Code:
btn_i.onRelease = function() {
if (newMC._currentframe == newMC.totalframes) {
newMC.removeMovieClip();
attachMovie("interact", "newMC2",1,{_x:340,_y:250});
}else {
newMC.nextFrame();
newMC.play();
}
Thank you so much!

View Replies !    View Related
Attach Movieclip And Remove Movieclip
i can i attach a movieclip from the library and later remove it?

View Replies !    View Related
How Can I Assign A Button Action To A Duplicated Movieclip?
Hi all,

I come from a design background so you could definitely say I'm not a programmer. Still, I thought I had a pretty intuitive mind when it came to deciphering some actionscript. (HAH!) I downloaded sephiroth's slide menu to get familiar with how that particular actionscript works, and I managed to add more buttons, change the icons, the text, and even figured out placement and spacing and labeled each action accordingly for future reference. Cool, I thought. Then, I proceeded to add the links to the buttons (which are separate swfs that load on level 1). That's when I got in over my head.

Here's my thinking: since all the buttons are generated via actionscript from one movieclip, and the differences between the buttons (icons and text) are determined by the arrays, I figured I could put the swfs in an array and call them that way. But I am unsure how to do determine an event for a button that is "scripted" (terminology?). I'm probably hopelessly lost, but still would like to know if I'm on the right track.

Thanks,

Aeneah

View Replies !    View Related
Problems With Nested Duplicated Movieclip Masking
Hi guys im really stuck with this masking problem, i have this movieclip that generates other mc, and then i tried to mask it but it does not seem to work properly.

this is my MC hierarchary

Mainmc > mc1 > mc2

when i put the mask on the mc1 then the text is all hidden behind it, and when i put the text in mc2 then all the text is on top of the mask, because of the depths i dont know what to do
please help

i have attached the fla so guys please help me please

Regards

Peter

View Replies !    View Related
Creating A Duplicated Movieclip Along A Motion Guide.
I dont know if any of you are familiar with the "flurry" screensaver on a mac? basically a bunch of streams of light moving expanding and disappearing randomly. I want to recreate something similar to this in flash.

I've tried to create a onEnterFrame function and it's not doing what I want of course. I AM a newby... My thinking is if I can create an empty movieclip, and inside of it create this animation of a glowing ball along a motion guide that might be transformed larger at one point in the path, then I can write code on the main timeline frame 1 of the empty movieclip containing the motion guide animation. Something that will repeat the duplication of the movie clip as its moving along the path and have each duplicate follow the lead. Ideally, the opacity of these clips would decrease on each duplication.

my weak attempt:

targetMC.onEnterFrame = function () {
_root.targetMC.duplicateMovieClip ("targetMC"+"x", x );
x++;
}

View Replies !    View Related
How To Drag And Move Duplicated Movieclip In FlashMX
i would like to know how to drag and move duplicated movie clip in flashMX? i'm unable to drag and move duplicated movieclips but able to see duplicated movieclip on the stage. Is there anyone who can show me or direct me to any tutorial site?

Thanks

View Replies !    View Related
FMX2004pro:how Can I Duplicate Movieclip And Add Actionscript 2 The Duplicated Movie?
how can i duplicate movieclip and add actionscript 2 the duplicated movie?
i tried 2 add script 2 the main movie
but i need better way any one can help
Thank u Sooooooooooooo much

View Replies !    View Related
Remove Movieclip
I have snow falling in scene 1 created by using duplicatemovieclip. I want the snow to stop in scene 2. I tried removemovieclip but couldn't get it to work. Any suggestions? Thanks!

View Replies !    View Related
Remove Movieclip
I have snow falling in scene 1 created by using duplicatemovieclip. I want the snow to stop in scene 2. I tried removemovieclip but couldn't get it to work. Any suggestions? Thanks

View Replies !    View Related
How Do I Remove A Movieclip?
Hi i am making a space shooter video game. I am having trouble with removing the ememy craft from the screen after it detects being hit by the blaster ray.

for(var e = 0; e < enemies.length; e++){
if(enemies[e].hitTest(this._x, this._y, false))
{
this.removeMovieClip();
enemies[e].play();
}
}

What happens when i play it is, after the ememy gets hit by the blaster, it plays the ememy movie clip which just shows it explode. I want to to play this but also disappear after it plays, and it doesn't seem to do this. Any ideas??? thanks

View Replies !    View Related
Remove MovieClip ?
I have two movieClip arrays that I want to remove on a button release. The arrays are called 'myMenuClips" and "subMenuClips" each array is created in the root time line, albeit different frames.

So I tried this. I can get the myMenuClips to remove from the stage the subMenuClips remain. How can get both to be removed?

Code:
for (var i in _root) {
if (typeof (_root[i]) == "movieclip") {
var isMenu = false;
for (var c in subMenuClips) {
if (subMenuClips[c] == _root[i]) {
isMenu = true;
//}
//}
//if (!isMenu) {
_root[i].removeMovieClip();
}
}
}
}
//
for (var i in _root) {
if (typeof (_root[i]) == "movieclip") {
var isMenu = false;
for (var c in myMenuClips) {
if (myMenuClips[c] == _root[i]) {
isMenu = true;
//}
//}
//if (!isMenu) {
_root[i].removeMovieClip();
}
}
}
}

View Replies !    View Related
[F8] Remove Movieclip
Is there a way to remove or delete a movieclip that has not been attached via the attachMovieclip or duplicateMovieclip methods?
I thought I remember something about just needing to place the mc on a positive numbered depth level...

View Replies !    View Related
Movieclip Remove Itself. Possible?
back in as1 I could have a movieclip remove itself by :


Code:
this.removeMovieClip();


I tried :


Code:
removeChild(this);


in as3, and it doesn't work. What do i need to do?

Thanks,
Ryan

View Replies !    View Related
Please Help :( Can't Remove Movieclip
Hey guys,

I have a simple animation in my library and I want to attach to the screen, then after 15 frames has passed, i want to remove it.

I have sucessfully attached the movieclip to the screen using this code :


Code:
addChild(new Ball(this,loc.x,loc.y));
I have the following Ball.as file :



Code:
package {
import flash.display.MovieClip;
import flash.events.*;

public class Ball extends MovieClip {
private var gameBoard:Object;
private var xpos:Number = 0;
private var ypos:Number = 0;
private var timer:Number = 15;

public function Ball(gameBoard:Object, xpos:Number, ypos:Number) {
this.gameBoard = gameBoard;
this.xpos = xpos;
this.ypos = ypos;
addEventListener(Event.ENTER_FRAME,countdown);
}
public function countdown(event:Event):void {
timer--;
if(timer == 0) {
gameBoard.removeChild(this);
removeEventListener(Event.ENTER_FRAME,countdown);
delete this;
}
}
}
}
It kind of works.... I see the ball appear on the screen, then 15 frames later I see it disappear, because of gameBoard.removeChild(this) I see the enterframe event was removed, but the actual movieclip doesn't actually get deleted (even though i did a "delete this").

I know this because if i put a trace inside the ball movieclip, it prints it out over and over even though I removed the movieclip.

What am I missing? How do I properly delete this movieclip from memory?

Thanks so much for your time!

Ryan

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