- 浏览: 249534 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
seraph_fd:
已取用,谢谢。但将base64编码换成了Hex编码。
AES 加密 PHP 和 JAVA 互通 -
洋葱骑士:
调了一下OK了可是运行的时候,访问不了网站,出现域名错误
flexbuilder 和eclipse 整合 BlazeDs -
洋葱骑士:
出错了。。。。-无法将“<mx:RemoteObject ...
flexbuilder 和eclipse 整合 BlazeDs -
raxliao:
这个只支持16位的密钥,而且密码不能只能aes的随机码。不过测 ...
AES 加密 PHP 和 JAVA 互通 -
cnfnidt:
wwwwwwwwww
flex4 解析XML 例子
组件:BoardDisplay.mxml
<?xml version="1.0" encoding="utf-8"?>
<Graphic xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
viewWidth="601" viewHeight="701" click="clickHandler(event)">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import org.hamcrest.mxml.collection.InArray;
[Bindable]
public var playerOneColor:uint=0xFF0000;
[Bindable]
public var playerTwoColor:uint=0x000000;
private static const EMPTY_COLOR:uint=0xFFFFFF;
[Bindable]
private var _boardData:Array;
[Bindable]
public var playerOneTurn:Boolean=true;
private static const P1:int=1;
private static const P2:int=2;
private static const NONE:int=0;
public function newGame():void
{
playerOneTurn=true;
var boardData:Array=new Array();
for(var row:int=0;row<6;row++){
boardData[row]=[NONE,NONE,NONE,NONE,NONE,NONE];
}
_boardData=boardData;
}
private function getColor(row:int,col:int,board:Array):uint
{
switch(_boardData[row][col])
{
case P1:
return playerOneColor;
case P2:
return playerTwoColor;
default:
return EMPTY_COLOR;
}
}
private function clickHandler(event:MouseEvent):void
{
var column:int=(event.localX-5)/100;
var row:int=getDropRow(column);
if(row==-1){
Alert.show("The column is full.","Illegal Move");
}else{
_boardData[row][column]=playerOneTurn?P1:P2;
playerOneTurn=!playerOneTurn;
_boardData=_boardData.slice(0);
}
}
private function getDropRow(column:int):int
{
for(var i:int=5;i>=0;i--)
{
if(_boardData[i][column]==NONE)
{
return i;
}
}
return -1;
}
]]>
</fx:Script>
<Group>
<Rect x="0" y="0" width="700" height="600">
<fill>
<SolidColor color="#8E6B23"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Rect>
<Ellipse x="5" y="4" width="90" height="90">
<fill>
<SolidColor color="{getColor(0,0,_boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="5" y="4" width="90" height="90">
<fill>
<SolidColor color="{getColor(0, 0, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="5" y="104" width="90" height="90">
<fill>
<SolidColor color="{getColor(1, 0, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="5" y="204" width="90" height="90">
<fill>
<SolidColor color="{getColor(2, 0, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="5" y="304" width="90" height="90">
<fill>
<SolidColor color="{getColor(3, 0, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="5" y="404" width="90" height="90">
<fill>
<SolidColor color="{getColor(4, 0, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="5" y="504" width="90" height="90">
<fill>
<SolidColor color="{getColor(5, 0, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="105" y="4" width="90" height="90">
<fill>
<SolidColor color="{getColor(0, 1, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="105" y="104" width="90" height="90">
<fill>
<SolidColor color="{getColor(1, 1, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="105" y="204" width="90" height="90">
<fill>
<SolidColor color="{getColor(2, 1, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="105" y="304" width="90" height="90">
<fill>
<SolidColor color="{getColor(3, 1, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="105" y="404" width="90" height="90">
<fill>
<SolidColor color="{getColor(4, 1, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="105" y="504" width="90" height="90">
<fill>
<SolidColor color="{getColor(5, 1, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="205" y="4" width="90" height="90">
<fill>
<SolidColor color="{getColor(0, 2, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="205" y="104" width="90" height="90">
<fill>
<SolidColor color="{getColor(1, 2, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="205" y="204" width="90" height="90">
<fill>
<SolidColor color="{getColor(2, 2, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="205" y="304" width="90" height="90">
<fill>
<SolidColor color="{getColor(3, 2, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="205" y="404" width="90" height="90">
<fill>
<SolidColor color="{getColor(4, 2, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="205" y="504" width="90" height="90">
<fill>
<SolidColor color="{getColor(5, 2, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="305" y="5" width="90" height="90">
<fill>
<SolidColor color="{getColor(0, 3, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="305" y="105" width="90" height="90">
<fill>
<SolidColor color="{getColor(1, 3, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="305" y="205" width="90" height="90">
<fill>
<SolidColor color="{getColor(2, 3, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="305" y="305" width="90" height="90">
<fill>
<SolidColor color="{getColor(3, 3, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="305" y="405" width="90" height="90">
<fill>
<SolidColor color="{getColor(4, 3, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="305" y="505" width="90" height="90">
<fill>
<SolidColor color="{getColor(5, 3, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="405" y="5" width="90" height="90">
<fill>
<SolidColor color="{getColor(0, 4, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="405" y="105" width="90" height="90">
<fill>
<SolidColor color="{getColor(1, 4, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="405" y="205" width="90" height="90">
<fill>
<SolidColor color="{getColor(2, 4, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="405" y="305" width="90" height="90">
<fill>
<SolidColor color="{getColor(3, 4, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="405" y="405" width="90" height="90">
<fill>
<SolidColor color="{getColor(4, 4, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="405" y="505" width="90" height="90">
<fill>
<SolidColor color="{getColor(5, 4, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="505" y="5" width="90" height="90">
<fill>
<SolidColor color="{getColor(0, 5, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="505" y="105" width="90" height="90">
<fill>
<SolidColor color="{getColor(1, 5, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="505" y="205" width="90" height="90">
<fill>
<SolidColor color="{getColor(2, 5, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="505" y="305" width="90" height="90">
<fill>
<SolidColor color="{getColor(3, 5, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="505" y="405" width="90" height="90">
<fill>
<SolidColor color="{getColor(4, 5, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="505" y="505" width="90" height="90">
<fill>
<SolidColor color="{getColor(5, 5, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="605" y="5" width="90" height="90">
<fill>
<SolidColor color="{getColor(0, 6, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="605" y="105" width="90" height="90">
<fill>
<SolidColor color="{getColor(1, 6, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="605" y="205" width="90" height="90">
<fill>
<SolidColor color="{getColor(2, 6, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="605" y="305" width="90" height="90">
<fill>
<SolidColor color="{getColor(3, 6, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="605" y="405" width="90" height="90">
<fill>
<SolidColor color="{getColor(4, 6, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
<Ellipse x="605" y="505" width="90" height="90">
<fill>
<SolidColor color="{getColor(5, 6, _boardData)}"/>
</fill>
<stroke>
<SolidColorStroke caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Ellipse>
</Group>
</Graphic>
应用mxml:
<?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/halo"
xmlns:comp="components.*"
width="100%" height="100%"
initialize="board.newGame()">
<fx:Script>
<![CDATA[
import mx.graphics.SolidColor;
private function getColor(playerOneTurn:Boolean):SolidColor
{
return new SolidColor(playerOneTurn?board.playerOneColor:board.playerTwoColor);
}
]]>
</fx:Script>
<s:layout>
<s:BasicLayout/>
</s:layout>
<s:Panel title="Only connec!" x="10" y="10" width="100%" height="100%">
<s:layout>
<s:VerticalLayout paddingLeft="5" paddingTop="5"
paddingBottom="5" paddingRight="5"/>
</s:layout>
<s:HGroup verticalAlign="middle">
<s:Button label="New Game" click="board.newGame()"/>
<s:Ellipse width="20" height="20" fill="{getColor(board.playerOneTurn)}"/>
<s:Label text="Player {board.playerOneTurn?'1':'2'} Turn"/>
</s:HGroup>
<comp:BoardDisplay id="board"/>
</s:Panel>
</s:Application>
发表评论
-
flex4实例: 自定义Panel 实现Panel的切换
2010-04-01 10:49 2634双击Panel的标题可以实现最大化: HPanel.m ... -
flex4实例: Camera and video—a fake Twitter client
2010-03-31 13:37 1917<?xml version="1.0&quo ... -
flex4中 圆、矩形、线、图的显示实例
2010-03-29 17:31 1787<?xml version="1.0" ... -
flex4 解析XML 例子
2010-03-29 10:49 5192<?xml version="1.0" ... -
Hello-Flex.4 pdf 下载
2010-03-22 18:05 3797附件为:Hello-Flex.4 PDF和书中源代码 简介 B ... -
flexbuilder 和eclipse 整合 BlazeDs
2010-03-14 12:29 7302参考: http://livedocs.adobe.com/b ... -
Flex on Java book excerpt: Securing your Flex application
2010-03-12 15:03 1090摘自:http://www.adobe.com/devnet/ ... -
flex4 Spark Intranet Sample App
2010-03-10 18:17 1279flex4的一个实例: 地址: http://www.adob ... -
blazeds adobe教程地址
2010-03-06 16:30 948blazeds adobe教程地址: http://live ... -
flex,adodb官方视频教程地址
2010-01-15 14:19 1042flex4,adodb官方视频教程地址: http://www ... -
删除Flex Builder中没用的工作空间
2010-01-11 15:20 1347Flex Builder中 workspace很好用 ... -
flex4 in action pdf
2010-01-07 16:45 1800附件是flex4 in action pdf。
相关推荐
Flex4在图形表现上也有了显著的提升,引入了MXML Graphics和FXG(Flash XML Graphics),让开发人员可以更方便地创建和管理复杂的图形。同时,CSS(层叠样式表)的引入和Flex Themes(主题)的创建和应用,也使得...
标题中的"CVE-2018-9995_dvr_credentials.rar_CVE-2018_FXG_burp CVE-2018-999"提及了几个关键概念,首先,CVE(Common Vulnerabilities and Exposures)是用于识别网络安全漏洞的标准化系统。"CVE-2018-9995"指的是...
- **FXG支持**:FXG是一种图形交换格式,Flex4支持FXG格式的导入和导出,这为设计人员提供了更多的灵活性。 - **更新的布局模型、2D旋转、3D支持**:Flex4在布局模型上进行了改进,并增加了对2D旋转和3D效果的支持,...
- **FXG**:FX Graphics(FXG)是一种轻量级的矢量图形格式,用于在Adobe Flex应用程序中创建和嵌入矢量图形资源。FXG的引入进一步提升了开发效率,使得设计师可以直接使用该格式导出图形资源而无需经过复杂的转换...
- **FXG**:FXG是一种用于描述矢量图形的语言,Flex4增加了对FXG的支持,使图形设计更加灵活。 - **编译器性能**:Flex4的编译器性能得到了显著优化,加快了应用的构建速度。 - **双向绑定**:Flex4支持双向数据绑定...
- **MXML图形元素与FXG**:Flex 4引入了新的MXML图形元素,允许开发者直接在MXML中定义图形对象,并支持FXG格式的导入导出,进一步增强了Flex在图形处理方面的能力。 - **高级CSS Selector**:为了更好地控制样式,...
通过引入全新的Spark组件模型、MXML2009语言、FXG格式等,Flex4实现了框架的全面进化。其中,Spark组件模型是Flex4的一个重要革新,它优化了组件的渲染和内存管理,使得应用运行更加流畅,同时支持更复杂的用户界面...
- **FXG 和 MXML 图形**:讲述了如何使用 FXG 文件或 MXML 代码来创建图形元素。 - **效果介绍**:讲解了 Flex 中的效果系统及其基本概念。 - **Spark 效果**:介绍了 Spark 框架下的效果实现方法。 - **使用 MX ...
随书资源代码包含了书中各个章节的实例代码,读者可以通过这些代码深入了解Flex 4的使用方法,学习如何创建和管理项目,设置组件属性,处理事件,实现数据绑定,以及运用动画效果等。通过实际操作,能加深对Flex 4...
在Flex 4中,你可以使用ActionScript类来实现这些组件,而不是依赖Flex的MXML组件。Cairngorm提供了如`Command`, `Locator`, `Event`, `Proxy`等核心类,它们是构建MVC结构的基础。 3. **处理“error”错误**: ...
- **FXG和MXML图形**:用于创建矢量图形。 - **效果介绍**:包括动画和其他视觉效果。 - **Spark效果**:专为 Spark 组件设计的效果。 - **使用MX效果**:适用于旧版 MX 组件的效果。 - **视图状态**:根据条件更改...
“fxg2svg”是一个Python库,主要功能是将FXG(Flex Graphics)格式的文件转换为SVG(Scalable Vector Graphics)格式。FXG是一种用于描述二维图形和图像的数据格式,常用于Adobe Flex项目中。而SVG则是一种开放标准...
- **图形和动画**:介绍了如何使用FXG和MXML图形来增强UI,以及如何添加各种视觉效果。 以上仅为Flex 4.6部分核心知识点的概述,实际上Flex 4.6包含的内容远不止这些。对于想要深入了解Flex 4.6的开发者而言,官方...
通常,一个Flex项目会包含FLA或FXG(图形交换格式)文件用于设计界面,AS3源代码文件(.as)用于编写业务逻辑,配置文件(如flex-config.xml)用于编译设置,以及可能的资源文件(如图片、声音或XML数据)。...
fxg 矢量图编辑工具 实现基本绘图功能,可导出fxg源码
### Flex4.5学习笔记知识点总结 #### 一、Flex基础——布局 **知识点1:Flex布局** - **垂直布局** (`s:VerticalLayout`): 控件垂直排列。 - **水平布局** (`s:HorizontalLayout`): 控件水平排列。 - **平铺布局**...
资源分类:Python库 所属语言:Python 资源全名:fxg2svg-0.2.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
这是Advanced Flex4 第一章节的所有source codes。为FXG格式的工程文件。