flash 调用 脚本
This tutorial shows you how to use the swapDepths function.
本教程向您展示如何使用swapDepths函数。
Think of a scenario where you have 3 pictures aligned one on top of the other, and you want to move the picture that underlies the top image. There are many ways to do this in Flash, and here, we’ll use the swapDepths feature.
考虑一种场景,其中3张图片彼此对齐,并且您想要移动位于顶部图片下方的图片。 在Flash中有很多方法可以做到这一点,在这里,我们将使用swapDepths功能。
Download the sample files here.
在此处下载示例文件 。
1. In the above example I’ve used three rectangular movielips. I have given each one instance names: "red", "blue", and "green".
1.在上面的示例中,我使用了三个矩形movielip。 我给了每个实例名称:“红色”,“蓝色”和“绿色”。
2. These are the actions I’ve applied to each button:
2.这些是我应用于每个按钮的操作:
Blue button:
蓝色按钮:
on (press){_root.blue.swapDepths(1);}Red button:
红色按钮:
on (press){_root.red.swapDepths(1);}Green button:
绿色按钮:
on (press){_root.green.swapDepths(1);}Usage:
用法:
myMovieClip.swapDepths(depth) myMovieClip.swapDepths(target)Parameters:
参数:
targetThis refers to the instance of the movie clip whose depth is swapped by the instance specified in myMovieClip. Both instances must have the same parent movie clip.
这是指影片剪辑的实例,其深度由myMovieClip指定的实例交换。 两个实例必须具有相同的父影片剪辑。
depthThis refers to the number specifying the depth level where MovieClip is to be placed.
这是指指定要放置MovieClip的深度级别的数字。
This swaps the stacking, or z order (depth level), of the specified instance (MovieClip) with either:
这会将指定实例( MovieClip )的堆叠或z顺序(深度级别)交换为:
the movie that’s specified by the target parameter, or 目标参数指定的电影,或者 the movie that currently occupies the depth level specified in the depth parameter. 当前占据depth参数中指定的深度级别的影片。Both movies must have the same parent movie clip. Swapping the depth level of movie clips has the effect of moving one movie in front of, or behind, the other. And if a movie is tweening when this method is called, the tweening is stopped.
两部影片必须具有相同的父级影片剪辑。 交换影片剪辑的深度级别具有将一部影片移到另一部影片之前或之后的效果。 如果在调用此方法时影片正在补间,则补间将停止。
翻译自: https://www.sitepoint.com/script-swapping-images-flash/
flash 调用 脚本
相关资源:JAVA上百实例源码以及开源项目