flash 调用 脚本

tech2024-05-14  78

flash 调用 脚本

1. Create a new VB project.

1.创建一个新的VB项目。

2. Add the Shockwave Flash ActiveX control to your project. Create an instance of the control in your form.

2.将Shockwave Flash ActiveX控件添加到您的项目中。 在您的窗体中创建控件的实例。

3. Name the control "flashmov".

3.将控件命名为“ flashmov”。

4. Open the code window for your form (i.e the Form_Load event), and add the following code:

4.打开您的表单的代码窗口(即Form_Load事件),并添加以下代码:

'movie.swf is movie file flashmov.Movie = App.Path & "movie.swf"

Note that the above code assumes that the movie is in the same file as the vb project.

请注意,上面的代码假定影片与vb项目位于同一文件中。

5. You can call vb function from flash by using fscommand.

5.您可以使用fscommand从Flash调用vb函数。

For example, you can create a button in flash and insert the action:

例如,您可以在Flash中创建一个按钮并插入操作:

//the below code is for flash not for vb fscommand("execute");

6. Create the swf file.

6.创建swf文件。

7. The vb code that responds to the Flash command is:

7.响应Flash命令的vb代码为:

Private Sub flashmov_FSCommand(ByVal command As String, ByVal args As String) If command = "execute" then   MsgBox "Hey i can control vb" End Sub

8. The code displays a messagebox when you press the Flash button.

8.按下Flash按钮时,代码显示一个消息框。

翻译自: https://www.sitepoint.com/visual-basic-flash/

flash 调用 脚本

最新回复(0)