Release: Christopher Tech Fotostudio

Another photographer site sees the light of day. Munich based photographer Christopher Tech, specialized in still-life and ad shootings, got a new site design. The prolific designers at pergerundberger.de developed a clean and slick interface. An atmospheric ambient sound makes crawling through Techs work amusing.

I built the site in AS3 with the robotlegs framework at hand. For users with devices ignoring Flash there is also a reduced complementary HTML only page which also serves as food for search engines.

When the site was put online few bugs emerged but they could be removed without hassle and that is WHAT I LOVE ABOUT WEB – the possibility of super fast and continuous tweaking and updating of released stuff.

Veröffentlicht unter Allgemein, Design, Release | Verschlagwortet mit , , , | Hinterlasse einen Kommentar

Yournight.de Online Again

Even if the site is under heavy work I already put it into the wild. www.yournight.de is an open website where *everybody* can register and build whatever content this person likes. If you have the feeling that you definitely know what needs to be seen on yournight.de start working on it!

I tried to setup the site in a way that even non-registered users can edit what they want, enabled by the fantastic Concrete5 onpage editing but sadly C5 is not build that way. So we have to stick with the registration step.

Now I will setup some additional templates to chose from – right now it’s only the “page” template and its covering the entire browser window – kind of geekish.

Have fun!

Veröffentlicht unter Allgemein | Hinterlasse einen Kommentar

Short note: Setup Flashdevelop For Developing Air Apps on Android

If you have downloaded the project template for Flashdevelop: http://blubl.geoathome.at/wp-content/uploads/2010/10/091-ActionScript-3-Android-AIR-AS3-Projector.zip

… put it in the flashdevelop/projects folder. Now you can select Android/Air app in the “new project”-screen. The template contains a good readme.txt for what you need to do.

Additionally you have to setup the compiler options and setup the custom path to Flex SDK. Also start adl.exe with the parameter -runtime to lookup the version of it. If it says 2.6 you have to change the application.xml accordingly.
<application xmlns=”http://ns.adobe.com/air/application/2.6″>

Otherwise adl will quit its job telling you: Error while loading initial content. Now you should be able to test you apps in FlashDevelop.

Changing Screen Size

If you want to change the screensize in which adl opens your app go to project settings and edit “run custom command”. Change it to:
$(FlexSDK)\bin\adl.exe; -screensize 600×1024:600×1024 application.xml bin

The second resolution is for fullscreen mode and needs to be set for adl to work.

Veröffentlicht unter HowTo, Programming | Hinterlasse einen Kommentar

Why Robotlegs

I want to point out some reason why Robotlegs makes sense. For someone who does not know Robotlegs: It’s an Actionscript 3 framework that builds upon the Model-View-Control (MVC) code design pattern. In short: You can use it to seperate the logic of your application (controller) from the data (model) and the representation of it (view).
You can find implementations of MVC in divers frameworks and programming languages – frontend and backend alike. When you google MVC pattern you can read tons of articles about the pros and cons.

Communication between Objects made easy

Beside MVC there are two other features I really appreciate about Robotlegs. First, it has a build in event bus. You should know events from Flashs Display List. Objects that get created if the user “does something” with the user interface (e.g. MouseClick). These event objects can bubble up the display list (the hierarchy of nested displayobjects like Sprite or Movieclip). Thats nice as it is but the events are bound to the displaylist. In Robotlegs the objects share an eventdispatcher they can utilize to listen for events or to send events into the framework – and that is not limited to user interface elements nor the displaylist. The benefit is: You do not need to know the actual object that broadcasts the event meaning you do not need a reference to the broadcaster in your listening classes. Just listen to the event bus and everything works.

Robotlegs helps to reduce code

The other thing is automated Dependecy Injection (DI). (Google it for more information). What automatic DI does is it provides your classes with their dependencies. If you have a Car class and that class needs an instance of the Motor class to work properly when getting instantiated Robotlegs does it for you. That means you do not have to write construction code to first get a motor, instantiate it, then create a car and put the motor in it’s constructor. Code instructions like that are called boiler plate code, code with the sole purpose to create and combine objects, code that has no business logic. Sure you have to instruct Robotlegs on startup what objects are created at what time but that is, compared to manual creation and combining, a lot less code.

And it does not make it harder to understand

Some say using frameworks like Robotlegs bloat your code and DI makes it hard to understand what happens where. But these arguments are even more true for individual code. I had to get back to my last bigger project built with Robotlegs after 2 month. I found it really easy to put in new functionality because of the seperation due to MVC and DI. I just wrote another class, pointed out that this class needs an instance of the model when instantiated and was ready to go. Without Robotlegs I would have needed to break apart my code base and look for hooks in my code to put the new class into place – more boilder plate code or even restructuring other classes.

Robotlegs or other frameworks are not made for very very small projects like banner advertising because they naturally put in some kB for the framework classes but if your project is not restricted in that way give it a try. It not only makes your code more flexible but makes you think about object communication in general.

Veröffentlicht unter Allgemein, Programming | Hinterlasse einen Kommentar

AS3: Smoothing loaded Pictures

There are a lot of blog posts on the topic of smoothing pictures in Flash after loading. The process goes like this:

private function onPicLoaded(e:Event):void 
		{
			var pic:Bitmap = Bitmap(e.currentTarget.content);
			pic.scaleX = pic.scaleY = 0.2;
			pic.smoothing = true;
		}

But few mention that you also have to set:

stage.quality = StageQuality.BEST;

in order to have the pictures smoothed. Preferably you set this value at the very beginning of your application, in your main class. It’s not neccessary to do it everytime you loaded a picture, its a global setting.

If you are loading your pictures from a different domain there seems to be a problem when there is no policy xml file on that server but you can find solution for that on the web.

Veröffentlicht unter HowTo, Programming | Hinterlasse einen Kommentar