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如下:

ContractedBlock.gif ExpandedBlockStart.gif 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如下

ContractedBlock.gif ExpandedBlockStart.gif MaxScript Flash
try (DestroyDialog RolloutFlashGUI) catch()
Rollout RolloutFlashGUI
"FlashGUI" width:270 height:270
(
activeXControl flashControl
"ShockwaveFlash.ShockwaveFlash" height:240 width: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.

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

转载于:https://www.cnblogs.com/sitt/archive/2011/08/23/2150412.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值