JSFL:删除与特定颜色匹配的所有笔画?
我正在寻找一个 jsfl 函数,它可以选择框架上的所有项目并删除与特定颜色匹配的所有笔划,例如 #0000ff
基本上我用铅笔工具使用红色铅笔笔划做了很多笔记。但当我完成后,我只想告诉闪光灯从屏幕上删除所有红色笔画,并保持其他所有内容完好无损。有什么解决办法吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好问题!
查看 JSFL 文档中的 Document 对象,我发现检索 Stroke 的唯一方法是通过 document.getCustomStroke() ,这很烦人。理想情况下,形状对象会存储描边和填充信息,但它不会:(
我尝试使用数组控制选择:
这不起作用。
然后我尝试使用以下方法选择每个对象
,但这并不是很有帮助,因为注释可以采取任何形状,
因此,可能会错过注释左上角的点击
选择。
仅仅为了获得选择而循环遍历每个像素是行不通的。
简短的回答不是因为检索描边颜色的唯一方法
是通过文档选择。
不过,有一些解决方法:
在 IDE 中,使用“查找和替换”,选择“颜色”而不是“文本”
并将笔记颜色替换为透明的颜色。很遗憾
这不是一个解决方案。它只会隐藏笔记,不会删除它们。
sonic.net)
方便从jsfl获取笔记:将所有笔记放在当前
时间轴放在一层中并给它一个暗示性的名称,比如“_notes”,然后就可以了
删除该层。
例如,
希望有人可以提供一个很好的技巧,用于在 jsfl 中按颜色选择对象。您可以在 IDE 中执行很多操作,但是 无法从 JSFL 执行这些操作 :(
HTH
Good question !
Looking at the Document object in the JSFL documents I see the only way to retrieve a Stroke is through document.getCustomStroke() which is annoying. Ideally the Shape Object would store Stroke and Fill information, but it doesn't :(
I tried to control the selection using arrays:
That didn't work.
Then I tried to select each object using
but that's not very helpful as the notes can take any shape,
so a click at the note's top left corner might be a missed
selection.
Looping through each pixel just to get a selection wouldn't work.
Short answer is not because the only way to retrieve the stroke color
is through the document selection.
There are some workarounds though:
In the IDE, use Find and Replace, choose Color instead of Text
and replace your note color with something transparent. Unfortunately
this isn't much of a solution. It will just hide the notes, not delete them.
(source: sonic.net)
Make it easy to get the notes from jsfl: Place all the notes in the current
timeline in one layer and give it a suggestive name, say '_notes', then just
delete that layer.
e.g.
Hopefully someone can provide a nice hack for selecting objects by colour in jsfl. There are quite a few things you can do in the IDE, but can't do them from JSFL :(
HTH
我最近需要处理一些旧的 FLA 文件,并且必须执行类似的操作。
下面的代码将查找当前文档的所有图层和框架中的所有匹配笔划。
在 Flash CS6 中测试。
请注意,这不会将文档标记为已修改,因此您需要以某种方式修改文档才能保存。
I've recently needed to process some old FLA files and had to do something similar.
The code below will find all matching strokes in all layers and frames of the current document.
Tested in Flash CS6.
Note that this won't mark the document as modified, so you will need to modify the document in some way to be able to save.