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


ActionScript 3.0 :: Can't Remove Leftover Children From Previous Frame

I have created a flash file to serve as an image gallery with several different chapters. Each individual chapter is represented by a different frame on the timeline. On each chapter/frame, there is a thumbnail gallery at the bottom of the screen. When you click on the thumbnail, I have loaders set up to load and display the full size image. Then I have a loaderX.addEventListener set up so that when you click on the loaded image, it disappears. The problem occurs when you leave a full-size picture open, and then you navigate to another frame. Then when you try and click on it, you can't remove it anymore.

Now, I can't remove the loader(s) when the next chapter button is clicked because unless the user has clicked on the thumbnail, the loader has not been added to the stage, so there won't be anything to remove. I tried adding the following 'if' statement into the function that navigates to the next frame,

'if(stage.NumChildren >0){stage.removeChildAt(0)}

but the problem with that is that then it just removes all the children and either doesn't advance to the next frame or is just removing all children on the next frame as well, so i end up with an empty stage.

I've been dealing with this problem for close to two weeks now, and I can't even find a bulky way around it, never mind finding a tight clean fix.

View 3 Replies (Posted: 11-09-2009, 11:35 PM)

Sponsored Links:

Related Forum Messages For Flash category:
ActionScript 2.0 :: Goto Previous Frame Viewed As Opposed To Previous Frame On Timeline?
What is the script used to go to previous frame viewed as opposed to (see below) previous frame on timeline?

Posted: May 2nd, 2005

View 3 Replies!   View Related
ActionScript 2.0 :: Previous Frame Viewed As Opposed To (see Below) Previous Frame On Timeline?
What is the script used to go to previous frame viewed as opposed to (see below) previous frame on timeline?

Posted: May 2nd, 2005

View 3 Replies!   View Related
ActionScript 2.0 :: Button - Go Only To Previous Scene, Instead Of Going To Previous Frame?
I have various movies clip within a movie and my back (mc = arr2_mc) and next (mc = arr1_mc) buttons are on the main scene.This is on my main scene on a first frame

