简体   繁体   English

从RSL更改组件的属性时收到错误1046

[英]Got the error 1046 when changing the property of a component from a RSL

I got a problem about the RSL. 我对RSL有问题。 I created a RSL named a.fla, and I created a component which basic class is XXButton.as(written by myself.), I reflected some property for designers to change the button's label, besides, this component's Name and Class are both "ShareLib_Button" . 我创建了一个名为a.fla的RSL,并创建了一个组件,该组件的基本类是XXButton.as(由我自己编写。),我为设计人员反映了一些用于更改按钮标签的属性,此外,该组件的Name和Class均为"ShareLib_Button"

在此处输入图片说明

Then I put the button in B.fla as a import component(checked the "Import for runtime sharing."). 然后,将按钮放入B.fla中作为导入组件(选中“导入用于运行时共享”。)。 And I ignored the "Automatically declare stage instance" in the flash publish setting. 而且我忽略了Flash发布设置中的“自动声明舞台实例”。

When I just put this component on B's stage, exporting the fla is ok. 当我仅将此组件放在B的舞台上时,导出fla就可以了。 But when I changed the property which I reflected of the component, I got the error 1046. 但是,当我更改反映组件的属性时,出现错误1046。

 "1046: Type was not found or was not a compile-time constant: ShareLib_Button".

Does anyone have any ideas about it? 有人对此有任何想法吗?

Thanks in advance! 提前致谢!

Echo 回声

Although I don't have much experience with Runtime Shared Libraries, the error is indicating that it doesn't have access to your library when you compiled b.fla . 尽管我对运行时共享库​​没有太多经验,但错误表明在编译b.fla时它无权访问您的库。 Try the following: 请尝试以下操作:

In your a.fla file... 在您的a.fla文件中...

  1. Give the Sprite that holds the imported components a binding class 给持有导入组件的Sprite一个绑定类
  2. Edit the class file, declare the components yourself regardless of whether checked the "Automatically declare stage instances" 编辑类文件,自己声明组件,而不管是否选中了“自动声明舞台实例”

In your b.fla file... 在您的b.fla文件中...

  1. Open the Advanced ActionScript 3.0 Settings dialog box. 打开“高级ActionScript 3.0设置”对话框。
  2. Click the Library path tab. 单击库路径选项卡。
  3. Add the path to the RSL. 将路径添加到RSL。
  4. Set the default linkage to "Runtime shared library (RSL)" 将默认链接设置为“运行时共享库​​(RSL)”

The issue is because I tried to access an unknown property. 问题是因为我尝试访问未知属性。 I need to declare an instance name(Because of some reasons, we don't use instance names, I removed this setting, and fill an instance name), it works! 我需要声明一个实例名称(由于某些原因,我们不使用实例名称,我删除了此设置,并填写了实例名称),它可以工作!

Thanks everyone who cares this. 谢谢所有关心这个的人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM