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
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.
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.
Copy link to clipboard
Copied
again, click file>publish settings>swf>and tick 'permit debugging'. retest.
Copy link to clipboard
Copied
still nothing my (mc) is not working.
Copy link to clipboard
Copied
after performing those steps your error message will pinpoint the problem (which is not in the code you showed).