- 浏览: 239348 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
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 2578双击Panel的标题可以实现最大化: HPanel.m ... -
flex4实例: Camera and video—a fake Twitter client
2010-03-31 13:37 1880<?xml version="1.0&quo ... -
flex4中 圆、矩形、线、图的显示实例
2010-03-29 17:31 1750<?xml version="1.0" ... -
flex4 解析XML 例子
2010-03-29 10:49 5070<?xml version="1.0" ... -
Hello-Flex.4 pdf 下载
2010-03-22 18:05 3759附件为:Hello-Flex.4 PDF和书中源代码 简介 B ... -
flexbuilder 和eclipse 整合 BlazeDs
2010-03-14 12:29 7186参考: http://livedocs.adobe.com/b ... -
Flex on Java book excerpt: Securing your Flex application
2010-03-12 15:03 1060摘自:http://www.adobe.com/devnet/ ... -
flex4 Spark Intranet Sample App
2010-03-10 18:17 1200flex4的一个实例: 地址: http://www.adob ... -
blazeds adobe教程地址
2010-03-06 16:30 878blazeds adobe教程地址: http://live ... -
flex,adodb官方视频教程地址
2010-01-15 14:19 1003flex4,adodb官方视频教程地址: http://www ... -
删除Flex Builder中没用的工作空间
2010-01-11 15:20 1282Flex Builder中 workspace很好用 ... -
flex4 in action pdf
2010-01-07 16:45 1756附件是flex4 in action pdf。
相关推荐
Flex 4 in a day About this document Introduction MXML 2009 Namespaces States New MXML Tags Declarations Library Definition Private Reparent DesignLayer Two-way data binding MXML Graphics...
[Tool] show DVR Credentiales 通过CVE-2018-9995漏洞获取部分暴露于网络的监控设备权限,与Shodan配合食用更佳。
Flex 4概述 (与学习资源) MXML 2009 新增MXML标签 改进的视图状态 (1) 改进的视图状态 (2) MXML图形元素与FXG Spark组件架构 Spark容器 Spark布局模型 Spark动画和特效组件 Pixel Bender集成 Spark文本...
fxg 矢量图编辑工具 实现基本绘图功能,可导出fxg源码
这是Advanced Flex4 第一章节的所有source codes。为FXG格式的工程文件。
家兔实验fxg.fxg
资源来自pypi官网。 资源全名:fxg2svg-0.1.3b0-py3.4.egg
资源分类:Python库 所属语言:Python 资源全名:fxg2svg-0.2.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
-和FXG类似的道理,用对象保存绘制操作,简化绘制过程 -多种拖拽工具,变形工具,编辑形状工具。单个拖动点也可单独使用。 -单文件自加载 -右键,双击,三击,键盘管理,鼠标手势 -影子生成器。FLASH也是可以模拟出...
这个项目提供了flex的Material皮肤,由as3实现,支持css虽然Apache Flex已提供了Android 4.x skins供使用,但最近的Android5,谷歌设计团队已提出了Material Design(原质设计)。引领了最新的界面设计。为了给广大...
午,=G-FxG有图a,故年中有3图3 证明:完全图可以因子分解。 06-c依起 K;=6n3=(2h-1)x3 S(己皇5号→ 叶彐(1→G中 因3为35) k6b2为2个国3÷于 图论班 姓名 学号 证明:完全图可以因子分解。 (c)=4 41与4正网 K4n+以4?合...
NULL 博文链接:https://olive009.iteye.com/blog/1931840
Windows server 2003的CD-KEY(序列号):JCGMJ-TC669-KCBG7-HB8X2-FXG7M (附:SQL2000的CD-KEY(序列号):SN:311-0432642 CD-KEY:H6TWQ-TQQM8-HXJYG-D69F7-R84VM) 方法二: 推荐按照下列步骤: 1. 在 SQLServer ...
本资料包括Java EE的一些项目源程序代码,可供参考,欢迎下载!
概述了我国目前粗煤泥分选现状,介绍了选煤行业应用的小直径煤泥重介旋流器、水介质旋流器、螺旋粗煤泥分选机及TBS干扰床分选机等粗煤泥分选设备的工作原理及其在行业中的应用情况。
本文,以Adobe 公司的Flex 技术为例,研究了基于四叉树的地图金字塔数据模型与瓦片双缓存技术、Flex 与地理信息服务的三种后台交互技术,以及Flex 的组件及其皮肤属性、动画、滤镜和FXG 图形格式等各种用户体验技术...
介绍了FX型风选机的结构特点、 主要技术参数及应用范围, 论述了在选煤厂中 FX型风选机的操作规程及技术维护方法和主要检修项目。
本资源包括JavaEE的一些基础代码源程序和一个购物网站源程序代码,欢迎大家下载参考学习!