这是一个可以正确编译的简单代码,但我在运行它时会收到以下错误
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at mx.controls::ProgressBar/createChildren()[E:\dev\4.0.0\frameworks\pro jects\framework\src\mx\controls\ProgressBar.as:1110]
at mx.core::UIComponent/initialize()[E:\dev\4.0.0\frameworks\projects\fr amework\src\mx\core\UIComponent.as:7250]
......
以下是产生此错误的代码:
<s:TitleWindow ...>
.....
.....
<s:controlBarContent>
<com:IconButton id="btnAdd" toolTip="Add file(s)" click="addFiles()" icon="{addIcon}"
skinClass="com.skins.IconButtonSkin" width="20"/>
<com:IconButton id="btnRemove" toolTip="Remove file(s)" click="removeFiles()" icon="{removeIcon}"
skinClass="com.skins.IconButtonSkin" width="20"/>
<mx:ProgressBar id="uploadProg" labelPlacement="center" width="100%"/>
<com:IconButton id="btnCancel" toolTip="Cancel upload" icon="{cancelIcon}" click="onUploadCanceled()"
skinClass="com.skins.IconButtonSkin" width="20"/>
<com:IconButton label="Upload" toolTip="Upload file(s)" id="btnUpload" icon="{uploadIcon}" click="uploadFiles()"
skinClass="com.skins.IconButtonSkin" width="20"/>
<com:IconButton id="btnView" toolTip="Show/Hide file(s)" click="changeView()"
icon.full="{viewIconFull}" icon.mini="{viewIconMini}"
skinClass="com.skins.IconButtonSkin" width="20"/>
</s:controlBarContent>
</s:TitleWindow>
如果我从这里删除进度条代码,它运行正常。但是在这一行中,我在运行时遇到了错误。使用此行,即使设计模式也不会显示在Flash Builder 4中:(
知道这里可能出现什么问题?
PS:我在使用皮肤按钮组件之前尝试了正常的s:Button。显然那些不是问题所在。
答案 0 :(得分:0)
刚碰到这个......我猜这是因为你有一个3.x swf加载到4.x应用程序中。
查看此链接以获取更多信息... http://forums.adobe.com/message/2721478