Archive for the ‘tech’ Category

in bed with … [EMBED]

Monday, July 26th, 2010

Using flash develop or FDT and sick of going back to CS4/5 just to create some swc’s that you might have to change everytime you update any of the assets? So 2000 and something…

Use embeds!

I started using a generic static class to add all my embeds for a project and then you can easily draw them from there.

The static class:

public class HomePageAssets {

[Embed(source="../../../bin-debug/assets/loader/bar.png")]
public static var BrandBar : Class;

[Embed(source="../../../bin-debug/assets/loader/dude_again.png")]
public static var DudeAgain : Class;

[Embed(source="../../../bin-debug/assets/loader/logoType.png")]
public static var LogoType : Class;

...

And in any class:

addChild(new HomePageAssets[myAssetVar]);      // e.g. "BrandBar"

Njoy!

AS3 – VO thoughts on…

Friday, July 23rd, 2010

I started to use static VOs in my framework and having fun doing so.For those who dont know what a VO is, its a ValueObject.As a friend recommended I am using them solely as static classes, meaning I dont create an instance, which should keep memory leakage down and make them available globally.

So far I am using two types as I would describe them:

1) property based: where I defined property get-setters for everything I want to store (mainly strings) some even constants, so a very non-depth storage object

2) list based: where I need a storage for many of the same kind of objects and search functionality and add and delete function basically this is a searchable fancy array which is static and therefore available everywhere. Neat.

I like the simplicity of those classes. They are framework, nearly language independent or sorts. Now if anyone out there knows how secure it is to have global code flying about , please comment.

FDT – not enough memory : -Xmx512m

Tuesday, June 1st, 2010

If you run FDT on a Hackintosh netbook or maybe even though if you don’t, you might startup FDT first time and discover that it wants you to play with it’s .ini file.

On a windows machine, the file is fond easily, on a Mac less so.

Right-click on the FDT app (or Eclipse) and choose ‘Show package contents’ then click into that folder to find the eclipse.ini file.

I needed to replace the -Xmx512m line with -Xmx768m to get the app going.

Hope that helped.

Hackintosh: Dell Mini 10v and Snow Leopard

Sunday, May 30th, 2010

Is now easier than ever.

Get the main install start here at Gizmodo. But you will have to do a bit more just to polish a few things:

Swapping keys:

You will notice that the Apple command(windows logo) and the alt key are swapped in terms of functionality. Just go to the keyboard settings in system prefs and click on Modifier keys at the bottom of the page.

Repair Disk Permissions:

- do this after install, to increase performance and to check everything is in order.

I had an odd permission setting going on where I had to set my account as admin on the main partition otherwise it gave me read-only permissions.

Non-functional Fxx keys:

Use the Fn key in combination and you will have that working. Easier than any other solution, which might disable your brightness and volume.

Touchpad:

You will have to setup the touchpad in the best possible way. The buttons on the pad are a pain to use, so I set the left and right mouse button to be single and two-fingered taps on the pad. This will make your work life much easier.

There you go, much better, no?

AS3: Beware 4294967295

Monday, March 22nd, 2010

An easy one to miss and get accustomed to is catching the number 4294967295 on a decreasing for…loop.

That is, if you use uint, which I like doing when using for…loops. Yet if you use uint instead of int and do your loop i–, you might find yourself confronted with i=4294967295. What happens here is, that uint ranges from 0 to 4294967295, meaning if you go 0–, it will go round to 4294967295. Good to know if you want a loop like that, but rather creating unexpected effects in most scenarios.

So if you use a for…loop with i–, use var i:int !!!!

getDefinitionByName() – best thing since sliced bread

Tuesday, November 3rd, 2009

Among one of the coolest things I came across in Flash’s Actionscript 3 is the class ‘getDefinitionByName’. What it does (in short) is turning a class name in the form of a String into a class you can create an instance from. What this means is, you can create most flexible class creation built on cases.

E.g. instead of building a long switch…case list, you can add string names based on the elements an instance should have and call the specific class.

I use it for example to have a component that can call clips and bitmaps graphics from the library. The clip name can be handed over by XML and the appropriate clip can be added, without re-render or re-coding of the component.

I also build a centralized component-mediator control, that stores all possible pairs, so whenever I call for a component to be used in a mediator, it calls the right class. Which let’s me leave the display engine as is and only the content central changes from application to application.

