ActionScript 3.0 :: RemoveChild For External XML?
Oct 18, 2011
I'm loading content into my .fla from an external XML file using URLLoader. Once the XML has loaded, I'm looping through the XML to create an XMLList for certain elements. I'm then creating a text field to contain those nodes. Each node gets its own text field so that I can easily create text links. Here's my code (with non-pertinent lines removed)[code]...
View 2 Replies
Similar Posts:
May 28, 2010
I am making a title sequence to a flash site. I load the sequence with addchild. After the title is finished I want to unload the title and play a function.
How can I unload the title movie once its finished? I know I should use removeChild, but I only want to unload the movie after a certain time.
View 1 Replies
Sep 11, 2008
I am currently working on a project that uses URLLoader and addChild to load a external SWF. The SWF that is being loaded is going to be the same size as the first SWF that is loading it, and is being centered on stage, therefore I cannot removeChild with a button on the original SWF. Is it possible to load a external SWF and then give it the ability to remove itself when I click a button inside of it?
View 2 Replies
Feb 3, 2010
I am so stuck on the simplest of transitions! I've just started using AS3 and and doing alright so far, but have been looking for days for a solution to this..I have a simple gallery with 3 buttons.Each button calls in a different SWF. The SWF fades into place, and when you click on a different button it is removed and a new one fades into the same position.All done with AS3 (below). What I just can't manage is how to fade the SWF out before the removeChild(gallery);[code].....
View 11 Replies
Jun 18, 2009
I am having some troubles to remove the movieClip from the current Loader (from the main FLA) at the external movies...
Check out how the external movie loads..
Code:
// -- FUN��O NAVIGATE -- //
function navigate(event:MouseEvent):void{
if(event.target.name == "fotos" ){
carregaFotos();
[Code]....
I have the external swf with some Tween Classes instaled and codified.. But I don't know what to do to CLOSE the external swf loaded at "meuCarregador" and it back to the BEGINNING OF THE ANIMATION on MAIN FLA.
View 1 Replies
Apr 16, 2009
I have a container swf which is used to load multiple external swfs into a blank movie clip. Done as follows:
blank_mc.addChild(externalSWF);
This works fine, however I've got a weird issue with audio. Some of my external swfs have audio clips in them and for some reason the audio doesn't go away when a new external swf is loaded. So say the user loads a swf with audio in it and the user switches to another page, the audio from the previous page keeps playing even though a new external swf has been loaded into the blank movie clip.
I tried using removeChild before the new external swf gets loaded, but that didn't seem to do the trick. Audio is loaded to the timeline like so:
var audio:Nasdaqbell = new Nasdaqbell();
audio.play();
also tried the audio on the timeline as "stream" and "event" and got the same results.
View 4 Replies
Oct 17, 2011
I'm loading content into my .fla from an external XML file using URLLoader. Once the XML has loaded, I'm looping through the XML to create an XMLList for certain elements. I'm then creating a text field to contain those nodes. Each node gets its own text field so that I can easily create text links. Here's my code (with non-pertinent lines removed):
[Code]...
View 2 Replies
Dec 25, 2010
I am able to successfully load two of the swf game files (Shooting.swf and Butterfly.swf). I will be playing this game swf in full screen mode. As in it will Occupy the entire area. I want this swf file to be unloaded upon clicking "homeShoot" which is in the library. Thus, when loading the swf files, at the same time I will addChild this button "homeShoot" from the library. So that when I press this "homeShoot" it will unload the swf file. But i am having problem with this part. The following is my code.
ActionScript Code:
var Xpos:Number = 0;
var Ypos:Number = 0;
var swf:MovieClip;
var loaderShoot:Loader = new Loader();
var loaderButterfly:Loader = new Loader();
[Code] .....
View 4 Replies
May 13, 2011
is it possible to use removeChild and removeEventlistener in external .as files? It rejects these functions in the main as file.
View 1 Replies
Nov 11, 2009
When I addChild(<external swf - p2>), I also want to removeChild(<swf that loaded it - p1>). I can't seem to make that work. In p1, I've tried removeChild(this) or removeChild(this.parent), but I get Error #2025: The supplied DisplayObject must be a child of the caller. If I try stage.removeChild(this), it removes everything and I get a grey screen. If I try MovieClip(parent).removeChild(this) I get Error #1034: Type Coercion failed: cannot convert flash.display::Stage@1cd94461 to MovieClip.
In p2, I don't know how to reference it properly because when I trace(this), I get Object MainTimeline and when I trace(this.parent), I get Object Loader. If I try stage.removeChild(this.parent), I get Error #1009: Cannot access a property or method of a null object reference. at allproducts_fla::MainTimeline/frame1().
View 7 Replies
Apr 27, 2009
I've got a file that loads 4 external swf files. I've got everything correct as far as how it's listening for when each one is finished loading and then the next one knows to play. So I can get each one to play right after the other just fine. My problem is that they don't all have the same number of frames so in between the movies, there's a blip of a previous movie showing up (atleast I think it's due to varied movie length). I want to put in a removeChild function when it's listening for each movie to finish loading. But when I put in: removeChild(myLoader);, it says myLoader is undefined..
Code:
var a:Array = new Array("movie1.swf", "movie2.swf", "movie3.swf", "movie4.swf");
var iArray:Number = a.length; // number of movies
var iCount:Number = 0;
function manageMovies(){
loadMovie(a[0])
}
[Code] .....
View 1 Replies
Mar 29, 2010
I'm trying to build a conditional statement that will addChild and removeChild at different Timer Delays. Before I go any further, I thought, I should mention that I'm usinig TweenMax to ease the alpha of ease Child from 1 to 0 and back during the process to imitate a fade-in/out.
I'm getting issue with only one line - inside a conditional statement.It's running "OK". The movie runs as I want it, but the remove/addChild transitions are not at the speed I want it at. I am getting an error message in the output, but other than that, the movie runs fine.
stop();
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
[code]....
View 2 Replies
Feb 21, 2009
I cant do 2 removeChild(); 's beneath eachotherSo their always will remain 1 child how can i delete that one?
addChild
removehild does work
removeChild
[code]......
View 2 Replies
Feb 9, 2009
I've created a MovieClip that opens other MovieClips. These MovieClips are galleries with example of my art and such. Within these gallery MovieClips there is a "close" button, which is actually another MovieClip.
the problem
Everything works except that when I open one gallery, then close it, then open it a second time, the "close" button refuses to work.
I thought this was do to my incorrect use of removeChild, but now I don't know.
This is made slightly tougher by the fact that closing the gallery involves playing a closing animation, so first I put the removeChild on the last frame of the gallery MovieClip. That had the same result so then I tried it this way.[code]...
View 5 Replies
Aug 31, 2010
I'm using an onEnterFrame handler to load an external swf file which works fine at frame 190..
var fl_Loader:Loader;addEventListener(Event.ENTER_FRAME, fl_EnterFrameHandler);
function fl_EnterFrameHandler(event:Event):void{ fl_Loader = new Loader(); fl_Loader.load(new
[code].....
View 2 Replies
Dec 11, 2009
I can't upload the file here because it is too big but I will post the code and a tutorial link plus the problem I've been having.
What the code does is, it gets an image and places it on your stage. This image you place there is reduced in size and when you click on it, it creates a magnifying glass effect.
It works like a charm and looks very cool but the problem is that when I want to go to another page of my presentation, the image stays there, this is because of the addChild function I'm guessing.
Once again, no problem, I just added this to the AS code of every page : removeChild.
You've probably already guessed it, this only works when the child has already been placed. If I go to my intro page and I place the code there it will give me an error since the intro comes before the gallery code. If I don't put the code there it only works if the gallery has already been loaded and I click on pages that come after the gallery.
So what I actually need is code that detects if the child has been loaded or not and if it has, it should be removed, if not, don't do anything.
U can find all the code underneath, it's quite a lot.
This is the link to the tutorial : [URL]
ActionScript Code:
ActionScript 3 Effect by Barbara Kaskosz.
[url]www.flashandmath.com[/url]
Last modified: September 30, 2008.
[Code].....
View 8 Replies
Oct 13, 2011
I have been struggling all day with adding a child then removing it. this is my first try at AS3 and i have no problem doing this in AS2.
ActionScript Code:
var nut:Shape = new Shape();
nut.graphics.beginFill(0x0000FF);
nut.graphics.drawCircle(20, 20, 20);
nut.x=200;
[Code]...
View 4 Replies
May 24, 2009
I'm trying to figure out why I can't remove the child of the meteors immediately after they have hit the planet or a building so that it would only damage the building once. When I try to just 'removeChild(meteorArray[k])' AS says that the 'object must be a child of the caller'. I'm not sure what that means, but I thought that the meteor was the child of the main document class.
View 2 Replies
Feb 9, 2009
I've created a MovieClip that opens other MovieClips. These MovieClips are galleries with example of my art and such. Within these gallery MovieClips there is a "close" button, which is actually another MovieClip.Everything works except that when I open one gallery, then close it, then open it a second time, the "close" button refuses to work.I thought this was do to my incorrect use of removeChild, but now I don't know.This is made slightly tougher by the fact that closing the gallery involves playing a closing animation, so first I put the removeChild on the last frame of the gallery MovieClip.[code]
View 4 Replies
Mar 14, 2009
I'm working on a pretty simple flash application which basically plays a music clip downloaded from a web URL, and makes a stick man dance. I have it all working fine, however, I've used the addChild function on the start button to add the mc onto the stage, however, when I applied the removeChild function to take it off again, I get an error telling me that it hasn't got a caller.Here's the script:[code]I've had my tutor look at it, and she can't work it out either, but I do get the feeling that she's not much wiser on Flash than I am.
View 17 Replies
May 7, 2009
How can I remove the currentTarget?[code]...
View 5 Replies
May 24, 2009
I'm trying to figure out why I can't remove the child of the meteors immediately after they have hit the planet or a building so that it would only damage the building once. When I try to just 'removeChild(meteorArray[k])' AS says that the 'object must be a child of the caller'. I'm not sure what that means, but I thought that the meteor was the child of the main document class.
View 2 Replies
Oct 25, 2009
here is my script but at the bottom i have a removeChild function which isn't working.
Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
[code]....
View 6 Replies
Jun 23, 2009
is there a "Best Practice" way to do this? This always gets caught up if someone changes too quickly...
public function infoFader(fadeMC:MovieClip):void
{
fadeMC.scaleX = 1.5;
fadeMC.scaleY = 1.5;
fadeMC.alpha = 0;
[Code]...
View 9 Replies
Apr 3, 2010
I've set up and button/movie clip array so that when a user clicks on a button, that movie clip loads and the old one goes away. What I'd like to do is use "addChild" to load the new movie clip and "removeChild" to remove the previous clip. I've got the addChild thing...sort of...it loads all the movie clips onto the screen at once though and I can't get the script to work another way.
Here's the code I've got:
var arrNavigation:Array = [{button:m1_mcButton, page:m1_mc},{button:m2_mcButton, page:m2_mc},{button:m3_mcButton, page:m3_mc},
{button:m4_mcButton, page:m4_mc}, {button:m5_mcButton, page:m5_mc},{button:m6_mcButton, page:m6_mc},
[Code]....
View 5 Replies
Oct 10, 2010
i have a quick question for you. Say i have a parent movieclip called "bob". Within "bob," i have another movieclip named "steve." within "steve," i have a bunch of other movieclips. Say i call removeChild(steve), from within bob. I know that will remove steve, but does that mean all the little movieclips within steve will be removed as well?
View 1 Replies
Oct 19, 2010
I am adding a brick (movieclip) this way:
var brick:Brick = new Brick();
addChild(brick);
[code]....
View 10 Replies
Sep 27, 2011
In stage button, MovieClip is there. When i click button remove the Movieclip. first time no errors. but next given below error. Ithink allready movieclip is removed from stage so how can i write code. And i also mentioned my codeTypeError: Error #1009: Cannot access a property or method of a null object reference.
at Untitled_fla::MainTimeline/onClick(
btn.addEventListener("click",onClick)
function onClick (e) {
[code].....
View 1 Replies
Feb 8, 2009
I have a MovieClip that loads other MovieClips. These I refer to as Galleries as they display some of my different web and art work. Each of these galleries has a close button (actually a MovieClip...) which works well enough. However I find that if I close a gallery and then re-open the same one, the close button refuses to do it's job again. The gallery remains open.
I'm pretty sure this is because I haven't used removeChild correctly. I knew I had a problem with this before, but thought I had solved it. Since, when the galleries close button is clicked, it plays a closing animation I couldn't figure how to add the removeChild for the MovieClip. This is what it looks like (including my commented out failure...)
ActionScript Code:
vectorGallery.close_mc.addEventListener(MouseEvent.CLICK, closeVector);
function closeVector(e:MouseEvent):void{
vectorGallery.gotoAndPlay("close");
/*if (photoGallery.currentFrame == photoGallery.totalFrames){
removeChild(photoGallery);
}*/}
ActionScript Code:
this.parent.removeChild(this);
at the last frame of the gallery MovieClip.
But I think I'd rather do it correctly.
View 2 Replies
Feb 11, 2009
You have two arrays, both containing a different set of movieclips. You drag a movieclip form one array, in to one movieclip of the other array. You can do that as many times as you like. So in fact, the movieclips in the second array are all droptargets. The thing is, I have one erase button which should erase all the movieclips from the first array only when they are dropped on the droptargets from the second array. In other words.. how do I remove the content of the droptargets without removing all the droptargets as well?
View 0 Replies