JSFL 中的拖放影片剪辑事件? (闪存IDE)
最近我尝试用 JSFL 做一些实验性的事情,我想知道当一个组件(我制作的)或影片剪辑从舞台上的库中拖动时是否可以监听事件。
我想创建一些东西,我将获得一个组件并将其放在MC上。当组件被放到 mc 上时,组件会将 mc 保存为某个变量中的引用。
也许事件不是解决办法,但我不知道这是否可能或如何以其他方式做到这一点。我希望有人可以帮助我
提前开始,谢谢
Lately im trying to do some experimental things with JSFL, and i was wondering if it is possible to listener for an event when a component (that i have made) or movieclip is dragged from library on the stage.
i want to create something that i'll get a component and drop it on a mc. when the component is dropped on the mc the component will save the mc as a reference in some var.
maybe with events isnt the way to go but i have no clue if this is possible or how to do it another way. i hope someone can help me get started
thx in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然您可以监听文档事件,但我不您不认为可以将组件放到影片剪辑上并获取影片剪辑的引用。
您可以做的是编写一个命令,首先存储所选影片剪辑的引用,然后使用 mc 参数设置将组件添加到舞台。
这是一个使用 Button 组件的简单示例。该命令获取所选 mc 的名称,然后添加一个按钮并将 mc 的名称设置为按钮名称。
看看 fl.componentPanel,ComponentInstance 和 参数以获得更好的图片。
华泰
Although you can listen for document events, I don't think you can drop a component on to a movieclip and get the reference of the movieclip.
What you could do though is write a command that first stores the reference of the selected movie clip and then adds the component to the stage, with the mc parameter setup.
Here's a quick example using the Button component. The command get's the name of the selected mc then adds a button and sets the name of the mc as the Button name.
Have a look at fl.componentPanel, ComponentInstance and Parameter to get a better picture.
HTH