Error #2007 Addchild
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 AS3: AddChild issue — “TypeError: Error #2007: Parameter child must be non-null.” up vote 0 down vote favorite    My following code gave me TypeError: Error #2007: Parameter child must be non-null runtime error. not sure why...I would appreciate any help... mySb = new ScrollBar(); mySb.x = cont.x; //+ cont.width; mySb.y = cont.y; mySb.height = contMask.height; mySb.enabled = true; addChild(mySb); Updated package com.search.view { import com.search.events.YouTubeSearchEvent; import fl.controls.ScrollBar; import fl.controls.Slider; import fl.controls.UIScrollBar; import fl.events.ScrollEvent; import fl.events.SliderEvent; import flash.display.Shape; import flash.display.Sprite; import flash.events.MouseEvent; import flash.geom.Rectangle; import flash.net.URLLoader; public class SearchResultContainer extends Sprite { private var cont:videoCont; private var contMask:Sprite; private var mySb:ScrollBar; public function SearchResultContainer() { super(); } public function get selectedVideoID():String{ return newVideoID; } public function createContainer(_x:Number,_y:Number, videoResult:Array):void{ cont=new videoCont(); cont.x=_x; cont.y=_y; addChild(cont); contMask = new Sprite(); contMask.x = cont.x; contMask.y = cont.y; createMask(contMask,0x000000,452,88); addChild(contMask); cont.mask = contMask; mySb = new ScrollBar(); mySb.x = cont.x; //+ cont.width; mySb.y = cont.y; mySb.height = contMask.height; mySb.enabled = true; addChild(mySb); //problem code here... } private function createMask(inSrc:*,inColor:Number=0x999999,inW:Number=80,inH:Number=50):void{ var rect:Shape=new Shape(); rect.graphics.clear(); rect.graphics.beginFill(inColor); rect.graphics.drawRect(0,0,inW,inH); rect.graphics.endFill(); inSrc.addChild(rect); } } } I am in Flex environment.... flex flash actionscript-3 addchild share|improve this question edited Aug 10 '10 at 0:54 asked Aug 10 '10 at 0:02 FlyingCat 5,5212680136 A little more context might help. Where are you running this? And when in the lifecycle? &nd
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 4 Replies Latest reply http://stackoverflow.com/questions/3445072/as3-addchild-issue-typeerror-error-2007-parameter-child-must-be-non-null on Nov 13, 2013 1:43 PM by Amy Blankenship TypeError: Error #2007: Parameter child must be non-null. meanmeanmeanmean Nov 11, 2013 12:10 PM Hello,I am new to actionscript 3.0, I have Adobe Flash Builder 4.7 installed and I am creating a ActionScript project (File -> New -> ActionScript Project) named as Test. As you https://forums.adobe.com/thread/1333070 know flash builder does not include fl.controls package by default. I have added this package to my project as source path or swc file so that I can use the default components (e.g. Buttons, RadioButtons, Checkboxes) and now I am writing the following code.package{ import flash.display.Sprite; import fl.controls.Button; [SWF(width = "640", height = "480", frameRate = "60", backgroundColor = "#FFFFFF")] public class Test extends Sprite { private var btn:Button; public function Test() { btn = new Button(); btn.label = "CLICK ME!"; btn.x = 100; btn.y = 100; addChild(btn); } }}I am creating a fl.controls.Button instance in Test class and trying to add it on stage. When I run the project, it always gives me the following error for the bold red line.TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground()[C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\Component Source\ActionScript 3.0\User Interface\fl\controls\BaseButton.as:615] at fl.controls::LabelButton/draw()[C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\Component Source\ActionScript 3.0\User Interface\fl\controls\LabelButton.as:724] at fl.controls::Button/draw()[C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\Com
using your existing account on the new forums, https://www.kirupa.com/forum/showthread.php?380952-Can-t-addChild-combobox-parameter-child-must-be-non-null 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 http://gamedev.stackexchange.com/questions/51467/type-error-for-hit-testing-two-objects-created-with-actionscript New? Advanced Search Forum Flash ActionScript 3 Can't addChild combobox - parameter child must be non-null Results 1 to 3 of 3 error #2007 Thread: Can't addChild combobox - parameter child must be non-null Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode August 19th, 2014,08:47 AM #1 newtome View Profile View Forum Posts error #2007 addchild 73 posts Registered User Can't addChild combobox - parameter child must be non-null Been trying lots of combinations but can't seem to crack it - hoping you guys can help. This is the code: Code: var _combobox_cb:ComboBox = new ComboBox(); _combobox_cb.addItem({data:1,label:"TestItem01"}); addChild(_combobox_cb); which results in: TypeError: Error #2007: Parameter child must be non-null. at flash.display:isplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/drawNow() at fl.controls::ComboBox/drawLayout() at fl.controls::ComboBox/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display:isplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/callLaterDispatcher() Reply With Quote August 19th, 2014,11:55 PM #2 newtome View Profile View Forum Posts 73 posts Registered User ok, I forgot that I needed to add it to the library by dragging combobox from the components to the stage and then deleting it. All fine - now! Reply With Quote August 20th, 2014,08:09 AM #
Start 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 Game Development Questions Tags Users Badges Unanswered Ask Question _ Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Type Error for hit testing two objects created with actionscript up vote 0 down vote favorite I am making a zombie shooter game where I get an error when I try to hit test two objects created with actionscript. Could someone post a possible fix please. Here is the Error Code; TypeError: Error #2007: Parameter hitTestObject must be non-null. at flash.display::DisplayObject/_hitTest() at flash.display::DisplayObject/hitTestObject() at game3_fla::MainTimeline/zombiemove() and here is my game code; import flash.events.Event; var zombiehits:Number = 2; var numzombies1:Number = GenerateRandomNumber(10); var zombie : Z = new Z(); var objz; var objb; stop(); //Change mouse crosshair_mc.mouseEnabled = false; crosshair_mc.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor); Mouse.hide(); //EventListners; stage.addEventListener(Event.ENTER_FRAME, alwayson); stage.addEventListener(MouseEvent.MOUSE_MOVE,facecursor); stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown); //Code; var startcountdown:Number = 5; var fl_CountDownTimerInstance:Timer = new Timer(1000,startcountdown); fl_CountDownTimerInstance.addEventListener(TimerEvent.TIMER_COMPLETE, startgame); fl_CountDownTimerInstance.start(); function createZombie():void { zombie.rotation = 90; zombie.height = 85.35; zombie.width = 55.9; zombie.x = 403