Browsing articles from "February, 2011"
Feb
28

Firefox Flex Debug Player Crash

By bradj  //  Adobe Flex  //  No Comments

I was having issues with Firefox while debugging Flex applications. For some reason Firefox kept crashing or timing out. I followed this post. Solved my problem!

Let me know if you are having further issues.

Feb
27

Class IIMEClient could not be found

By bradj  //  Adobe Flex  //  No Comments

Are you getting this error in your Flash Builder 4 environment?
VerifyError: Error #1014: Class IIMEClient could not be found.

Fret no more. Change the following lines in your name-app.xml:

From:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/1.5">

To:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/2.0">

For those who cannot see the difference; I replaced the xmlns version number. If you would like a more in depth walk through then please go here.

Feb
15

Center Elements in Adobe Flex When Using s:layout

By bradj  //  Adobe Flex  //  No Comments

This is something I found quite irritating. When you are using

<s:layout>
	<s:VerticalLayout />
</s:layout>

it generates a container around the rest of your components. Thus, whenever you try to align those components they are bound to the limits of the auto generated container. Which means you will get something like this:

This is bad. So, how do you fix it? This is how:

<s:layout>
	<s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />
</s:layout>

Which yields…

This annoyed me for a solid 30 minutes. Hope it helped you.

This is the entire application I was working in while figuring this out.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
					   xmlns:s="library://ns.adobe.com/flex/spark" 
					   xmlns:mx="library://ns.adobe.com/flex/mx"
					   height="400"
					   width="600">
	<s:layout>
		<s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />
	</s:layout>
 
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
 
	<s:VGroup width="{this.width - 10}" height="{this.height - 30}">
		<mx:HBox width="100%">
			<s:TextInput id="ti_url" width="100%" />
			<s:Button id="bt_submit" label="Get Response" />
		</mx:HBox>
		<s:TextArea id="returnArea" editable="false" height="100%" width="100%" />
	</s:VGroup>
 
</s:WindowedApplication>