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


Cheers,

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

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




Preloader problem - How to add/delete such preloaders?

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 flash.net.URLRequest; 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.
VIEWS ON THIS POST

155

Posted on:

Thursday 13th September 2012
View Replies!

Flash How to delete recorded stream files from red5 streams folder?

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.
VIEWS ON THIS POST

120

Posted on:

Friday 14th September 2012
View Replies!

Application Drawing (delete shape problem)

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); temporaryDrawing.graphics.lineStyle(2, 0x666666, 1); var myDrawing:Shape = new Shape(); board.addChild(myDrawing); myDrawing.graphics.lineStyle(lineSize, 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; myDrawing.graphics.beginFill(currentColor, alphaColor); myDrawing.graphics.drawRect(clickedX, clickedY, mouseX-clickedX, mouseY-clickedY); myDrawing.graphics.endFill(); clearTemp(); } board.addEventListener(MouseEvent.MOUSE_MOVE, mMove); function mMove(MouseEvent):void { if (mouseHolding){ clearTemp(); temporaryDrawing.graphics.drawRect(clickedX, clickedY, mouseX-clickedX, mouseY-clickedY); } } function clearTemp():void { temporaryDrawing.graphics.clear(); temporaryDrawing.graphics.lineStyle(2, 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
VIEWS ON THIS POST

109

Posted on:

Tuesday 25th September 2012
View Replies!

AS3 and PHP - delete image from server

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... http://www.ydesigned.com/test/AS3Attempt/AS2.txt http://www.ydesigned.com/test/AS3Attempt/AS3.txt The AS2 version works perfectly, but I need it to work in AS3. Someone please help. I am new to AS3.
VIEWS ON THIS POST

111

Posted on:

Friday 12th October 2012
View Replies!

need to delete MCs dynamically created with addChild()

, 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); wavePixel0.name = "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
VIEWS ON THIS POST

163

Posted on:

Friday 12th October 2012
View Replies!

if child hits another children

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.
VIEWS ON THIS POST

128

Posted on:

Tuesday 16th October 2012
View Replies!

How to remove all child(children?/objects) in array

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)
VIEWS ON THIS POST

166

Posted on:

Tuesday 16th October 2012
View Replies!

How to delete this enterFrame

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
VIEWS ON THIS POST

99

Posted on:

Wednesday 17th October 2012
View Replies!

Sorry, please delete this.

Sorry.
VIEWS ON THIS POST

114

Posted on:

Thursday 18th October 2012
View Replies!

collection of flash files for children

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.
VIEWS ON THIS POST

129

Posted on:

Thursday 18th October 2012
View Replies!

Flash (CS4) - Audio removes itself and deletes itself.

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.
VIEWS ON THIS POST

107

Posted on:

Wednesday 24th October 2012
View Replies!

My parents won't stop having children!

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
VIEWS ON THIS POST

184

Posted on:

Wednesday 24th October 2012
View Replies!

Can't get MouseEvents fired from children of ScrollPane

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
VIEWS ON THIS POST

170

Posted on:

Thursday 25th October 2012
View Replies!

how can i delete moviecilp

how can i delete moviecilp and its eficts from the stage by as3
VIEWS ON THIS POST

153

Posted on:

Thursday 25th October 2012
View Replies!

Can't remove all loaded children in a gallery because can't close() a loader!

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.
VIEWS ON THIS POST

416

Posted on:

Thursday 25th October 2012
View Replies!

Flash Replacing array and removing previous children

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(xml.target.data); 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.
VIEWS ON THIS POST

395

Posted on:

Thursday 25th October 2012
View Replies!

Targeting mc children only

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
VIEWS ON THIS POST

411

Posted on:

Thursday 25th October 2012
View Replies!

how can i delete a movieclip thats inside a parent

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!
VIEWS ON THIS POST

257

Posted on:

Thursday 25th October 2012
View Replies!

delete object instances

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); }
VIEWS ON THIS POST

114

Posted on:

Thursday 25th October 2012
View Replies!

visible children with invisible parents

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.
VIEWS ON THIS POST

411

Posted on:

Thursday 25th October 2012
View Replies!