ActionScript Code:
movieclip.prototype.playBackwards = function(arg){
if(arguments.length>0) {[code]....

when it goes back, it goes back frame by frame without stopping but I want it to go only to previous Scene. instead of going to previous frame.Do i have to create a unique button? which i did but i didn't work?

Posted: March 2nd, 2006

View 2 Replies!   View Related
ActionScript 3.0 :: If Remove A Parent, Does It Remove Children
Just wondered if I remove a parent movieclip and then set it to null, will it remove all the child movieclips within it from the Display list and also from memory, or do I need to iterate through the parent movieclip removing all its children before removing the parent?

Posted: 10-09-2009, 02:09 PM

View 8 Replies!   View Related
ActionScript 3.0 :: Remove Container VS Remove All Children?
In my experiment memory usage keeps growing a little (more, and more RAM usage after GC) when I use repeatedly:



Posted: September 6th, 2011

View 5 Replies!   View Related
ActionScript 3.0 :: Flash - Replacing Array And Removing Previous Children?
I have this code that takes the string values out of an XML file:

publicfunction loadXML(xml:Event):void


Posted: March 14th, 2011

View 1 Replies!   View Related
ActionScript 3.0 :: Make Two Buttons Which Will Control The Movie To Goto Next Frame And Previous Frame?
Just finally making the transition from AS2 to AS3.All i need to do at this point is make two buttons which will control the movie to goto next frame and previous frame. I have gotten how to make the buttons go to a specified frame number and also a button to go to a specified external url but no success in making a simple next/previous pair of buttons.



Posted: 10-05-2009, 12:19 PM

View 14 Replies!   View Related
Professional :: Reating Next Frame And Previous Frame Buttons With Flash CS4?
Where can I find step by step instructions for creating next frame and previous frame buttons with Flash CS4?

Posted: Apr 22, 2011 11:03 AM

View 3 Replies!   View Related
Actionscript 3 :: Remove Previous Swf When Enter New Swf?
I am creating double Quiz games with 3 swf files(main.swf,A.swf,B.swf),when i load from Main.swf into another swf example into(B.swf) and reload back to Main.swf again,it works perfectly without erros... but when this process keep on looping, its seems like spamming CPU memory usage...what coding i should used to solve it?
(**i guess because the previous swf file's memory not totally remove when enter another swf, new swf just replacing on top)(I used .unload(),removeChild (),stop() so on seems doesn't solve this problem..i did try my best to solve but fail)

Posted: Dec 14 10 at 3:35

View 1 Replies!   View Related
ActionScript 3.0 :: Remove Previous SWF File?
I have downloaded a slideshow xml example to load any jpeg files but I want to be able to load a collection of .swf files as well.Here's example that I downloaded: http:[url].....The issue that I'm having is while clicking to next thumbnail, I can still the previous SWF file loaded collapsed in back of new SWF file.

Posted: November 4th, 2009

View 2 Replies!   View Related
ActionScript 3.0 :: Load Next And Remove Previous SWF
I'm loading external SWFs into a larger SWF/projector, and I need to load the next and remove the previous one. Because of some unforseen technical requirements, I need to do this in AS3, unfortunately, I'm only used to AS2. I need the simplest possible way. Here's the code I'm using:

On the main movie:
var loadit = new Loader();
loadit.load(new URLRequest("assets/01.swf"));

Then on 01.swf:
var loadit = new Loader();
loadit.load(new URLRequest("02.swf"));

And then load 03.swf, 04.swf and so on. When loading 02.swf, 01.swf needs to be unloaded. How can I do this?

Posted: May 8th, 2010

View 3 Replies!   View Related
ActionScript 3.0 :: How To Remove Previous Object From Memory
I am getting problem of memory of having repeating object. Below is my code.

import flash.system.System;
var counter:Number=0;
var systemMemory:TextField=new TextField();
function showNext(event:Event){
[Code] .....

Above code does repeat textField Object continuously. Now I want to destroy previous created textField Object. So that my memory will not be hang. I got some where in the blog that with System.gc() could clear garbage collection. But currently I am not working with system.gc any more I want to clear previous object in programatically way. Is there any way that I could destroy previous created object?

Posted: Jun 9, 2010 11:10 AM

View 2 Replies!   View Related
ActionScript 3.0 :: Remove The Previous Picture From The Slideshow?
this fullscreen slideshow with random pictures which will be the background of a client's web-site. I have everything working, the preloader, the imaging loading and transitions.There's one thing however that's happening and I don't know how to fix it. What's happening - naturally - is that the previous image is still there, in the background, and I would like that to be removed, I would like to have the previous loader, or just the holder movieclip to get off stage, but I really don't know how to add that to my code.What I was thinking was something in the lines of a for loop. Something like creating the picture's holder inside that for loop so each will be like, picHolder1, picHolder2, picHolder3...and so on. And with that, on completion of the preloader I would remove something like "picHolder -

import flash.utils.*;
import caurina.transitions.Tweener;


Posted: 03-17-2009, 11:12 PM

View 1 Replies!   View Related
ActionScript 2.0 :: Movie Clip - The Preloader Reaches The Leftover Region
i just wrote a radial preloader. i have a problem though: there seems to be some "residue". it is for a small gallery.. so when i test the loader using the bandwidth simulation, the first time it look perfect, but the second time, i can see part of the preloader from the first frame, and as soon as the preloader reaches the leftover region, that region is cleared.

Posted: November 12th, 2005

View 1 Replies!   View Related
Actionscript 3 :: 2 Next Frame Previous Frame In Flash?
im a novice in AS3 it is possible to place 2 next frame button in a single AS3 code/frame this is my code

up1.addEventListener(MouseEvent.CLICK, gotoNextFrame);
function gotoNextFrame(evt:Event){


Posted: Feb 19 at 15:32

View 1 Replies!   View Related
ActionScript 3.0 :: Can't Remove The Children
adding all the bricks of another movie clip into an array in my controlling mc (GameScreen). Except, when I try to remove them from the display list by accessing them from their array, I get


ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller at flash.display:isplayObjectContainer/removeChild()...and so on

I'm guessing it's something to do with adding another movie clip's children into an array in a movieclip that isn't the stored clips' direct parent, but it's parent's parent.

private function checkBrickHit():void{
for(var i:int=0;i<brickArray.length;i++){


Posted: 03-12-2010, 05:34 PM

View 3 Replies!   View Related
ActionScript 1/2 :: Remove Previous MC Created With CreatemovieClip() And AttachMovie()
my little application contain a combobox and a MC "filmstrip" in my _root. the combobox work with an xml file containing links to other xml files. Inside my MC "filmstrip" i have a script loading with a for loop the xml file selected in the combobox on the _root . In this loop i createEmptyMovieClip an attachMovies with the data of the xml selected. evrything works exept that evrytime i change my selection in the combobox it load the data on top of the previous load. I would like to delete the previous load before load the new one.. On my scene 1st frame i have only a code for scroll the movieclip filmstrip but i think is not nescessary that i show it. here is the code inside the MC fimlstrip (sorry but i put all the code). i attach an example aswell

var link1:Array = new Array();
var url:String;
var theUrl:String;
var whoOn:Number;


Posted: Nov 15, 2009 10:03 AM

View 7 Replies!   View Related
ActionScript 3.0 :: Remove All Children From Container
Well I'm starting to really enjoy AS3, my next question then is this: In AS2 I'd often remove all movieclips with something like this:
PHP Code:
for(var i: String in container) {
Is there something similar in AS3 that I can do without resorting to maintaining an array of references to each child of my container?

Posted: 10-02-2008, 11:13 AM

View 4 Replies!   View Related
ActionScript 3.0 :: Remove Filter From Children?
I have a menu that is a type of wave, thus I'm using Flash, not HTML. My issue is that I have a bevel on that wave, but that bevel extends onto the text that is a child of the MC that has the bevel. Is there any way that I can remove the bevel from the text (Or technically shapes since they were imported from IL) without removing it from the entire element?

And yes, I've tried this.filters=[];

Also, I can't keep everything one shape in the MC, because I have hover attributes.

Posted: 05-18-2011, 06:07 AM

View 4 Replies!   View Related
ActionScript 3.0 :: Remove Instances Of Child/children?
trying to remove instances of child/children. I have a function (btFnc) that creates a child (bT) and then the function is called several times to add instances to the stage - btFnc(264,3.6); btFnc(304,4.6); btFnc(344,5.6); btFnc(384,6.6); btFnc(424,7.6);Yet i cannot for the life of me remove all of the children, only 1.

public class screen18 extends MovieClip {
private var scrnXMLLoader:XMLLoader;//XML Loading class
private var screenTxt:Array;


This then repeats for screens 2, 3 & 4.

Posted: 11-13-2009, 10:00 AM

View 3 Replies!   View Related
ActionScript 3.0 :: Push Remainder Children Up After Remove 1?
i have an ary contain a numbers of information as below

var ary:Array = new Array();var temp:Array;

var box_mc:Box; // this is a movieclip which contain dynamic text box inside.

// assume inside the array have 9 itemName

on the stage i got an empty empty movieclip and i add child from the array on it..


Problem:I could delete the item everytime i clicked on the remove button but it appears a gap/space between it. I want to push all remaining box_mc at the bottom up after i remove 1. It only push up when i come back to this page after i navigate to some other page. Does anyone know how to implement this ? P.S. i tried using enterframe and i failed, probally the way i did was wrong or watever.

Posted: Nov 3, 2009 5:37 AM

View 3 Replies!   View Related
ActionScript 3 :: Remove All Children Function In Flash
Isn't there a simple "remove all children" function in flash? I don't understand why this code isn't working. I add children via:
for (var i in project_array[cp].project_type_clips){

And then remove them via:
for (var i in project_array[cp].project_type_clips){

But I get an error that the supplied index is out of bounds, and yet one clip is still left on stage. Likewise, if I try to add them without levels, like this:
for (var i in project_array[cp].project_type_clips){

And remove:
for (var i in project_array[cp].project_type_clips){
I get the same error.

Posted: Feb 22 11 at 19:32

View 3 Replies!   View Related
Actionscript 3 :: Make A Movieclip Remove All Of It's Children?
How do I remove all children of a movieclip?

I tried
while(radar.numChildren > 0){

but this causes the movieclip graphic itself to be removed.

Posted: Sep 12 11 at 6:12

View 3 Replies!   View Related
Actionscript :: Remove Children As The HitTest Them But The Index Seem To Be Off?
when my lasers hit the enemies I want to remove the laser and the enemy but my loop somehow searches outside the index and crash the program.

import flash.display.Sprite;


Posted: Dec 11 11 at 14:37

View 1 Replies!   View Related
Copyright 2005-08, All rights reserved