flex通过url传参至as脚本中
(注:采用fb4 beta1开发,由于兼容问题,可以适当加以修改放到自己的环境中,测试的时候需要放到服务器上面,本人的测试url为
http://127.0.0.1/astest/asjs.html?msnum=13112345678)
mxml文件:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" creationComplete="application1_creationCompleteHandler(event)" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
private var tempParam:String;
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
var param:String=ExternalInterface.call("test");
if(param!=""){
tempParam=param;
}
handlerParam();
}
private function handlerParam():void{
testText.text=tempParam;
}
]]>
</fx:Script>
<s:TextInput id="testText" x="23" y="34" width="198" height="31"/>
</s:Application>
index.template.html模板文件需要添加的js代码:
var tempparam="";
var localurl2 = location.href;
function getParameter(paraStr, url)
{
var result = "";
var str = "&" + url.split("?")[1];
var paraName = paraStr + "=";
if(str.indexOf("&"+paraName)!=-1)
{
if(str.substring(str.indexOf(paraName),str.length).indexOf("&"
相关文档:
Testing Flex applications with FlexMonkey 1.0
Without automation, testing the UI components of your Flex
application can be tedious and time consuming. Adobe includes an
automation framework in Flex to enable developers to create automated
tests that operate at the GUI level. FlexMonkey
1.0 i ......
转自:http://blog.csdn.net/meteorlWJ/archive/2008/03/27/2223239.aspx
这一次的Flex 实践将要实现以下功能:
1、自定义一个简单的 Flex 组件
2、创建一个Index. mxml 来调用该组件
&n ......
一、HTTPService
程序代码:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<!--[CDATA[
private function initializeHandler(event:Event):void {
countriesSer ......
<?
xml
version
=
"1.0"
?>
<!-- Simple example to demonstrate the Alert control. -->
<
mx:Application
xmlns:mx
=
"http://www.adobe.com/2006/mxml"
>
&n ......
转载于:http://hi.baidu.com/wei83523408/blog/item/69a1f4ed0e8102ddb21cb176.html
一、
准备工作:
所需要的软件
Eclipse 3.3 + FlexBuilder3 beta2
插件版
+MyEclipse 6.0 +Lcds + Tomcat
5
二、
安装过程:
1.
安装
MyEclipse6.0(
在此不再详述
)
。
2. ......