Latest Apache Flex News (June 2012)

Categories: Flex; Tagged with: ; @ June 23rd, 2012 13:35

Apache Flex (Incubating)

Apache Flex is an application framework for easily building Flash-based applications for mobile devices, the browser and desktop. Summary: A large community is losing momentum as it waits for Adobe to complete the source code transition and infrastructure.

Here are the latest flex news from Apache Flex:

  • The Apache Flex Project has received the entire Flex Framework. This includes all components that were completed in Adobe’s 4.6.0 release and a few others. Essentially if you take the existing compiler to the frameworks code, you would get what amounts to the current Adobe release.

  • The automation framework that was a part of the Adobe Flex 4.6.0 framework is close to being donated, but has not been signed off yet. We expect this in the coming weeks.

  • The Apache Flex Project has received the “mxmlc Flex Compiler”. This means we can now make changes to the existing compiler that shipped with Adobe’s 4.6.0. This will allow us to make bug-fixes and small optimizations while we wait for the new “Falcon” compiler.

  • The testing framework that Adobe used known as Mustela has been donated. This will allow us to make changes to the compiler and framework while still maintaining compatibility with the previous versions. There are a series of tests that still need to be written, but at least the framework is there.

  • The Apache Flex team has created a set of build scripts so that anybody can easily build their own copy of the framework. Apache ANT scripts will be officially supported, but other developers have offered to make build scripts for Maven.

  • Pre-compiled builds have been created and posted. They are not the ‘official’ 4.8.0 version yet, but they are getting close. You can download them and put them in your Flash Builder or IntelliJ SDKs directory and see how they look with your existing projects today. This is a parity release to the current Adobe 4.6.0 release.

  • Apache committers have begun donating various components to the framework, including an FXGImage component, some collections classes, some major work around validation, busy indicators for non-mobile components, and some navigators. These components have not been integrated into the trunk (the main project), but you should expect to see some of them in the future.

  • Lots of work is happening around localization and internationalization. A bunch of new locales have been submitted with more on the way.

  • A team has formed to build what amounts to an automated installer for Apache Flex SDK. This is an AIR application that will allow a user to do a single-click install of the SDK, and integrate it into Flash Builder 4.6.0 (and possibly other IDEs).

  • Check-in tests and the button tests for Mustella are up and working. Jenkins Continuous Integration is up and running as well.

http://incubator.apache.org/flex/index.html

Apache Flex: MXML or ActionScript ?

Categories: Flex; Tagged with: ; @ April 22nd, 2012 21:59

Deciding to create components in MXML or ActionScript

 

One of the first decisions that you must make when creating custom components is deciding whether to write
them in MXML or in ActionScript. Ultimately, it is the requirements of your application that determine how you
develop your custom component.
Some basic guidelines include the following:

•MXML components and ActionScript components both define new ActionScript classes.
•Almost anything that you can do in a custom ActionScript custom component, you can also do in a custom MXML component. However, for simple components, such as components that modify the behavior of an existing component or add a basic feature to an existing component, it is simpler and faster to create them in MXML.
•When your new component is a composite component that contains other components, and you can express the positions and sizes of those other components using one of the Flex layout containers, you should use MXML to define your component.
•To modify the behavior of the component, such as the way a container lays out its children, use ActionScript.
•To create a visual component by creating a subclass from UIComponent, use ActionScript.
•To create a nonvisual component, such as a formatter, validator, or effect, use ActionScript.
•To add logging support to your control, use ActionScript. For more information, see “Logging” on page 227 in Building and Deploying Adobe Flex 3 Applications.

Flex3 官方文档中如上释疑. 2010年我参加Flex Developer Day时, 有开发者提问国内是否有大型企业应用实例? 未得到正面回答. 倒是群硕的团队还上台张扬了一把, 他们的项目大约是奥运时CCTV直播网站.

其实即便国内有大型的企业应用, 也不一定能获得足够价值的经验.

07年底开始做的教育应用, 大致有120W行代码, 其中有60%+的为AS代码, 除了入口文件及部分复杂UI使用MXML之外, 清一色都是AS代码, 所有的UI都小心谨慎的创建, 销毁. 在10年的DevDay时, 坐在我旁边的某研发他们也是纯AS.

