c# 加载flash脚本
Download the sample files here.
Note that in this tutorial, I’ll assume that you know how to create a button.
请注意,在本教程中,我将假设您知道如何创建按钮。
1. Create two buttons, one labelled "Load movie1", the other labelled "LoadMovie2".
1.创建两个按钮,一个标记为“ Load movie1”,另一个标记为“ LoadMovie2”。
2. Create a new blank movie clip — a clip with no objects in it.
2.创建一个新的空白影片剪辑,即其中没有对象的剪辑。
3. Give this new blank movie clip an instance name of "dummy".
3.为这个新的空白影片剪辑指定实例名称“ dummy”。
4. Right click the "load movie1" button, select "actions", and insert the following:
4.右键单击“加载movie1”按钮,选择“动作”,然后插入以下内容:
on (release)
{
loadMovie ("mov1.swf", "/dummy");
}
This code loads the swf file called mov1.swf into target "/dummy". You can replace this reference with on to you own swf file, which should be located in the same directory.
此代码将名为mov1.swf的swf文件加载到目标“ / dummy”中。 您可以将此引用替换为on自己的swf文件,该文件应位于同一目录中。
5. Right click the "load movie2" button, select "actions", and insert this action:
5.右键单击“加载movie2”按钮,选择“动作”,然后插入以下动作:
on (release)
{
loadMovie ("mov2.swf", "/dummy");
}
Press ctrl+enter to test the movie.
按ctrl + enter测试影片。
The load movie syntax is:
加载影片的语法为:
loadMovie(url [,location/target, variables]]);
url: the path of the file.
url:文件的路径。
location/target:
location: an optional argument that specifies the level into which the movie is loaded.
location:一个可选参数,指定影片加载到的级别。
The loaded movie inherits the position, rotation, and scale properties of the targeted movie clip.
加载的影片将继承目标影片剪辑的位置,旋转和缩放属性。
variables: an optional argument that specifies a method for sending variables associated with the movie to load.
变量:一个可选参数,指定用于发送与要加载的电影关联的变量的方法。
The argument must be the string "GET" or "POST." Omit these if there are no arguments.
参数必须是字符串“ GET”或“ POST”。 如果没有参数,请忽略这些。
c# 加载flash脚本