Here is how I use it in a pureMVC environment:

var tMediatorClass:Class=getDefinitionByName(myMediatorClassName)  as  Class;
facade.registerMediator(new myMediatorClass(myComponent.id,myComponent));

There is though, one tricky issue. As long as you don’t mention a class’ name in the code, the compiler won’t implement it, meaning that your app will throw an error. Therefore, I changed my code to this:

var tMediatorClass:Class=getDefinitionByName(myMediatorClassName)  as  Class;
switch (myMediatorClass.NAME) {
case BasicMediator.NAME :
case EventMediator.NAME :
facade.registerMediator(new myMediatorClass(myComponent.id,myComponent));
}

I think I am still saving quite some lines here, especially given that a project can have a fir mount of mediators and components.

If you want to get a bit more chat on this one, read my conversation with the nice guys at actionscript.org

PureMVC – a few tips

Saturday, October 24th, 2009

Just in case someone else is having the same issues solving coding problems with PureMVC, which is some darn great core for any application, here are my musings:

Re-using Mediators

I used PureMVC to recreate my existing AS2 framework, which means my mediators don’t know in detail, when and how many are used, etc. And for re-usablity reasons, I have to re-name them to establish a unique identifier. For example: all my static components pretty much just need one mediator which initializes the component, can switch them on/off and change layout, etc.

To make it short: one mediator for any number of text components. Unique identifiers for each mediator.

PureMVC’s elements(mediators, proxies) are using two ways to identify themselves, NAME and proxy/mediatorName, the latter is changeable, so there is your way to rename it.

The way of the dodo. Apple’s app store and free market greatness

Thursday, October 22nd, 2009

There is an interesting article on Gizmodo about the price drop on iPhone apps in comparison to other mobile apps that raised quite a debate.

500x_appstore-blackhole

There are the ones saying that the market will regulate itself for the better(we heard something similar for years) and others that see the quality of apps diminish as prices for development drop. I love to be on the negative side of things, that’s just my critical nature, but also because there is another big thing coming that will most surely accelerate the issue of more apps being developed, who will disappear amongst the millions of apps. As previously mention here, Flash not only launched full AS3 support for mobiles, they also included the ability to develop Flash apps for the iPhone through the appstore.

That might easily double the number of available mobile apps everywhere. Apple still has it’s restrictions on what it considers an app worthy of…, but let’s just say more iPhones will be hacked and other mobiles will become more attractive because they are open to the porn industry.

After a quick hype in doing mobile apps, developers will be expected to churn out twitter-farting apps by the wagon-load for an ever so diminished salary, because the app’s distribution concept of delivering low-priced apps but financing through assuring large number sales will fall flat on it’s face apart for companies with big marketing budgets to get the app to a high visibility in the shop and make sure enough people buy it. Which even then might not be assured.

So there is a lot to watch over the next few months. The xmas business will finally start when Orange and Vodaphone will come out with the iPhone in the UK, just like in other countries, where the iPhone-provider monopoly will end.

Ah, and congrats again to my friend Stefan from flashcomguru.com, he managed to get himself on the first list of Flash-based iPhone apps.

via gizmodo

Flash for iPhone – all systems go

Wednesday, October 21st, 2009

Finally a praise from my side to Adobe. They pulled it off and are making Apple’s life both easier and harder. Flash CS5 will now support iPhone App development, sold though the app store. This, along with the fact that Adobe just launched their fully supported player on literally all mobile platforms, pretty much marks a new era for mobile apps. One for all has probably never been more true. The major hurdle for application developers were operating system and hardware differences like screen sizes, etc. Now if Adobe manages to enable all hardware feature access (GPS, etc.) then we are pretty much game…

Here some rather boring examples Adobe came up with so far: click here

1,2,AS3 : private and protected

Wednesday, October 21st, 2009

I am taking this opportunity to document a few things on the way to get from AS2 to AS3.

One alarm bell is the change of the meaning of ‘private’. Essentially, ‘protected’ is the new ‘private’. ‘private’ is more restrictive now. It actually means, any ‘private’ var or function can’t be used anywhere else except the class it is defined in. That does not include extended classes. The extended class will not knwo any private elements of the base class. So be sure you use protection.