Tips: Flex3 Debugging in Windows7
最近尝鲜,装了个windows7,感觉用着挺爽,无论是兼容性、速度还是用户体验都不错,我装的是Build 7068版本,但在用Flex开发时遇到一个问题,使用Flash Player Debug version无法debug,这下痛苦了,毕竟这是目前吃饭的工具,还好,在强大的Google帮助下,找到了Solution,请看步骤:
- Run your application in debug mode
- Right click over the Flash movie
- Change the option from Localhost to “Other Machine”
- Type the IP address 127.0.0.1
- Click Connect
- Debug again
很简单,请看截图:
Flex Custom Component LifeCycle
谈到Flex学习,大家都知道,其实Flex入门挺容易的,尤其是对其它面向对象语言像Java或C#比较熟悉的开发人员,直接阅读Flex的代码通常也没什么问题,但从另外一方面来说,要想深入学习Flex并灵活运用的话,其实并不那么容易,其中,对组件的生命周期(LifeCycle)的理解则是非常重要的一关,个人感觉的话,若充分理解并掌握了组件的生命周期才算真正Flex入门了:)
前段时间,与公司同事分享了一下自己对LifeCycle的经验,当时为了有助于宏观上理解整个Flex应用程序及组件的LifeCycle,自己画了两幅图,分享给大家,希望对大家有用~~~
点击小图可看完整的大图:)
【注】若大家要引用或转载的话,请注明出处,先谢谢了
设定程序用字体
其实我自己一直用的默认的,对写程序用的字体倒并不在意,慢慢地,写程序多了,觉得看久了也有点烦,想换个字体,于在在网搜一路搜索,呵呵!根据自己的习惯选用下面的字体方案,呵呵
我的测试环境是在Windows XP + Eclipse 3.41
好的程序用字体需满足以下条件,摘自 Monospace/Fixed Width Programmer’s Fonts
Good Programming Font Criteria:
- Crisp clear characters.
- Extended characterset.
- Good use of whitespace.
- ‘l’, ‘1′ and ‘i’ are easily distinguished
- ‘0′, ‘o’ and ‘O’ are easily distinguished
- forward quotes from back quotes are easily distinguished -prefer mirrored appearance
- Clear punctuation characters, especially braces, parenthesis and brackets
再来一篇各种字体在程序中的表现对比的文章:
http://www.codeproject.com/KB/work/FontSurvey.aspx
最终结论,在不同的环境要求下使用不同的字体:
在Mac上最佳字体:Monaco 14px 适合演讲,PPT
在Win上最佳字体:Consolas 14px
Fixedsys 12px
Bitstream Vera Sans Mono 10px 以下使用,此字体介绍与下载地址:http://www.gnome.org/fonts/
另外,若使用液晶显示器并在Windows下使用,可使用微软的clearType技术,调整让字体更加清晰好看,下面来张我调整后在Eclipse中的截图:
还不错吧
Tips and Tricks:让Text具有按钮的功用
通常我们用Button或LinkButton时,里面的Label文字不能换行(当然也可以,稍微要麻烦点),有些时候可以用Text组件来替代,但要让Text组件具有按钮的功能需注意两点:一是当鼠标移到Text上去时呈手势形状,二是鼠标滑入滑出时显示出不同的状态。其实也简单,不过也不是想像那么简单,呵呵。
看代码及效果:
1: <?xml version="1.0" encoding="utf-8"?>
2: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
3: layout="vertical"
4: backgroundColor="#CCCCCC"
5: creationComplete="init()">
6: <mx:Script>
7: <![CDATA[
8: import mx.controls.textClasses.TextRange;
9:
10: private function init():void {
11: myText.text = "Welcome to my blog:" + "\n" +
12: "www.jexchen.com";
13: }
14:
15: private function onRollOver():void {
16: var tr:TextRange = new TextRange(myText, false);
17: tr.color = 0xff3333;
18: }
19:
20: private function onRollOut():void {
21: var tr:TextRange = new TextRange(myText, false);
22: tr.color = 0×000000;
23: }
24: ]]>
25: </mx:Script>
26: <mx:Text id="myText"
27: color="#003e7e"
28: useHandCursor="true" buttonMode="true" mouseChildren="false"
29: rollOver="onRollOver()"
30: rollOut="onRollOut()"/>
31: </mx:Application>
点击查看效果:
BlazeDS与LCDS在功能上的对比
√ 代表此功能可用
| Features |
BlazeDS |
LCDS |
| Data management Services | ||
| Client-Server synchronization | √ | |
| Conflict resolution | √ | |
| Data paging | √ | |
| SQL adapter | √ | |
| Hibernate adapter | √ | |
| Document Services | ||
| LiveCycle remoting | √ | |
| RIA-to-PDF conversion | √ | |
| Enterprise-Class Flex application services | ||
| Data access/remoting | √ | √ |
| Proxy service | √ | √ |
| Automated testing support | √ | |
| Software clustering | √ | √ |
| Web tier compiler | √ | |
| Enterprise Integration | ||
| WSRP generation | √ | |
| Ajax data services | √ | √ |
| Flex-Ajax bridge | √ | √ |
| Runtime configuration | √ | √ |
| Open adapter architecture | √ | √ |
| JMS adapter | √ | √ |
| Server-side component framework integration | √ | √ |
| ColdFusion integration | √ | |
| Offline Application Support | ||
| Offline data cache | √ | |
| Local message queuing | √ | |
| Real - Time Data | ||
| Publish and Subscribe messaging | √ | √ |
| Real -time data quality of service | √ | |
| RTMP tunneling | √ |
该对比图来源于:
http://sujitreddyg.wordpress.com/2008/01/31/blazeds-and-lcds-feature-difference/
360Flex及Max2008 sessions
对于Flex/AIR/BlazeDS/LCDS学习者来说,360Flex及Max2008应该是大家都想参加的会议,但对于大部分人来说,仍是价格不菲,不过还好,最近的360Flex及MAX2008大会的技术演讲大部分均有视频记录,而且效果非常好,相信对大家来说是份不可多得的好资源~~~观看这些视频通常有下面几种方式:
直接通过Adobe.com官方站点访问在线观看:
MAX2008:
通过Adobe Media Player订阅观看,订阅地址如下:
MAX2008:
- http://rsstv.adobe.com/Max2008Design
- http://rsstv.adobe.com/Max2008Develop
- http://rsstv.adobe.com/Max2008Envision
360Flex:
http://sessions.adobe.com/360FlexSJ2008/feed.xml
还可以通过以下iTunes地址进行观看:
MAX2008:
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=299639895
最近接触的东西很多…好多还需要消化
由于所在项目组做的是对公司未来非常重要的产品,加上目前在China这边的开发人员对产品架构和细节都不是特别了解,公司接连派NA和CANADA的同事过来为我们指点,学到了不少东西,有些属于知识掌握方面,有些属工具相关,由于花的时间也不够,好多都一知半解,需要一一消化,有些还需要深入,先将这些相关知识列下来,过段时间再来对比,看吸收掌握了多少,呵呵
Java相关:
Technology Stack:
- JMS/ActiveMQ-Messaging
- Spring – Configuration /Wiring
- Log4J – Logging
- AspectJ – Auditing, Performance Metrics
- CXF – WebService
- Hibernate – JPA
Tools
- Subversion / Jira
- Maven
- Junit
- Cruise Control
- CheckStyle /Clover
- Crucible
Flex相关:
- Coding Standard
- Flex + Blaze/LCDS + Java
- FlexUnit
- Flexcover
- Cairngorm(Current) / Mate(Future)
关于[managed]、[transient]、[RemoteClass]的解释
当在使用Flex并结合BlazeDS或LCDS进行企业应用开发时,经常会碰到[managed] [transient] [RemoteClass]这三个元标签(metadata tag)的使用,但似乎相关的文档很少([RemoteClass]稍微多点),通过一番搜索,找到了比较细致的解释,附上链接及相关原文,备查:
http://weblogs.macromedia.com/lin/archives/2007/02/how_to_get_sing.html
1. To represent a server-side Java object in a client application, you use the [RemoteClass(alias=" ")] metadata tag to create an ActionScript object that maps directly to the Java object. You specify the fully qualified class name of the Java class as the value of alias. This is the same technique that you use to map to Java objects when using RemoteObject components.
2. You can use the [RemoteClass] metadata tag without an alias if you do not map to a Java object on the server, but you do send back your object type from the server. Your ActionScript object is serialized to a Map object when it is sent to the server, but the object returned from the server to the clients is your original ActionScript type.
3. To create a managed association between client-side and server-side objects, you also use the [Managed] metadata tag or explicitly implement the mx.data.IManaged interface. The [Managed] metadata tag ensures that the managed Contact object supports the proper change events to propagate changes between the client-based object and the server-based object.
More info about this:
http://www.mail-archive.com/flexcoders@yahoogroups.com/msg57899.html
You could simply declare that a particular concrete property on your client type was "transient" using [Transient] metadata - these properties wouldn’t be included when instances were sent back to the server.
http://www.mail-archive.com/flexcoders@yahoogroups.com/msg38984.html
Try tagging the properties that you don’t want managed in your [Managed] AS class as [Transient]. This should prevent changes to them from being logged/committed.
怎样移除当前的Flex License
当你购买了正版的Flex License后,或要从以前的Standard version升级到Pro版本(或者不小心以前输入过其它的Serial Number)…需要将以前的License移除,使得能输入新的License,则需要移除license.properties这样一个文件,路径如下:
Windows: %ALLUSERSPROFILE%\Application Data\Adobe\Flex\license.properties
Mac: /Library/Application Support/Adobe/Flex/license.properties
将此文件移除后,重新启动Flex Builder,Ok,可以输入新的正版SN了。
Subscribe to the comments for this post