Flex读取浏览器参数
这个类提供的功能有:
从浏览器中获取完整的URL
主机名
当前所使用的协议
端口
主域名后面的路径
参数值
原文地址:http://www.flexpasta.com/index.php/2008/03/15/getting-url-parameters-host-name-port-in-flex-actionscript/
package com.flexpasta.utils
{
import flash.external.ExternalInterface;
import mx.core.Application;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
public class HTTPUtil
{
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* @private
*/
public function HTTPUtil()
{
super();
}
/**
* Returns the current url that the swf player lives in
*
*/
public static function getUrl():String
{
return ExternalInterface.call("window.location.href.toString");
}
/**
* Returns the current host name.
* example: http://www.flexpasta.com/?x=1&y=2 would return www.flexpasta.com
*/
public static function getHostName():String
{
return ExternalInterface.call("window.location.hostname.toString");
}
/**
* Returns the current protocol, such as http:, https:, etc
*
*/
public static function getProtocol():String
{
return ExternalInterface.call("window.location.protocol.toString");
}
/**
* Gets the current port for the url
*/
public static function getPort():String
{
return ExternalInterface.call("window.location.port.toString");
}
/**
* Gets the context following the base of the url
* Example http://www.flexpasta.com/test?x=1&y=2 would return /test
*/
public static function getContext():String
{
return ExternalInterface.call("window.location.pathname.toString");
相关文档:
注:第一列是带Checkbox的Tree。
还有问题请教各位:
labelField是元素对象的属性是显示不了(carInfo.car_name),好像只可显示同级的属性怎么解决?希望各位能帮助我,Thanks!
<mx:AdvancedDataGrid id="adg" width="100%" height="100%" dataProvider="{instance.cars}"
&n ......
《Flex SDK 4(Gumbo)浅析ASDoc - Flash Builder 4配置篇》介绍了如何在Flash Builder 4里面配置、运行ASDoc。
本篇文章介绍一些比较常用的ASDoc Tags,只有搞清楚了如何使用ASDoc Tags才能让我们生成一些我们想要的ASDoc文档。
我在这里只列举了一些比较常用的ASDoc Tags:
@param paramName d ......
最近遇到了flex 的安全沙箱问题,找了很多资料发现不是都是和我,我的程序需要socket连接,而大多数讲的都是跨域文件读取的。我先把两种方法都总结出来:
跨域文件读取
方法一:在目标服务器上布署crossdomain.xml文件(我用的此方法很管用,放上就没问题了) 需要远程服务根目录定义有crossdomain.xml文件,如下:
<?x ......
研究E4X与Flex的关系,所以打算总结一下,有说的不对的地方,还请大家多多原谅。
一、最简单模式:Flex通过httpservice和dataProvider进行数据传输
Xml格式如下:
<?xml version="1.0" encoding="utf-8" ?>
<Result>
<NodeA>value1</NodeA>
<NodeB>valve2</NodeB>
…&he ......
本章是Flex 4 SDK 新特性教程系列的第4章。本章介绍了MXML 2009新增的标签,包括:
Declarations
Vector
Library
Definition
Private
Reparent
<Declarations />
Declarations标签是Flex 4中最常用的新增标签。
在Flex 3中,对于一个MXML组件的直接子元素,可以有以下几种情况:
1. 属性标签,例如:
< ......