ActionScript 3.0 :: Delete All MovieClips Inside A MovieClip?

Aug 24, 2010

I have created app where images are loaded from xml and displayed onscreen as elements, which can be dragged onto a different 'holder' MovieClip. On successful drop the 'holder' movie generates dynamic movieclip as 'mc' and adds a larger version of the droped image. so i can have multiple child of 'holder' everytime a element is dropped.
 
now i have created a button, on click of which all the elements should be removed. for which I am using the following code
 
while (mainFrame_mc.imgArea.holder.numChildren > 0){             mainFrame_mc.imgArea.holder.removeChildAt(0);            }
 
this code is removing the child clips as required but later when i again drop another element. nothing shows up. Unable to understand why is this happening. The holder movie clip is physically present on the stage where as only its child movie clips are added dynamically.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Delete A Movieclip That's Inside A Parent?

Oct 24, 2010

stop();
this.addEventListener(MouseEvent.MOUSE_DOWN, active);
function active (e:MouseEvent):void {
this.gotoAndStop(2);

[Code]....

this is adding mem1 to the parent,

now on the next frame i want to remove that movieclip, how would i go about doing this. i tried just putting MovieClip(parent).removeChild(mem1); but it says accessing undefined property

View 4 Replies

Flash - Effect A Number Of Movieclips Inside Another Movieclip??

May 26, 2010

i'm trying to effect a number of movieclips inside another movieclip, in this case set the alpha to 20%.But all i get is an error message.

(TypeError: Error #1010: A term is undefined and has no properties. at array_fla::MainTimeline/frame1())
var myClip = new mcClip;
addChild(myClip);

[code]....

(there are five circles on the stage in the myClip movieclip named circle1, circle2, circle3...)

View 2 Replies

Actionscript 3.0 :: Perform Action To All Movieclips Inside A Movieclip?

Jan 14, 2009

I have a movieclip with about 50 other movieclips inside it and I want to set all their visibility to false (I can't do this to the parent because I will need to eventually just show one of the movieclips at a time). Is there any type of method I can use to apply, something like mymc.allchildmcs.visibility = false or mymc.mychildmc[i].visibility = false;

View 2 Replies

ActionScript 2.0 :: Control Attached Movieclips Inside Another Movieclip By A Toolbar?

Feb 2, 2009

The proposed task has to do with the creation of an application in which the user will be able to insert, drag&drop and remove rectangles. The properties of each rectangle (name,x,y) should be saved in an xml instance.

1.Create a vertical toolbar with the above buttons:

a.new rectangle
b.move
c.delete

2.Create a movieclip that will be your workspace on the right of your toolbar named stage.

3.Create a function that will be triggered by the new rectangle button and will attach to the stage rectangles as movieclips named rectangle(i) (rectangle1, rectangle2,...).

4.Create a function that will be triggered by the move button and will drag and drop a selected rectangle.

5.Create a function that will be triggered by the delete button and will remove a selected rectangle.

And what I have done so far is:

i = 1;
newrectangleButton.onRelease = function() {
stageMC.attachMovie("rectangleID", "rectangle"+i, i);
stageMC["rectangle"+i]._x = Math.random()*stageMC._x;

[Code].....

View 0 Replies

ActionScript 3.0 :: Telling Flash To Play A Movieclip Inside Couple Of Other Movieclips

Apr 12, 2009

i have a movieclip within a movieclip within a movieclip... i want to simply tell flash to play that movieclip once i click on it.. however, i get an error saying "1120: Access of undefined property tl_character" when i try to publish the file..[code]i know there might be a solution by using a custom class for "police1" but i'd like to know how i could play that movieclip using a function thats written on the main timeline..

View 2 Replies

ActionScript 3.0 :: Drag Stuff (a Movieclip) From Stage To The Movieclips Inside The Srollpane

Dec 17, 2010

I was working on a little code in which I am inserting a few movieclips within a scroll pane and then user is able to drag stuff(a movieclip) from stage to the movieclips inside the srollpane.

[Code].....

View 14 Replies

ActionScript 3.0 :: Delete Movieclips In It?

May 16, 2011

I'm pretty new to actionscript 3.0 and thus I get the feeling I'm making a very juvenile mistake.. either way I have been trying to solve this problem for hours to no avail. I have an assignment in uni to produce a basic flash game that is meant to meet a set criteria involving playing/pausing music, loading external swfs and so on which I have had no problem with.

The one issue I am having however is creating what is essentially a pond game in which a bird is meant to swoop down and pick up a fish. Getting a hit test to detect the collision between the fish and the bird is working fine but I want the fish to delete itself and then generate a new movieclip as the brief specifies. I can get it to generate a new movieclip no problem but for some reason I can't get it to delete the original one. [code]...

View 1 Replies

ActionScript 2.0 :: How To Use Listeners On MovieClips To Delete Others

Jul 24, 2009

I have three movie clips, mc_1 should delete mc_2 and and mc_3 should delete mc_1. I can get mc_1 to delete mc_2 but I can't get mc_3 to delete mc_1. I am getting a trace in the output window confirming both. How do I go about doing it?

View 1 Replies

ActionScript 3.0 :: Add And Delete MovieClips When A Button Is Click Using For A Loop?

Feb 18, 2010

I have a for loop that adds 5 movieClips to the stage at a random position every time I click the enterBtn, what I want to do if the enterBtn is click again remove the movieClips previously generated and leave only the new ones on the stage.

Oh, the number "5" in my for loop will be dynamically created so it may be different if the enterBtn is click again (I just used 5 for simplicity).

enterBtn.addEventListener(MouseEvent.CLICK, calculator,false,0,true);
function calculator(event:MouseEvent):void {
for (var i=0; i<5; i++) {

[Code]....

View 3 Replies

ActionScript 3.0 :: Delete An Obj From Inside A Function With A Call?

Sep 13, 2010

when we write

var obj1=new Object();
var obj2=obj1;

we know obj2 is just a call of obj1, they are the same thing.also, prameters of function are also the calls of the object outside e.g.

var objC=new Object();objC.name = "Jhon";[code].........

it seems that when setting tar to null, the obj outside in the function didn't changeit seem taht everything you do will pass to the real object, but not setting it to null;

my questions: how to make the real object became null with a call?

View 2 Replies

ActionScript 2.0 :: XML - Delete Attributes Inside Node?

Jun 7, 2010

How can I from AS make this
Code:
<match_statistics version="1.0" 01_06_2010 16:48>
Looks like this?
Code:
<match_statistics version="1.0">
Just delete the 01_06_2010 16:48 part.

View 3 Replies

ActionScript 2.0 :: Adding Properties And Events To MovieClips Inside A Loop Inside A Function

Dec 8, 2009

I have done this same thing in ActionScript 3, but am not familiar with ActionScript 2, which I am forced to use for this project. I am loading products into a SWF via XML and attempting to add a click event to each dynamically-created movieclip. Simply tracing the text from a node in XML will do for now. I'd like to assign a property called "desc" or "description" to each movieclip and have it trace that property's value when clicked. Here is the relevant portion of my code as it stands:

ActionScript Code:
var iXML:XML = new XML();
iXML.ignoreWhite = true;

[Code].....

View 6 Replies

ActionScript 3.0 :: Flash Button Inside MovieClip Inside MovieClip Doesn't Dispatch Event

Jan 25, 2012

I have a Button that is inside MovieClip1 which is inside MovieClip2; yet when i click the Button it doesn't dispatch Event.

View 5 Replies

ActionScript 2.0 :: Delete Command Inside A Mouse Event?

Mar 24, 2004

delete command inside a mouse event, imagine: I have an mc on stage and attach to this mc, some code(flash 5 style)

onClipEvent(enterFrame){
if(something){
something
delete this.onEnterFRame
}
}

but this dosen�t work, but in thae case I put this code in a frame in the timeline (flash mx style)the code works Why this works.

View 2 Replies

ActionScript 3.0 :: Printing Movieclips With Movieclips Inside?

Sep 15, 2010

Printing an MC is easy enough. But I am having trouble printing an MC which has multiple MCs inside of it. They just don't get printed.
 
I am trying to avoid printAsBitmap.

View 5 Replies

ActionScript 2.0 :: Why Do Movieclips Inside Movieclips Have Different _x And _y Than The Timeline

Oct 30, 2007

why does a MC inside another MC have different _x and _y values than the main timeline?What I am trying to do right now is animate a MC inside another MC then get the main MC holding everything to move where that new MC ended animating at (it's part of a game I'm making.)

I know it's confusing but Flash shows the cursors current X and Y in the info panel, which is the same as the main timeline. Yet inside the movieclip, an x of 76 and a y of 277 on the timeline is -195 and -30.9 (respectively) inside the MC.How do I fix it so I can get the _x and _y values to match up so I can tell the main MC to reposition itself to the new X and Y (of the inside MC)

View 1 Replies

ActionScript 2.0 :: MovieClips Inside Other MovieClips - Detecting All

Mar 27, 2008

I have a movieclip called mapWindow, inside mapWindow are dynamically created movieclips of various sizes. The movieclips inside the mapWindow don't take up the entire space of the mapWindow and thus I use a startDrag on the mapWindow upon detection of a mouse press. The problem is, I don't want the start drag to start if the mouse is detected over any of the child movieclips inside mapWindow.

I have a few ideas of how to proceed, but I'm not sure how to reference all child movieclips of a particular movieclip - or something along those lines.

It would be easy to use the hittest function if I knew how to reference all the movieclips I need to, but alas...

View 1 Replies

Delete/destroy/whatever A Movieclip During A Movie?

Oct 18, 2004

I have a question (I'm sure somebody asked it before, but I didn't find the threat. How can I delete/destroy/whatever a movieclip during a movie? I made a game, in the game there is a zombie (movieclip), and when its life (life???) reaches zero, it should be destroyed. I tried "removeMovieClip(this)" and much more, but it didn't work, but also there were no errors.

View 9 Replies

ActionScript 3.0 :: Hide / Delete Movieclip Using It?

Jan 30, 2011

I have different layers and different movieclip in the stage and when the movieClip is clicked it load the external movieclip.[code]...

View 4 Replies

Flash :: Delete A Movieclip Forever?

Jul 13, 2010

I create a mc and then i make an addChild of a sprite.[code]...

if i want to delete from everywhere and forever mcSwap1, what can i do?[code]...

View 2 Replies

ActionScript 2.0 :: Remove/delete A Movieclip?

Sep 9, 2006

How can you remove or delete a movie clip that has not been attached with attachMovie? And along similar lines, how can you delete a function?

View 9 Replies

ActionScript 2.0 :: How To Delete Created MovieClip

Oct 19, 2003

I have a movie containing a movieclip in which an empty movieclip is created with AS, showing an externally loaded pic. At the click of a button I want the pic to unload again, but it doesn't work. I tried removeMovieClip and Delete.

View 3 Replies

ActionScript 2.0 :: How To Delete MovieClip Off Of Stage

Sep 17, 2004

Need to delete a movieclip off of the stage. It's messing with my button focus. Setting it to invisible isn't working.

View 2 Replies

ActionScript 2.0 :: Delete All Content Of A Movieclip?

Dec 10, 2006

How do I, in actionscript, say "delete all content of a movieclip"?there doesn't seem to be a function called " _root.movieclipname.deleteContent(); "I know an awkward way of doing it; deleteing the movieclip and replicating it in the same coordinates with the same name, but this is a terrible way of doing it.

View 2 Replies

ActionScript 2.0 :: Cut/delete Parts Of A Movieclip?

Sep 7, 2007

I don't even know what to ask for, but here is my problem: I want to draw a line as part of a graph.Then I want to draw a hollow circle over the line, but I want to cut out the center of the circle, so it shows the layer under the line.At the moment, drawing an outline of a circle the line still shows.I draw the line:

Then I draw the circle:

-----O------

But when I do this in flash I still see the line, the circle is not hollow: How do I 'cut' the middle of the circle out? Instead of beginFill, I want to do beginErase

View 3 Replies

ActionScript 3.0 :: Movieclip - Delete All The Children

Mar 9, 2009

I have a movieclip that will have between 3 and 6 children in it. I need a way to delete all the children.

View 1 Replies

ActionScript 2.0 :: Delete A Movieclip Off Of The Stage?

Sep 17, 2004

Need to delete a movieclip off of the stage. It's messing with my button focus.Setting it to invisible isn't helping.

View 2 Replies

ActionScript 1/2 :: Delete All Dynamic Variables Of A Movieclip?

Apr 4, 2012

I have the movieclip:mcGrazerwith quite a few dynamic variables like this:mcGrazer.var1mcGrazer.var2etc.If I use:delete mcGrazer;it doesn't delete the variables.But if I use:delete mcGrazer.var1it deletes that individual variable.is there a way to destroy all information (variables) of a particular movieclip?

View 1 Replies

ActionScript 3.0 :: Proper Delete MovieClip From Memory?

May 26, 2011

There is a main movie with button "b1" .Loading external movie in it we have movieclip "b2". Now I add two the SAME listeners on "b1" and "b2" with function deleting from memory.But works only from b1.

my code-"refile.net/f/?amK"

View 0 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved