Posts Tagged ‘Flex’

CSS Flexbox not wrapping on iOS

Sunday, April 24th, 2016

I had a problem where flexbox didn’t wrap on iOS but worked fine on all other browsers.
Thankfully it turned out to be a simple fix, on my flexbox child item I had to change

flex: 1

to

flex: 1 0 $minWidth; // Just 'flex: 1' will break wrapping on iOS.

where $minWidth is the minimum desired width of the flexbox child item.

Managing your playerglobals and SDKs

Thursday, March 28th, 2013

If you have multiple versions of the Flex/Air SDK on your computer it can sometimes become a hassle to make sure that every SDK has all the playerglobal.swc files for all the versions that you need to compile for.

What I recommend is creating a /flex directory in your preferred location (mine is on the root of C:) where you have all your SDKs, and put a folder there called /playerglobals where you have all your versions of playerglobal that you will need.
Then delete the FlexSDK_x.x.x/frameworks/libs/player folder from every SDK and replace it with a Directory Junction (hard) link, which you can do with the following command (Windows):

mklink /J C:\flex\FlexSDK_x.x.x\frameworks\libs\player c:\flex\playerglobals

Now you have only one place to worry about your playerglobals.

Global error handling with Flash Player 10.1

Wednesday, June 23rd, 2010

Since the official release of Flash Player 10.1 is out, now might be a good time to start implementing the global error handler.

When this is written, flash builder 4 doesn’t have a native way that lets you use it, so we have to do a little mix. (Update: The update is out.)
The global error handler works by adding an event to the uncaughtErrorEvents property of the loaderInfo of the application.
There are currently two methods of getting it to work.

Method 1 – The backwards compatible one:

Here the code doesn’t crash in flash player 9/10, but the error handling will only work in 10.1.

if(loaderInfo.hasOwnProperty("uncaughtErrorEvents")){
	IEventDispatcher(loaderInfo["uncaughtErrorEvents"]) .addEventListener("uncaughtError", uncaughtErrorHandler);
}
private function uncaughtErrorHandler(e:Event):void {
	trace("Global error:", e);
}

Method 2 – The type safe one:

Get the Flex 4.1 SDK if you haven’t already and choose that one as your project’s SDK.

Now you can use the new global error handling like it was meant to be used:

import flash.events.UncaughtErrorEvent;

loaderInfo.uncaughtErrorEvents.addEventListener( UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);

private function uncaughtErrorHandler( e:UncaughtErrorEvent):void {
	trace("Global error:", e);
}

Profiling AS3/Flex applications

Tuesday, October 6th, 2009

I’m working on a big project and was having some problems with memory leaks. After some google-ing around I found this great video on AdobeTV by Jun Heider where he shows you how to profile both the memory and performance of your AS3 or Flex application.
It’s pretty thorough and it is little over one hour in length.