如何创建包含 Flash CS5 中的资源的可重用组件
我需要为画廊创建幻灯片。我不知道的一件事是如何创建可重用的组件。 例如,我想创建 3 个组件 ImageLoader、Dock(由 ImageLoaders 组成)和 SlideShow(由 Dock 和 ImageLoaders 组成)。
ImageLoader 它是一个加载图像的容器,并在加载时显示一些动画。
Dock 是一个包含一些 ImageLoader 的容器,它用于创建可供选择的拇指图像的 Dock。
SlideShow 它是一个只有很少 ImageLoaders 的容器,它用于将图像预加载到 ImageLoaders 并在鼠标单击时更改它们。
我需要所有这些组件都可以通过操作脚本访问,这样我就可以创建它们的新实例。
示例代码:
im1 = new ImageLoader('../im1s.jpg');
im2 = new ImageLoader('../im2s.jpg');
dock = new Dock(new Array(im1,im2));
ss = new SlideSHow(new Array(im1,im2),dock);
ss.init();
PS 我是 Flash 新手
I need to create slideshow for gallery. And one thing that I don't know is how to create reusable components.
For example I want to create 3 components ImageLoader, Dock(that consists from ImageLoaders) and SlideShow(that consists from Dock and ImageLoaders).
ImageLoader it is a container which loads image and while it loading showing some animation.
Dock it is a container which has a few ImageLoaders, it used to create Dock of thumbs images to chose.
SlideShow it is a container which have few of ImageLoaders, it is used to preload images to ImageLoaders and the change them on mouse click.
I need that all of this components was accessible form action script, so I can create new instances of them.
Example code:
im1 = new ImageLoader('../im1s.jpg');
im2 = new ImageLoader('../im2s.jpg');
dock = new Dock(new Array(im1,im2));
ss = new SlideSHow(new Array(im1,im2),dock);
ss.init();
P.S. I am new in Flash
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来你必须学习一些动作脚本 oop。如果你熟悉一些面向对象的语言,比如 Java 或 Objective-C,这应该不是问题……你问的是如何开发 OOP,如果我是对的,那就很多了! :)
首先,我会在此处查看 kirupa 的 OOP 课程,还有 lee brimelow 的精彩教程< a href="http://gotoandlearn.com/index.php" rel="nofollow">此处
有了这些,你就可以相对顺利地进行了。
关于这方面的一本很棒的书是我强烈推荐的学习actionscript 3。
希望它有帮助...
干杯
Well it seems what you have to learn is some actionscript oop. If you are familiar with some OO language such Java or objective-C this shouldn't be a problem… What you are asking is how to develop OOP, if I´m right, and that´s a lot!! :)
First I would check kirupa´s lessons on OOP here and lee brimelows great tutorials here
With these you are relatively good to go.
A great book about this is Learning actionscript 3 I can highly recommend.
Hope it helps...
Cheers
我找到了我的问题的答案。以下是在 Flash 中创建可重用组件的教程:参见此处
I found the answer on my question. Here is tutorial for creating reusable components in flash: See here