Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


TypeError: Error #2007

New Here ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

Here's my error

TypeError: Error #2007: Parameter child must be non-null.

    at flash.display::DisplayObjectContainer/addChildAt()

    at fl.controls::BaseButton/drawBackground()

    at fl.controls::BaseButton/draw()

    at fl.core::UIComponent/callLaterDispatcher()

here's my AS

import fl.events.SliderEvent;

import flash.geom.ColorTransform;

import flash.events.Event;

s_red.addEventListener(SliderEvent.THUMB_DRAG,changeColor)

s_green.addEventListener(SliderEvent.THUMB_DRAG,changeColor)

s_blue.addEventListener(SliderEvent.THUMB_DRAG,changeColor)

function changeColor(Event:SliderEvent):void{

    var r= s_red.value;//0- 255

    var red = r.toString(16);//number to hexcode conversion with radix set to 16

    if(red.length<2){red ="o"+red}//if its a single digit number make it double by prefixing ''o''

   

    var g= s_green.value;//0- 255

    var green = g.toString(16);

    if(green.length<2){green ="o"+green}//if its a single digit number make it double by prefixing ''o''

   

    var b= s_blue.value;//0- 255

    var blue = b.toString(16);

    if(blue.length<2){blue ="o"+blue}//if its a single digit number make it double by prefixing ''o''

   

    var myColor:ColorTransform =new ColorTransform();

    myColor.color = uint("ox"+red+green+blue);

    mc.transform.colorTransform = myColor;

    rgb.text = red+green+blue;

}

    myColorfield.addEventListener(Event.CHANGE,changeColor1)

function changeColor1(event:Event):void{

    var myColor1:ColorTransform = new ColorTransform();

    myColor1.color = uint("ox"+myColorfield.text);

    if(myColorfield.length==6){mc.transform.colorTransform = myColor1}

}

Help please

TOPICS
ActionScript

Views

430

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

click file>publish settings>swf>and tick 'permit debugging'.  retest.

the problematic line number where you're trying to add something that doesn't exist (when your code executes) will be in the error message.  if you still can't fix it after seeing that, copy and paste the problematic line of code.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 27, 2017 May 27, 2017

Copy link to clipboard

Copied

thank you for replying!

still i get :

TypeError: Error #2007: Parameter child must be non-null.

    at flash.display::DisplayObjectContainer/addChildAt()

    at fl.controls::BaseButton/drawBackground()

    at fl.controls::BaseButton/draw()

    at fl.core::UIComponent/callLaterDispatcher()

that error is appears in output, i dont know why it doesnt work.

the problem is that the drag things are making their work and the rgb text box is working but my (mc) doesnt work and its not changing color when i drag.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 27, 2017 May 27, 2017

Copy link to clipboard

Copied

again, click file>publish settings>swf>and tick 'permit debugging'.  retest.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 27, 2017 May 27, 2017

Copy link to clipboard

Copied

still nothing my (mc) is not working.  

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 27, 2017 May 27, 2017

Copy link to clipboard

Copied

LATEST

after performing those steps your error message will pinpoint the problem (which is not in the code you showed).

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines