flex 和php 通信
php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>flex login</title>
</head>
<body>
<?php
$return="";
if(isset($_POST[username]) && isset($_POST[userpwd])){
if ("User"==$_POST[username] && "123456"==$_POST[userpwd])
$return="ok";
else
$return="error";
}
$xml_return = '<users>';
$xml_return.= '<a>'.$return.'</a>';
$xml_return.= '</users>';
echo $xml_return;
?>
</body>
</html>
Flex:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalAlign="center"
verticalAlign="middle">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
private function goLogin():void
{
login.send();
}
private function resultHandler(event:ResultEvent):void
{
Alert.show(event.result.html.body.users.a.toString());
}
]]>
</mx:Script>
<mx:HTTPService id="login"
method="POST"
showBusyCursor="true"
url="http
相关文档:
问题描述:
从php界面insert数据到mysql,只能输入偶数个汉字不能输入奇数个汉字,输入奇数个汉字后报“Data too long for column ”错误,并没有更改数据库数据。到数据库查看,发现汉字都是乱码。但是php界面显示汉字正常(当然显示的都是偶数个汉字,奇数个汉字都没有写入数据库)。
解决思路:
1.更改my.i ......
flex整合spring也有很多的例子,其实有很多例子很复杂。我在这就给大家介绍个最简单的,很实用。
说明下:flex完全可以代替struts,下面的例子能证明。有人会问了,和其他框架怎么样整合。spring都能整合了,其他框架你要不会整合我也都无语了。
不多说了,看代码就知道简单不!
flex--sdk 3.2以上
jdk 1.5 以上
spring ......
flex弹出对话框示例程序分为两部分:Main.mxml和SimpleTitleWindowExample.mxml,其中Mail.mxml为主程序文件,SimpleTitleWindowExample.mxml为对话框文件,可以通过修改SimpleTitleWindowExample.mxml文件来修改对话框上的组件。
Main.mxml
<?xml version="1.0" encoding="ut ......
1.复制内容到系统剪贴板
System.setClipboard(strContent);
2.复制一个ArrayCollection
//dummy solution( well, it works )
var bar:ArrayCollection = new ArrayCollection();
for each ( var i:Object in ac ){
bar.a ......
/*
author: yangyu@sina.cn
description: 交换数组中两个元素的位置,元素包括key和value,具体用法见下面的例子
*/
$arr = array(11=>'a',22=>'b',33=>'c',44=>'d');
$res = array_exchange($arr, 11 ,33);
//example:
echo '<pre>';print_r ($res);echo '</pre>';
function array_excha ......