几年过去了, Flex贡献给了Apache, Flex也已经4.6了, 接触的代码多了, 习惯了清纯的AS代码, 当满篇都是MXML标签时, 我不淡定了.

思想斗争良久, 到底孰优孰劣? 在多数common的情况下, 几乎不分上下. 我觉得AS代码更优雅更易读, 可人家说了: 我们可以Design, 不用代码, 一眼就看出来了…:(

2012-2-6 21-20-08

如上View, 假如我们只用MXML或只用AS来实现, 似乎看不出明显差异来, 其实相比选择编程方式, 可能对组件/Class的划分可能更加重要.

不论用MXML还是AS, Class设计好更加关键:

1.1.1 可以设计成一个Common的组件;

1.1 可以作为一个组合的UserList

2.1/2.2  作为显示用户基本信息的组件;

这样划分, 不论MXML还是AS都可以很好的降低耦合, 更可重用, 但不论如何, 我还是喜欢干净的AS代码.

Check FlashPlayer SharedObject setting using ActionScript / 使用AS检查FP本地存储

Categories: Flex; Tagged with: ; @ February 7th, 2012 21:45

FlashPlayer provide a cool local storage mechanism called ‘SharedObject’,  we can store some user info in user local machine. for example, douban.fm store the last channel in sharedObject.

You can check the local storage setting for current domain by right click, or check all setting from Control Panel>FlashPlayer, additionally, you can manage all settings by this: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html

Flashplayer need the user configure this setting manually, but some times we want change the setting automatically, especially for some enterprise application, like E-Learning, Banking, HIS.

Currently, I did not found any API or workaround to change the local storage automatically 🙁

I just write a small tool to check the local storage setting directly, >>Link<<
(you may download and upload this swf to your server if needed)

image
 

/**
	 * Check local storage setting.
	 */ 
	protected function checkLocalStorage(event:MouseEvent):void
	{
		var sharedObjectForTest:SharedObject = SharedObject.getLocal("sharedObjectTest", "/");
		
		sharedObjectForTest.addEventListener(NetStatusEvent.NET_STATUS, onSharedObjectEvent);
		sharedObjectForTest.data.result = "OK";
		try
		{
			var result:String = sharedObjectForTest.flush();
			if(result == SharedObjectFlushStatus.FLUSHED) {
				traceLog("OK, and currect size is: " + sharedObjectForTest.size);
			}else {
				traceLog("Failed, and the Flashplayer security setting panel is shown.");
			}
		} 
		catch(error:Error) 
		{
			traceLog("Error, and show the seeting panel manually;");
			Security.showSettings(SecurityPanel.LOCAL_STORAGE);
		}
	}

FlashBuilder: 如何根据序列号确定其对应版本?

Categories: Flex; Tagged with: ; @ January 20th, 2012 23:29

如何根据序列号确定其对应版本?

image

由于之前采购过不同版本的FB, 具体序列号对应版本早已记不清楚, 于是微博上@了几个专家, 尚未收到任何答复的情况下直接拨打Adobe的客服:

中国10800 744 0438(通过联通),或 10800 440 0421(通过电信)[http://shop.adobe.com/store/adbehcn/Content/pbPage.faq]

报出序列号之后客服耐心回答了版本跟授权的问题.

从4.0升级到4.5大致需要415RMB, 从4.5到4.6是不需要费用的, 明年回来就有4.6可用了….

ActionScript: Check if a xml attribute/element exists 检查XML属性/元素是否存在

Categories: Flex; Tagged with: ; @ January 14th, 2012 0:21

Here is the XML:

<XeSex sexIDElement='MID'> <SexID> M </SexID> <Name> Male </Name> <Active> y </Active> <Code> M </Code> </XeSex>

Attitude:  sexIDElement = ‘MID’;
Element: Name = Male

trace(xmlTest.hasOwnProperty('@sexIDElement')); // check if the attribute exists trace(xmlTest.hasOwnProperty('Name')); // check if the element exists

BTW, About: XML Elements vs. Attributes

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.