As3 Error #1006 Removechild Is Not A Function
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error #1006: removeChild is not a function up vote 0 down vote favorite So I'm trying to create a game where in there's an object falling from the middle and you have to drag it in the left if it's good or right if it's bad. What I'm having problems with right now is I don't know how the program would know if the object is good or bad. I think. I'm getting an error: Error #1006: removeChild is not a function. I'm newbie at flash, if you have tips or whatever, please share! http://pastebin.com/AnpN6tEy import flash.events.Event; var tray:Array = new Array(Legal2_1,Legal2_2,Legal2_3,Legal2_4,Legal2_5,Legal2_6,Legal2_7,Legal2_8,Legal2_9,Legal2_10,Legal2_11,Legal2_12,Legal2_13,Legal2_14,Legal2_15,Illegal2_1,Illegal2_2,Illegal2_3,Illegal2_4,Illegal2_5,Illegal2_6,Illegal2_7,Illegal2_8,Illegal2_9,Illegal2_10,Illegal2_11,Illegal2_12,Illegal2_13,Illegal2_14,Illegal2_15); var traypos:int; var goodpos:int; var badpos:int; traypos = (stage.stageWidth / 2)-100; goodpos = ((stage.stageWidth / 3) -100); badpos = (((stage.stageWidth/3) *2) -100); var timerT:Timer = new Timer(1000,120); timerT.addEventListener(TimerEvent.TIMER, traytimerhandler); timerT.start(); var secondsT:Number = 1; function traytimerhandler(event:TimerEvent) { //trace("Seconds elapsed: " + seconds); SpawnTray(null); secondsT++; } function SpawnTray(event:Event):void { var trayspawn:int; trayspawn = int(Math.random() * tray.length); var trayn:MovieClip = new tray[trayspawn](); addChild(trayn); trayn.x = traypos; trayn.y = -20; trayn.addEventListener(Event.ENTER_FRAME, MoveTray(trayspawn)); trayn.addEventListener(MouseEvent.MOUSE_DOWN, startDragging); //trayn.addEventListener(MouseEven
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, http://stackoverflow.com/questions/21573411/error-1006-removechild-is-not-a-function helping each other. Join them; it only takes a minute: Sign up Error 1006: Not a function up vote 0 down vote favorite I am getting the error in the title when trying to access a method in another class. I have the main class, ZombieBots, which is linked to a movie clip of the same name. http://stackoverflow.com/questions/19610053/error-1006-not-a-function I then have 3 more movie clips which all get added to the ZombieBots clip during runtime, and each of these have their own classes. When I attempt to access a method within the ZombieBots class from one of the other 3 classes, I get error 1006. The function I am attempting to access in the ZombieBots class, that cannot be accessed: package { import flash.events.*; import flash.display.MovieClip; import flash.geom.Rectangle; public class ZombieBots extends MovieClip{ private var pLives:int; private var pScore:int; private var pSkill:int; private var pItems:int; private var characterMC:Character; private var cGameObjs:Array; public function ZombieBots() { /*cGameObjs = new Array(); addCharacter(); addItems(); addBots(); pLives = 5 - pSkill; pScore = 0; pItems = pSkill + 5;*/ resetGame(); } private function addCharacter():void{ trace("Adding the character"); if (!characterMC){ var myBorder:Rectangle = new Rectangle(35,35,600,480); var myXY:Array = [38, 400]; var myChar:int = Math.ceil(Math.random()*3); var myKeys:Array = [37,39,38,40]; var myDistance:int = myChar * 3; characterMC = new Character(myBorder, myXY, myKeys, myChar, myDistance); addChild(characterMC); } else{ characterMC.x = 38; characterMC.y = 510; characterMC.gotoAndStop(pSk
using your existing account on the new forums, check out this thread. Register Help Remember Me? Forum Today's Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links View Forum Leaders What's New? https://www.kirupa.com/forum/showthread.php?276519-please-help-with-remove-child-in-AS3 Advanced Search Forum Flash ActionScript 3 please help with remove child in AS3 https://forums.adobe.com/thread/613133 Results 1 to 9 of 9 Thread: please help with remove child in AS3 Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode September 27th, 2007,09:22 PM #1 tonythemediaguy View Profile View Forum Posts 30 posts Registered User please help with as3 error remove child in AS3 Hi I'm using an Array to addChild a movieclip to with a loop. The problem is, is I don't know where the addChild is putting the object. When I try to reference it on the stage, I get errors. What I want is when I click on one of the buttons (newCircle) for to set my variable (which it does) and remove all instances of newCircle from the as3 error #1006 stage. The relevant code is almost at the very end if someone can take a look: package { import flash.display.MovieClip; import divieoEventButton; import Boarder; import flash.events.MouseEvent; import flash.xml.XMLDocument; import flash.events.*; import flash.net.*; import flash.text.*; public class divieoKiosk extends MovieClip { private var newCircle:divieoEventButton; private var newCircleX:Number; private var newCircleY:Number; private var divieventname:Array; private var _firstCard:*; public function divieoKiosk() { divieventname = new Array(); createCards(); } private function createCards():void { var xml:XML = new XML(); //setup initial vars to retreive xml data var loader = new URLLoader(); loader.load(new URLRequest("divieoconfig2.xml")); //xml file is local to swf loader.addEventListener(Event.COMPLETE, function(evt:Event):void //wait for xml to load { xml = XML(evt.target.data); newCircleX = 210; newCircleY = 400; var num:Number = xml.divievent.length(); for (var i:Number = 0; i < num; i++) //start a loop to build out movie clip/buttons { divieventname[i] = xml.divievent[i].@honornames.toXMLString(); newCircle = new divieoEventButton(); addChild(newCircle); if (newCircleX < 1300) { //add movie clips as long as they don't go off screen newCircle.x = newCircleX; newCircle.y = newCircleY; newCircleX += newCircle.width + 10; //add 10 pixels to the width of each clip } else { //if movie clips do off screen, then reset X and add 10 pixels to the height newCircle.x = newCircleX; newCircle.y = newCircleY; newCircleX = 210; newCircleY += newCircle.height + 10; } newCircle.addEventListene
ElementsAdobe Dreamweaver Adobe MuseAdobe Animate CCAdobe Premiere ProAdobe After EffectsAdobe IllustratorAdobe InDesignView all communitiesExplore Menu beginsMeet the expertsLearn our productsConnect with your peersError: You don't have JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on and reload this page. Please enter a title. You can not post a blank message. Please type your message and try again. More discussions in ActionScript 3 All CommunitiesAdobe Animate CC - HomeActionScript 3 16 Replies Latest reply on Apr 12, 2010 12:16 PM by federicopyramid RemoveChild Error federicopyramid Apr 8, 2010 4:17 AM Hi there!! I'm new in the flash world. I'm trying to set up my website but I keep on getting errors! I manage to create a loader to load the images of my portfolio, first I couldn't remove the previous image, when I loaded the second one, the first one was still there. Now it seems to disappear when I added the line removeChild(loader1). BUT I still get a message in the output panel:ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/removeChild() at prueba3_fla::MainTimeline/clickF2()
I don't know if this is going to be a problem in the future or not. I don't have any idea of what this message is talking about! I would appreciate your help. Cheers!!stop();//Classesimport fl.transitions.Tween;import fl.transitions.easing.*;//Variablesvar urlRequest1:URLRequest = new URLRequest("1.jpg");var loader1:Loader = new Loader();var urlRequest2:URLRequest = new URLRequest("2.jpg");var loader2:Loader = new Loader();//Event Listeners 1btnNext.addEventListener(MouseEvent.CLICK, clickF1);//Function 1function clickF1(event:MouseEvent):void{ loader1.load(urlRequest1); loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete); function loader_complete(event:Event):void { addChild(loader1); var TweenOut:Tween = new Tween(loader1,"alpha",Strong.easeOut, 0,1,3,true) var target_mc:Loader = event.currentTarget.loader as