随笔分类 - flash builder4
摘要:在flex项目中,应用到非显示的功能性组件,一种方法是直接定义actionScript类。另外一种方法是实现IMXMLObject接口。实现IMXMLObject接口的好处,是可以直接调用功能函数。IMXMLObject中的方法function initialized(document:Object, id:String):void,在IMXMLObject置入MXML时被直接调用,类似于触发了initialized事件。如以下示例:TempCom.aspackagecomponent{importflash.display.Shape;importmx.core.IMXMLObject;pu
阅读全文
摘要:Component Life CycleRegardless of how simple or complex you make your components, there is one constant:Your component needs to be instantiated and when it does, it needs to be able to initialize itself and create and display any assets it requires. If it is interacted with or data changes that it c
阅读全文
摘要:The architecture of the new Spark components in Flex 4 supercedes the Halo components of Flex 3. Upon learning how to leverage the architecture of Spark components, you will find the improvements to be quite substantial.Ultimately, the new component architecture with the Spark library makes building
阅读全文
摘要:The Flex documentation on the UIComponent life cycle is rather difficult to understand, and so I came up with what I felt was an easier and more logical way of describing the process. I felt this might be useful for those who are interested in creating custom visual components in Flex that extend th
阅读全文
摘要:比如,采用mxml来自定义组件 CustomComponent:<?xml version="1.0" encoding="utf-8"?><mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"><mx:Button id="mybt"/></mx:Canvas>别的地方在使用此组件的时候,是可以访问...
阅读全文
摘要:You have made the most amazing component that does everything… seriously, this thing solved cancer, world hunger, and finally answered how unattractive guys end up with attractive women.However ...
阅读全文
摘要:高质量的开源Flex UI组件库项目(FlexLib)For about the past month,Doug McCune,Ted Patrick,Mike Chambersand I have been collaborating on an open source community-driven Flex 2 component library. Today, we're pleased...
阅读全文
摘要:Spark Skinning (including SkinnableComponent) - Functional and Design SpecificationSpark Skinning (including SkinnableComponent) - Functional and Design Specification|Glossary|Summary and Background|U...
阅读全文
摘要:明白了测试的概念后,现在就介绍FlexUnit单元测试吧。FlexUnit可以说是Junit的一个复制,因为它们具有太多的相似性,不过说白了,其实所有的单元测试都是一个样,主要的方法就是通过输入来比较输出的结果是否正确。虽说原理是这么简单,但是一个好的单元测试框架,可以为编程人员带来很好的方便,在FlexUnit中,当然也有一个很有的框架。要使用FlexUnit,先须先下载FlexUnit.swc...
阅读全文
摘要:在说明问题之前,大家就看一个例子:import flexunit.framework.TestCase;import flexunit.framework.Assert;import flash.utils.Timer;import flash.events.TimerEvent;public class TimerTest extends TestCase {private var _timer...
阅读全文
摘要:通过上两篇文章我们可以得到一个结论:使用SparkSkin、Skin方式设定spark组件的皮肤是非常容易的事情。如果同样的效果在Flex SDK 3里面设定的话,将会是件非常麻烦的事情。Flex SDK 4(Gumbo)众所周知有两套组件:spark组件和halo组件,那么既然spark组件中的皮肤设定是非常容易的事情,在halo中呢?能否也会像spark组件一样方便?答案:当然是肯定的。其原因...
阅读全文
摘要:自定义Button的mxml的代码解释:1、<s:SparkSkin xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="http://ns.adobe.com/mxml/2009"></s:SparkSkin>含义:如果要自定义控件样式,必须要要继承SparkSkin或者Skin,关于二者的区别我在上一篇文章中已经叙...
阅读全文
摘要:在Flex SDK 4(Gumbo)新增加了一个包:spark.skins,这个包里面只有一个class:SparkSkin,而我们(非美工的程序员)通过这个class来实现任意自定义控件的样式。下图是SparkSkin的继承关系:通过上述关系可以得出如下的结论:1、SparkSkin是一个Group类型的容器。(它继承与Group)2、Base class for Spark skins.(是全...
阅读全文