我们在用Flex进行开发的时候,有时候需要实现像html 细线表格的那种效果,原理很简单,但是需要一些技巧,不然的话很难控制线条的粗细,其实只需要设置几个样式就能搞定,一下是源码,大家可以运行一下看看效果<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Style>
Grid
{
border-style:solid;
border-color:red;
border-sides:right;
horizontal-gap:1;
vertical-gap:1;
background-color:red;
}
GridItem
{
background-color:white;
}
</mx:Style>
<mx:Grid width="387" x="347" y="225">
<mx:GridRow width="100%">
<mx:GridItem width="50%">
<mx:Spacer width="50"/>
</mx:GridItem>
<mx:GridItem width="50%">
<mx:Spacer height="50"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem width="50%">
<mx:Button label="Button"/>
</mx:GridItem>
<mx:GridItem wi ......
我们在用Flex进行开发的时候,有时候需要实现像html 细线表格的那种效果,原理很简单,但是需要一些技巧,不然的话很难控制线条的粗细,其实只需要设置几个样式就能搞定,一下是源码,大家可以运行一下看看效果<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Style>
Grid
{
border-style:solid;
border-color:red;
border-sides:right;
horizontal-gap:1;
vertical-gap:1;
background-color:red;
}
GridItem
{
background-color:white;
}
</mx:Style>
<mx:Grid width="387" x="347" y="225">
<mx:GridRow width="100%">
<mx:GridItem width="50%">
<mx:Spacer width="50"/>
</mx:GridItem>
<mx:GridItem width="50%">
<mx:Spacer height="50"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem width="50%">
<mx:Button label="Button"/>
</mx:GridItem>
<mx:GridItem wi ......
Flex Builder 快捷键
Adobe在开发Flex最有利的工具就是Flex Builder,快速键对一般开发者来说都非常有用,很多快速键与组合键是会与其他软体或系统都有雷同之处,譬如 Ctrl + C 就是复制,Ctrl + V 就是贴上。若你有注意到就会不难发现,其实Flex Builder有很多与Eclipse编辑工具也是有许多相似之处。 多加善以利用吧!
Ctrl-F11
: 执行(Run)
F11
: 除错(Debug)
Ctrl-Alt-Down
: 重复目前所在编辑列(Repeat current line )
Alt-Up
: 移动本列,或选择列往上移动(Move line (or selection) up )
Alt-Down
: 移动本列,或选择列下往移动(Move line (or selection) down )
Ctrl-Click
: 移至定义区(Go to definition (also F3) )
Ctrl-D
: 删除本列(Delete line )
Alt-/
: 文字自动完成(Word completion (cycles through possible matches))
Ctrl-Up
: 捲轴向上(Scroll up )
Ctrl-Down
: 捲轴向下(Scroll Down )
Ctrl+Shift+L
(组合键)
(Activate Editor) F12
(Align Baselines) Ctrl + Alt + 8
(Align Bottom) Ctrl + Alt + 6
(Align Horizontal Centers) Ctrl + Alt + 5
(Align Left) Ctrl + Alt + 1
(Align R ......
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; & ......
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; & ......
因为flex builder 工具是基于eclipse 上的,所以一些开发plug in 在flex builder 也是可以用的.
php:
Help-->Software Updates-->Find and Install-->Search for new feature to install-->new Reomote site
URL: http://update.phpeclipse.net/update/stable/1.2.x
NAME : XXXX
根据提示就能按照php的开发环境.
ruby
等都是可以的.
正在式能不能用来开发java. 这要就不用 搞什么集成开发环境了.
......
两个不同的flex自定义控件怎么相互控制?
比如当在一个只有add方法的控件框mxml里,当提交成功的时候,怎么更新另外一个有datagird控件框的mxml?
就可以用如下方法:在主应用程序里面,对子控件datagird进行操作;
1、parentApplication.refreshAdmin(); //在add子控件
2、public function refreshAdmin():void //在主应用程序
{
adminsummary.refreshAdmin(); //adminsummary为datagrid子控件
} ......
Adobe Flex 3 Help > Flex Programming Elements > Using Events
Adobe Flex 3 Help
Flex Programming Elements / Using Events
Using events
Using events in Flex is a two-step process. First, you write a function or class method, known as an event listener or event handler, that responds to events. The function often accesses the properties of the Event object or some other settings of the application state. The signature of this function usually includes an argument that specifies the event type being passed in.
The following example shows a simple event listener function that reports when a control triggers the event that it is listening for:
<?xml version="1.0"?>
<!-- events/SimpleEventHandler.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp();">
<mx:Script><![CDATA[
import mx.controls.Alert;
private function initApp():void {
b1.addEventListener(MouseEvent.CLICK ......