zoukankan      html  css  js  c++  java
  • MaxScript使用Flash做界面

    自max9出现了64位,同时微软舍弃了ActiveX控件,大部分ActiveX控件在64位的max下就没得用了。

    而微软之外的公司的ActiveX控件,也大多没有64位的,比如Flash,不过好在现在FlashPlayer11的64位版本出现了。于是,又可以在MaxScript里面使用Flash做界面了。64位的Max需要安装64位的FlashPlayer http://labs.adobe.com/downloads/flashplayer11.html

    Flash里面使用fscommand可以发送字符串给Max,fscommand有两个参数,会一起发送。这里提供一个范例,将两个文字输入框的内容发送到Max。

    ActionScript如下:

    FsCommand
    function theButtonClick(event:MouseEvent) 
    {
    var command = "";
    var args = "";
    if(textBoxCommand.text != "")
    {
    command
    = textBoxCommand.text;
    textBoxCommand.text
    = "";
    }
    else
    {
    command
    = "MessageBox \"None\"";
    }
    if(textBoxArg.text != "")
    {
    args
    = textBoxArg.text;
    textBoxArg.text
    = "";
    }
    fscommand(command,args);
    }
    theButton.addEventListener(MouseEvent.CLICK,theButtonClick);

      

    MaxScript如下

    MaxScript Flash
    try (DestroyDialog RolloutFlashGUI) catch()
    Rollout RolloutFlashGUI
    "FlashGUI" 270 height:270
    (
    activeXControl flashControl
    "ShockwaveFlash.ShockwaveFlash" height:240 240 align:#center
    on flashControl FSCommand command args
    do
    (
    print command
    execute command
    print args
    )

    on RolloutFlashGUI open
    do
    (
    localPath
    = GetFilenamePath (GetSourceFileName())
    flashControl.movie
    = localPath + "FlashGUI.swf"
    )

    timer theTimer
    "" interval:500

    on theTimer tick
    do enableAccelerators = false
    )
    CreateDialog RolloutFlashGUI

      

    源文件下载,该flv文件是FlashCS5.5.

    https://files.cnblogs.com/sitt/FlashGUI.zip

  • 相关阅读:
    【解题报告】CF939E
    【解题报告】洛谷P4653 [CEOI2017]Sure Bet
    【解题报告】洛谷P3406 海底高铁
    【解题报告】洛谷P1097 统计数字
    微信开发者工具下载和安装
    STS下载和安装
    HBuilderX下载和安装
    Navicat Premium下载与安装
    PLSQL下载和安装
    Oracle 11g的安装
  • 原文地址:https://www.cnblogs.com/sitt/p/2150412.html
Copyright © 2011-2022 走看看