Resources to pick up iOS development

A lot of people are trying to learn iOS development.
The learning curve is quite steep if you don’t have a Objective-C or C background. Mix that in with a learning a new IDE ( XCode ) and you have a recipe for failure.

A couple of iOS books

I want to give you a headstart with these books, all available on Safari ( O’Reilly’s online reading platform ).

Continue reading

Changing background on Twitter fix.

When you run into the following error:
/settings/design/update This method requires a POST or PUT.
on Twitter, you might have some unsaved changes in one of the other tabs.

Twitter Settings Tabs

To fix this, save your changes first without uploading a new background image. Then try again. If that also fails, try using another browser for a moment.

The Code snippets feature in Flash CS5 is no good.

I’ve been playing with the new Flash CS5 trial and went to the “what’s new” page on the Adobe site. So far so good. I watched the first video about the improved Text Engine. Very nice. Columns ftw! But upon the second feature I started to scratch myself behind my ears. What the %*$# went wrong with the new “Code Snippets” feature? Adobe has placed it on number 2 on their list. But they shouldn’t have. Here’s why.
Continue reading

Running Ubuntu Lucid Netbook Edition on a Asus EEE PC 1201HA

Today I installed Ubuntu on my Asus EEE PC 1201HA netbook. Because I’ve got really good experiences with installing Ubuntu on the computers of my family and friends, I was determined to install Ubuntu Netbook Edition on this one too before passing it on to it’s next owner. ( I just bought it for a temp. side project ).
Continue reading

How to get up and running with Apparat

@joa recently posted a simple example to illustrate the power of his powerfull optimization framework called Apparat.

Apparat is a framework to optimize ABC, SWC and SWF files.

From the description of the Google Code page we get a hint of what Apparat actually does: “Apparat is a framework to optimize ABC, SWC and SWF files.”. In layman’s terms: “Apparat will speed up your Actionscript projects by optimizing certain method calls.”. The Actionscript Library for example provides some ( much ) faster ways of doing math and bitwise operations. Read on to understand more about how to get up and running with Apparat.
Continue reading

Smoothing <mx:image/> – the simple way

Solved this little problem the simple way. One of the centralized file sharing applications we’re developing needed some form of branding at the bottom of the screens. The logo bar, 1400 px wide, needs to be resized when the user changes the resolution of the browserwindow.

Without smoothing, things turn ugly and pixelated. With smoothing turned on, everything keeps looking the way it should, even when resized.

<mx:VBox>
    <mx:script>
	private function smoothImage ( img : Image ) : void
	{
		var bmp : Bitmap = img.content as Bitmap;
		bmp.smoothing = true;
	}
    </mx:script>
    <mx:image id="logoImage" complete="smoothImage(logoImage)" source="images/logo.png" width="100%" scaleContent="true"/>
</mx:VBox>

How to merge two images into one using Actionscript

Well, it’s very easy, using BitmapData and Bitmap. This example makes things a bit more complex to show some principles. Hope you learn something out of it off course.

// we'll scale the first ( background ) image by 50%
var s : Number = .5;

// create a matrix to make the scalilng of the bitmap possible
var scaleMatrix : Matrix = new Matrix();

// apply the scaling to the matrix
scaleMatrix.scale(s,s);

// create a bitmapdata object from an existing bitmap ( "bmp" in this case )
var scaledBitmap : BitmapData = new BitmapData(bmp.width*s,bmp.height*s,false,0);

// draw the content and scale it using the matrix
scaledBitmap.draw(bmp,scaleMatrix);

// we have an embedded asset called "flickr", a flickr logo in gif format
var icon : Bitmap = new flickr() as Bitmap;

// let's place it in the bottom right corner
var ix : Number = scaledBitmap.width-icon.width;
var ij : Number = scaledBitmap.height-icon.height;

// create a matrix for the position of the icon
// note the use of the ix and ij variables in the parameters
var positionMatrix : Matrix = new Matrix(1,0,0,1,ix,ij);

// draw the icon bmp to the bitmapdata
scaledBitmap.draw( icon, positionMatrix );

// add the new, merged, bitmap to your displaylist
var bmp : Bitmap = new Bitmap( scaledBitmap );
addChild( bmp );

// that's it!

PS: as per user comments I’ve also uploaded an example to use in the Flash IDE ( *.fla file ) – the above example assumes you’re using Flash Builder or another editor

I do have to say I don’t understand why people try to merge two bitmaps in Flash using the IDE. You could just as easily create a MovieClip with the two bitmaps on top of each other. Or am I missing something? Tell me in the comments!

Download the example *.fla file here: http://www.webdevotion.be/blog/wp-content/mergy.fla.zip