flash 调用 脚本_Flash脚本-在Flash中交换图像

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:

参数:

target

This 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指定的实例交换。 两个实例必须具有相同的父影片剪辑。

depth

This 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 调用 脚本

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值