i have about 5 buttons on my site with 5 seperate movie clips (in my library which ive set to export fro runtime),now each button loads its respective movieclip from the library using this code:
function onReleaseHandleraboutBTN(myEvent:MouseEvent)
{
var myMovieClip:MovieClip = new aboutMC();[code]....
now this works perfectly and loads up my movieclip hassle free.what i want to do is that when i click on another button it should close the existing movieclip and open its own movie clip, the code i used for that is:
function onReleaseHandlerfaqBTN(myEvent:MouseEvent)
{
var myMovieClip:MovieClip = new aboutMC();[code]......
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.
I'm working on a simple Flash game for school. In one level, multiple enemies spawn and the player is supposed to shoot them. I used removeChild() to get rid of the enemy that got shot, but when I click (hit) an enemy, everything on my stage gets removed; it goes completely blank.The function to populate my stage with enemies is the following:
private function Game2():void{ for (var i:uint=0; i<50; i++) { var man:MovieClip = new man_mc();
I'm new on Flash, i don't know if it possible, but i'm adding a random movieclip to the stage, using addChild, and i need to remove them after 10 seconds...how can i do this using removeChild?
I am making a flv player with playlist that has and English and Spanish section. The English is the default section and that works very well but when I click "Spanish" button I am trying to remove all the children that were added at start time and run two new functions that load my Spanish data.
The only thing is that removeChild is not working. I can hear my Spanish video load but the English one is still playing in the background.
I need to completely remove main_container.addChild (my_player);
here is the function that should do it all:
function playSpanish (evt:MouseEvent){ main_container.removeChild(my_player); gotoAndStop(2); trace("IN SPANISH"); }
I have an MC that is called from my library when there is a specific error in my movie. My problem is that I cant manage to remove the movie clip when it is on the screen.I have a errorclose_mc button in the error mc (alert_mc) that I want to remove the parent MC (alert_mc)
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):
I have a problem with my flash application because after a while that it is running, it eventually starts to slow down. My application involves something that needs to be replicated with the addChild() method. I've read some info on the internet which states that the cause of the slowing down or the lag in the application is that the removeChild() does not remove the child from the memory
I am using removeChild() to remove a MovieClip. And via tests, I can confirm that it's working fine ( stage.contains(mc) returns false ). But the MovieClip still does not seem to be removed, as if the stage is not updated correctly.
I have my site functioning with swfaddress, and external classes, nothing at all on the timeline.When Im navigating through pages it works well,linking works, backwad and all.. So it works good while Im going FORWARD, but on eventual back button (browser button) how can I removeChild of current page (class) and and call previous page, and have it working as if Im going forward? In my case it calls previous page, but current page is still on display, I have dispose() methods for all classes, just how to call them in case of swfaddress.back() function? Again, no timeline, just external classes as3.
I'm in the right place for this plea from yet another novice trying to learn AS3 in Flash with a couple of very good books but no one to talk to about it - and in danger of losing hair in the process.
My problem: I have a web site containing 8 pages. Each page is a separate movie clip, and each is in a Labeled frame. My intention is to have an overlay for each of the buttons in the top left panel of the home page. On the positive side I have managed to achieve the dynamic placement of an instance of a library movie clip called "sampleAR" via addChild to overlay on top of my home page. But I can't for the life of me get removeChild to rid me of the wretched thing again. My home page is in frame 1 of the movie labeled "Home". This contains a movie clip with the instance name "HomePage" on the stage. Inside the "HomePage" movie clip is my script sitting at the end where the movie stops in frame 44. The code sits here because this is the only place I've managed to get any kind of result with the following code:
New to flash as3, cant seem to get past a 2025 error when remove child is used. My player hits of an object called present_mc2 and is removed but an error comes up on stage. ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display:isplayObjectContainer/removeChild() at VinnieBaggeB00033245_fla::MainTimeline/detecthit()
Here's my code: var present2_mc:MCpresent = new MCpresent(); stage.addChild(present2_mc); present2_mc.x=87; present2_mc.y=305; stage.addEventListener(Event.ENTER_FRAME, detecthit); function detecthit(event:Event):void {{ removeChild(present_mc); stage.removeEventListener(MouseEvent.MOUSE_MOVE, detecthit); }}
completely remove the child of clip at 0 index? I read somewhere you should set to null to all the references to that clip, but I have no other reference in my code. The clip at 0 was added via a regular addChild().
My issue today is a DisplayObject error I'm getting when remove a child object. I have code that will launch(addChild) a video container and video controls as well as add a close button. Now the close button works fine and everything, removing the video and controls and I'm able to choose another video again, but when you click close a 2nd time I get this error: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild() So I've narrowed down the problem to where I remove the videoContainer (which holds the video object) My code to play the videos:
Basically, I have two routines: One is a CDK collision check, and the other is a generic verification of an array. They're both inside the same Timer Event. There are two arrays - the collisionList and the MasterArray, and the object is in both of them.
First, the collision routine:
var collisions:Array = collisionList.checkCollisions(); for(var i:uint = 0; i < collisions.length; i++) { var firstShape:Sprite = collisions[i].object1;
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]...
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
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.
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.
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]
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.
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.