Flex中的Label实现鼠标手型及下划线
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:Script>
<![CDATA[
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
[Bindable]
private var myData:ArrayCollection = new ArrayCollection([{userName:"Gasol",country:"西班牙"},
{userName:"Nashi",country:"澳大利亚"},
{userName:"Yaoming",country:"中国"}]);
internal function test(event:MouseEvent):void {
Alert.show("internal click!"+event.target.data);
var ld:DataGridListData = event.target.listData as DataGridListData;
trace(ld.columnIndex);
}
]]>
</mx:Script>
<mx:DataGrid dataProvider="{myData}">
<mx:columns>
<mx:DataGridColumn headerText="姓名">
<mx:itemRenderer>
<mx:Component>
<mx:Label buttonMode="true" mouseChildren="false"
click="outerDocument.test(event)"
htmlText="<u>{data.userName}</u>">
</mx:Label>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText=
相关文档:
经常会设计一个这样的功能,比如更改个性头像,这个个性头像最终需要上传到服务器的文件系统中,但是程序希望在用户选择后直接有个预览,然后用户才进行上传。这个功能技术上其实就是需要对本地的文件能进行读取。在flash player10中有个类FileReference的类可以实现这个功能,而实现对文件读取的接口是load( )函数,要注意 ......
Flex端代码:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
>
<fx:Script>
<!--[C ......
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
width="550" height="400">
<mx:Script>
<![CDATA[
&n ......
服务器端代码,amfphp的services目录下建立readData.php文件,代码如下
<?php
class ReadDB
{
function getData()
&nb ......