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

Flex Build: org.xml.sax.SAXParseException :The entity name must immediately follow the ‘&’ in the entity reference

Categories: Flex; Tagged with: ; @ January 13th, 2012 23:25

在过去接近4年的时间里, 很少使用MXML, 几乎都是纯AS, 最近操作了一点点MXML, 譬如:

<s:Button enabled=”isDirty() && canSaveNow()” />

 

在build的时候遇到错误:

org.xml.sax.SAXParseException :The entity name must immediately follow the ‘&’ in the entity reference

Google了一下, XML解析的问题, 解决方法:

&& 替换为:  [&amp;&amp;]

<s:Button enabled=”isDirty() &amp;&amp; canSaveNow()” />

Apache Flex: 新动向, 邮件列表也出来了!

Categories: Flex; Tagged with: ; @ January 8th, 2012 22:07

这哥们总结的很好:

Apache Flex :: Flex-Dev summaries 4

Apache Flex :: Flex-Dev summaries 3

Apache Flex :: Flex-Dev summaries 2

Apache Flex :: Flex-Dev summaries

关于Flex Summit的一些: http://www.spoon.as/2011/flex-summit-live-updates-day-2/

邮件列表: http://incubator.apache.org/flex/mailing-lists.html

Newer Posts <-> Older Posts



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