flex图表数据动态更新效果示例
<?xml version="1.0"?>
<!-- charts/BasicSeriesSlideEffect.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<!--[CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var expenses1:ArrayCollection=new ArrayCollection([{Month: "Jan", Income: 2000, Expenses: 1500}, {Month: "Feb", Income: 1000, Expenses: 200}, {Month: "Mar", Income: 1500, Expenses: 500}]);
[Bindable]
public var expenses2:ArrayCollection=new ArrayCollection([{Month: "Jan", Income: 1200, Expenses: 800}, {Month: "Feb", Income: 2500, Expenses: 300}, {Month: "Mar", Income: 575, Expenses: 490}]);
public var year:int=1;
public function changeProvider():void
{
if (year == 2)
{
myChart.dataProvider=expenses1;
b1.label="View Second Year Data";
lbl.text="First Year Data";
year=1;
}
else
{
myChart.dataProvider=expenses2;
lbl.text="Second Year Data";
b1.label="View First Year Data";
year=2;
}
}
]]-->
</mx:Script>
<!-- Define chart effects -->
<mx:SeriesSlide id="slideIn"
duration="1000"
direction="up"/>
<mx:SeriesSlide id="slideOut"
duration="1000"
direction="down"/>
<mx:Panel title="Column Chart with Basic Series Slide Effect"
layout="absolute"
height="493">
<mx:Label id="lbl"
text="First Year Data"
width="233.5"
height="44"
fontSize="24"
color="#091D96"
top="5"
right="10"/>
<mx:ColumnChart id="myChart"
dataProvider="{expenses1}">
<mx:horizontalAxis>
<mx:C
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.collections.ArrayCollection;
......
在flex开发环境中编写as3代码是很方便的,借助flex开发环境代码都有自动提示功能,但是在做flash游戏的时候,在涉及到对话框的时候,我遇到一个很棘手的问题,就是在美工用flash cs布局好了的界面,我在界面上命名了实例(如textfield类型 var nameText:String),在导出这个类(guestDialog)的时候(这个类继承自MovieClip ......
flex3 中的中文字体只支持有限的几种,要么嵌入字体,要么就使用这几种:
支持一些默认的英文字体,如Arial、Times New Roman、Courier New、Georgia、Verdana等。
支持的中文字体:宋体、华文楷体、华文细黑、华文仿宋、华文中宋。
Flex3 中即使客户端装了很多字体,能使用的也只能是上面几种字体,除非嵌入字体。
但是 ......
<?xml version="1.0"?>
<!-- charts/ColumnWithDropShadow.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:flash="flash.filters.*">
<mx:Script>
<!--[CDATA[
import mx.collections.ArrayCollection;
[Bindab ......