delete all children

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

What is the best way to do this



Posted On: Thursday 25th of October 2012 10:44:03 PM Total Views:  494
View Complete with Replies

Related Messages:

Preloader problem - How to add/delete such preloaders?   (189 Views)
I have downloaded the Flash Template which has the preloader. I have seen such preloader first time which resides in Actionscript panel and not shown on main Flash project. I have attached the picture. The question is how can I add / delete such preloaders I know the kind of preloaders which will be on main project file's first frame and all other content on second frame. Which can be executed by calling goToAndPlay(2); I have modified the whole content of this template. I need to write a line of code in preloader to go to the main page (flashmo elegant) . Please help. The following is the "Preloader" code: Code: stop(); import; import flash.ui.ContextMenu; var loaded:Number; var percent:Number; fm_bar.addEventListener( Event.ENTER_FRAME, load_progress ); function load_progress(e:Event):void { loaded = stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal; percent = Math.round(loaded * 100); fm_bar.scaleX = loaded; loader_info.text = "Loading... " + percent + "%"; if( percent == 100 ) { fm_bar.removeEventListener( Event.ENTER_FRAME, load_progress ); play(); } } I need the code in place of play(); It is not work now simply blinking. Note: Please let me know how can I delete this preloader.
Flash How to delete recorded stream files from red5 streams folder?   (146 Views)
I would like to know how to delete recorded .fla file from the red5 streams folder. i have in my database is a filename of recorded .fla stream file.For e.g. record7392937.flaSome people told me, this can be acheived by writing code in my Java Application class file which resides in my red5 -> webapps directory on server. But i do not know what code to write there and how will i pass this .fla file name to delete function in Java Application class file and how to actually delete the .fla stream file from my server. Please help.Thank You.
Application Drawing (delete shape problem)   (136 Views)
Hi all, i already create Drawing Application, the problem is i dont know how to do select each shape i draw can delete the shape that i select. here the code for drawing shape i create. Code: var temporaryDrawing:Shape = new Shape(); board.addChild(temporaryDrawing);, 0x666666, 1); var myDrawing:Shape = new Shape(); board.addChild(myDrawing);, 0xFFFFFF, 1); var mouseHolding:Boolean = false; var clickedX:Number; var clickedY:Number; board.addEventListener(MouseEvent.MOUSE_DOWN, mDown); board.addEventListener(MouseEvent.MOUSE_UP, mUp); function mDown(MouseEvent):void { mouseHolding = true; clickedX = mouseX; clickedY = mouseY; } function mUp(MouseEvent):void { mouseHolding = false;, alphaColor);, clickedY, mouseX-clickedX, mouseY-clickedY);; clearTemp(); } board.addEventListener(MouseEvent.MOUSE_MOVE, mMove); function mMove(MouseEvent):void { if (mouseHolding){ clearTemp();, clickedY, mouseX-clickedX, mouseY-clickedY); } } function clearTemp():void {;, 0x666666, 1); } can someone help me how to create function that when i draw many shape on the board. i can delete any shape when i select those shape that i draw. Can someone help
AS3 and PHP - delete image from server   (141 Views)
Here is what I am trying to do... Load an image into Flash from my server... (which I know how to do) then if you click a button in flash, PHP will remove the image from my server. I found an AS2 example that works perfectly!!!... now I am trying to convert the example to AS3, but I am having some issues. The AS3 version does not work because I dont understand how to properly connect PHP POST with the delete button etc... View these 2 links for the code... The AS2 version works perfectly, but I need it to work in AS3. Someone please help. I am new to AS3.
need to delete MCs dynamically created with addChild()   (203 Views)
, I have a script that creates hundreds of MCs within another one, and I need to know how to get rid of those MCs completely. I initialize an array to save the references to the classes. var arrWavePixel:Array = new Array(); Then I have a loop that creates movie clips and pushes them to the array var wavePixel0:wavePixel= new wavePixel(); this.addChild(wavePixel0); arrWavePixel.push(wavePixel0); = "wavePixel"+increment; I am able to change the properties of the new movie clip, such as height, by saying arrWavePixel[increment].height = x; How can I go through all these added Children with a loop and delete them entirely from memory and display
if child hits another children   (157 Views)
hi. As title say I have problem to create if clause for children. I want to change task when one child hit one of the other children. if its possible please help me with that.
How to remove all child(children?/objects) in array   (207 Views)
I would say its a simple question but I've researched everywhere and the only thing I found that might work is this while (container.numChildren > 0){ container.removeChildAt(0); } But when I attempt to use this it won't work. The name of the array is army So my current attempt is to instead of removing all children, to remove a certain child like so If (enemy.hitTestObject(avatar)){enemy.parent.removeC hild(enemy)} This actually Did remove the specific child but, it caused glitching(objects above the removed child stopped moving until mouse was moved, objects below continued moving) and this error: TypeError: Error #1009:Cannot access a property or method of a null object reference. at AvoiderGame/onTick() at flash. utils: :Timer/_timerDispatch() at flash.utils: :Timer/tick() So for my final attempt to remove child correctly I placed the code inside the enemy class file(too complicated to explain ATM)
How to delete this enterFrame   (126 Views)
I have some stars in my flash file. I want them to dissappear when i get to the final frame. Can I delete the enterFrame Then how do I make it re appear again
Sorry, please delete this.   (149 Views)
collection of flash files for children   (162 Views)
I have to create a set of dvd's for children viewing. I was wondering if there is a collection of flash file where i can get premade graphics like the trees, waterfalls, flowers, hills, sun etc. Since that would make my work a hell lot easier. Anybody knows where i can get something like that or where i can purchase it from.
Flash (CS4) - Audio removes itself and deletes itself.   (145 Views)
I have a really strange problem and I was wondering if anyone else had the same thing. I'm working on a movie and I have had audio clips all through it, and several audio imported. Recently, in a certain file, all my audio will simply vanish from both the timeline, and the Library. However, all the visual progress I've made stays in tact. It seems like Flash just takes the liberty of simply deleting all the audio just for the heck of it. There is only 1 piece of audio in the library, and it's technically not there either. Has anyone heard of anything like this, and would there be a way to recover my progress I've made backups, but every time I try to copy the frames into the backup movie which has the correct audio, I keep receiving an error telling me that "An unsupported operation was attempted." Copying and pasting is hard for flash to do these days If anyone has any help, it would be appreciated. I don't want to have to re-enter audio over and over again to my project just to have it mysteriously vanish.
My parents won't stop having children!   (264 Views)
ok, my Digital arts class is making a flash project, and im like the only one actually making a game, so im pretty much alone. i got a lot of help from the people on the AS3 forum, but im pretty sure that my question is too easy to put there. so, i have an array, and it basicly puts a spike on the screen at a random Y, and moves it across the screen, but, when i hit a spike, and ti goes to the you lose screen, the loop keeps adding children, and putting them on the screen, is it possible to just say stop adding children, and go to the next frame i have a break, but when i stop colliding with the spike in the next frame, the spikes start coming again. also, can i totally reset the movie cause when i just go to frame 1, the array plays itself ontop of itself and it gets twice as hard
Can't get MouseEvents fired from children of ScrollPane   (218 Views)
Hi! I feel like this should be easy but it doesn't seem to be working for me. I haven't worked a lot with the Flash components. I'm using a ScrollPane to contain a listing of sentences that sometimes have links in them. When the user clicks the links it does something. When I don't put these inside of the ScrollPane the links work. When I put them in there apparently the ScrollPane is blocking the MouseEvents, or maybe it doesnt really register them since I don't know how setting the content works (if it adds the content as a child or draws it as a Bitmap inside or what) Anyway, anyone have a solution or run into this before Kyle
how can i delete moviecilp   (188 Views)
how can i delete moviecilp and its eficts from the stage by as3
Can't remove all loaded children in a gallery because can't close() a loader!   (479 Views)
0 down vote favorite This is the code i used in a gallery that loads images sequentally. My problems comes in when you have to open a different image album and have to eliminate all the previously loaded children in the movieclip. The problem is that sometimes the user leaves the album page before ALL the pics laod so when they click on a new album to open it a new image is placed somewhere else cause the loader has already been launched. I've tryd to close() the loader but it doesn't seem to work. I'd appreciate it inmensly if you can give me a hand.
Flash Replacing array and removing previous children   (464 Views)
all. I have a problem with replacing values in an array. I have this code that takes the string values out of an XML file: Code: publicfunction loadXML(xml:Event):void { container = new XML(; var aantalSommen:Number = container.somTotaal.length() -1; var randomSom:Number = Math.round(Math.random()*aantalSommen); uitkomstGetal = container.somTotaal.uitkomst.text()[randomSom]; trace("Uitkomst getal: "+uitkomstGetal) deSom = container.somTotaal.som.text()[randomSom]; trace("De som: "+deSom) Ballen = container.somTotaal.andereGetallen.text()[randomSom] +","+ container.somTotaal.uitkomst.text()[randomSom]; trace("Extra ballen: "+Ballen)getallenRij = Ballen.split(","); And then this code inside a function which adds a new child (tijdelijkeBal) for every string in the array: Code: for each (var buttonArray:String in getallenRij){ tijdelijkeBal = new Getal((String)(buttonArray)); tijdelijkeBal.x = Math.random() * stage.stageWidth; tijdelijkeBal.y = Math.random() * stage.stageHeight; addChild(tijdelijkeBal); tijdelijkeBal.mouseChildren = false; ballenRij.push(tijdelijkeBal); } And I have this in my constructor function: Code: lader.addEventListener(Event.COMPLETE, loadXML); lader.load(new URLRequest("sommen/plus.xml")); So far so good. Every time I reload my application, it takes a random set of 5 strings from the XML and it adds the 5 children. What I want to do is reload the XML so that the previous added childred are replaced with new ones when I execute another lader.load(new URLRequest("sommen/plus.xml")); Right now it's so that whenever I load a new URLRequest for the XML file it just adds new children and leaves the previous ones there. I tried doing removeChild(tijdelijkeBal); but that just removes one child. I think the last one in the array in fact. I hope this made sense.
Targeting mc children only   (470 Views)
Hi everybody, i want to target all the mc nested in a parent mc and I'm using this script Code: for (var i:uint = 0; i
how can i delete a movieclip thats inside a parent   (291 Views)
stop(); this.addEventListener(MouseEvent.MOUSE_DOWN, active); function active (e:MouseEvent):void { this.gotoAndStop(2); MovieClip(parent).memb2.gotoAndStop(1); MovieClip(parent).memb3.gotoAndStop(1); MovieClip(parent).memb4.gotoAndStop(1); var mem1:m1 = new m1(); MovieClip(parent).addChild(mem1); mem1.x = 280; mem1.y = 140; } 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 any help!
delete object instances   (144 Views)
Regarding AS3, Flash Player 9: I have a strip of SimpleButton-s which on mouseover will display a Bitmap in a Sprite location along with some TextField-s whose positions are dynamically calculated based on the Bitmap.width. With the below code, I find that the memory usage (Windows Task Manager > Processes) keeps increasing on each MouseOver. Is there anything I'm doing wrong How do I force garbage collection or explicitly delete the new TextField-s Code: function onMouseOver(index:uint) { _theSprite.removeChild(_theTextField); _theSprite.removeChildAt(0); // the bitmap _theTextField = new TextField(); // ... _theSprite.addChild(_theBitmapArray[index]); _theSprite.addChild(_theTextField); }
visible children with invisible parents   (470 Views)
Hi all, I've looked but can't find this anywhere. This may well just be because it can't be done but here goes. Does anyone know of a way that I can make a MoviecClip "visible=false" whilst stopping just one of its children's, children's, children...etc from also going invisible. I am aware that it can be done by setting them all individually but this will take a lot of code (and I like tidy code...and I'm lazy), and I am reluctant to use a loop as it will interrupt the animation that is going on at the time. Any suggestions would be appreciated.