Flex获得外部参数(URL参数)

关于这个问题,已经困惑了很久,也找了尝试了很多的方法, 但是大部分都是不能实现

 

可以实现的方法如下

 

首先找到Flex3生成的预览用的页面。一般是${defaultMXML}.html。

直接贴代码:

<script language="JavaScript" type="text/javascript">
......
if ( hasProductInstall && !hasRequestedVersion ) {
    ......
AC_FL_RunContent(
        "src", "playerProductInstall",
        "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
        ......
        "pluginspage", "http://www.adobe.com/go/getflashplayer"
    );
} else if (hasRequestedVersion) {
    // if we've detected an acceptable version
    // embed the Flash Content SWF when all tests are passed
    AC_FL_RunContent(
            "src", "XMonitor",
            "width", "100%",
            "height", "100%",
            "align", "middle",
            "id", "XMonitor",
            "quality", "high",
            "bgcolor", "#869ca7",
            "name", "XMonitor",
            "allowScriptAccess","sameDomain",
            "type", "application/x-shockwave-flash",
            "pluginspage", "http://www.adobe.com/go/getflashplayer",
            "FlashVars", "roomId=123"
    );
  } else {  // flash is too old or we can't detect the plugin
......
  }
// -->
</script>

 

注意看有颜色的地方。

FlashVars顾名思义就是Flash参数了。

后面的,绿色的就是参数名,对应的值自然就是参数值了。

当然了,还可以这么写:

"FlashVars","param1=1&param2=2"

和url一样的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值