键入错误#2007 Flash Prof CS6



我浏览了很多关于类似主题的线程,但找不到解决方案,所以我发布了这篇文章。

这是一个相对简单的Flash动画,带有来自组件的滑块("betterslider")。我最初是在CS5中做的,不记得收到过任何这样的TypeErrors。但是当我尝试在CS6中编译时,我得到了错误。

正如我所说,脚本相对简单:

stop();
sliderBar.minimum = 1;
sliderBar.maximum = this.totalFrames; 
sliderBar.liveDragging = true;
sliderBar.addEventListener(Event.CHANGE, moveAlong);
function moveAlong(evt:Event):void {
gotoAndStop(sliderBar.value);
}
this.addEventListener("enterFrame",onEnterFrame);
function onEnterFrame(e:Event) {
sliderBar.value = this.currentFrame;
}
sliderBar.set_thumb_size(30, 30);
PlayVid.addEventListener(MouseEvent.CLICK, playIt);
function playIt(event:MouseEvent):void
{
play();
}
PauseVid.addEventListener(MouseEvent.CLICK, pauseIt);
function pauseIt(event:MouseEvent):void
{
stop();
}

SWF在编译时实际上运行良好。但这种输出仍然令人不安:

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/drawNow()
 at fl.controls::Slider/draw()
 at fl.core::UIComponent/callLaterDispatcher()
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()

当我调试时,我会得到同样的错误,加上这条注释:"无法在这个位置显示源代码。"

请注意,我使用的按钮(PlayVid和PauseVid)是自定义的。我假设"BaseButton"是指与滑块集成(调用)的按钮组件?

正如你所知,我几乎是一个新手,欢迎任何建议!

最好的J

这些函数(drawBackground、draw、drawNow)位于fl.controls(或其他fl)模块中。构造组件时,此问题看起来像是缺少DisplayObject。

CS5和CS6中的组件定义可能存在差异。因此,从库中删除组件(以及所有相关资产)、重新添加滑块(CS6版本)和重新蒙皮(如果需要)就可以了。

这应该有效,但我想知道是否有人知道通过fl模块进行跟踪的方法?(可能与问题无关,但这将允许缩小确切的变化范围)

最新更新