Archive

Author Archive

QTP runtime error. TypeError: Error #1006: showConnectionAttemptMessage is not a function.

January 26, 2012 Leave a comment

If you compile an air application against the latest Flex 4.6 SDK and include the QTP and automation libraries, you will hit a wall:

TypeError: Error #1006: showConnectionAttemptMessage is not a function.
Read more…

Categories: Uncategorized

DropDownController PopupAnchor

November 8, 2011 Leave a comment

Lets pretend you have a popup that you want to show when a button is clicked, as in the following example:

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication 
	xmlns:fx="http://ns.adobe.com/mxml/2009"
	xmlns:mx="library://ns.adobe.com/flex/mx"
	xmlns:s="library://ns.adobe.com/flex/spark">
	
	<s:Button 
		label="Some Button that pops something up"
		horizontalCenter="0"
		verticalCenter="0"
		click="popup.displayPopUp = true;"/>

	<s:PopUpAnchor 
		id="popup"
		right="0"
		bottom="0">
		<s:Group>
			<s:Rect 
				width="50"
				height="50">
				<s:fill>
					<s:SolidColor color="0xFF00FF"/>
				</s:fill>
			</s:Rect>
		</s:Group>
	</s:PopUpAnchor>

</s:WindowedApplication>

How do you easily manage when the popup is closed in this case?
Read more…

Garbage Collection Strategy Reiterated

November 7, 2011 1 comment

A new article was recently published on adobe’s devnet providing another recap of how memory is managed by Flash. I wanted to reiterate the importance of diligently clearing the stack memory of references to the heap memory in order to minimize the work of the collector in the Mark and Sweep phase.

You, as the developer, can optimize your code by helping the Mark and Sweep phases of garbage collection occur less often. By keeping your stack references cleared of objects on the heap, the zero count table algorithm can clean up the memory before mark and sweep has to occur.

Getter & Setter accessors with different namespaces

October 21, 2011 2 comments

Although the bug is still open, you are able to create a getter/setter combo for a property with different namespaces. Sweet!

You will get a compile error when trying to write to the read only property, and you will get a runtime error if you try bracket notation on the object to set the property.

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication 
	xmlns:fx="http://ns.adobe.com/mxml/2009"
	xmlns:mx="library://ns.adobe.com/flex/mx"
	xmlns:s="library://ns.adobe.com/flex/spark">

	<fx:Script>
		<![CDATA[
			import mx.events.FlexEvent;

			private var _myVar:Boolean;

			public function get myVar():Boolean
			{
				return _myVar;
			}

			//Private/Protected/Internal/etc...
			private function set myVar(value:Boolean):void
			{
				_myVar = value;
			}
		]]>
	</fx:Script>
</s:WindowedApplication>

Categories: Uncategorized

ButtonBar radio logic hack

September 30, 2011 Leave a comment

Update: Set the requireSelection property to true.

When the button bar is used as a navigation tool for a set of tabs, it doesn’t make sense for the selected button to be unselected if the user clicks on it.

It is also fairly typical for a result handler of the IndexChangeEvent.CHANGED to utilize the button bar’s selectedItem property to access a piece of data. This causes runtime errors when the selected item is no longer selected because of a re-click on the selected button.

Read more…

Workspace in use or Cannot be Created

September 23, 2011 Leave a comment

If you close FlashBuilder and it doesn’t shut down correctly, sometimes a .lock file will be left in the .metadata directory of your workspace.

If you try and restart FB with the .lock file present, you will get an error message about the workspace being in use. Either make sure the java program is killed or remove the lock file manually in order to reload FB.

This seems to happen to me every time I shut down with the latest version ]:

mx Vertical Scroll Position

June 14, 2011 2 comments

In regards to my post about maintaining vertical scroll position, James asked how the same would be done for mx based components. Here is an example using an mx:DataGrid.

Read more…

Follow

Get every new post delivered to your Inbox.