Analytical power and respecting visitors’ privacy

Almost all websites use some sort of Traffic Analytics, Google Analytics is used by 54.7% of all websites, according to w3techs.
Using an external analytics service to collect and parse website’s visitors data is the simplest and fastest way, however, it comes with a price since the website owner has no control of the scope of data collected, and how it is processed.

Is the price too high?

The direct price on the website is:
Performance: Loading the Google Analytics script directly impacts the website performance.
Legal: Google Analytics is using tracking cookies and requires consent popups, affecting the website’s first impression and natural navigational flow.
Ethical: Compromising my website’s visitors privacy in order to maintain analytical power is plain wrong.

Bablab is a great example: the traffic analytics solution is non-intrusive, not using cookies.

Read more in the Bablog:

Creating a Gallery page in a minute and a half – Bablab

Creating a gallery page in a minute and a half :

Try now – 14 days trial is free:

Bablab is a centralized platform for Photographers and Artists to manage their online presence.
Public Portfolio Website – Presenting your work to prospect clients.
Customize your portfolio to showcase your work in a beautiful and unique way. It’s also fully responsive, so it looks great on all the latest devices.

Private Client Galleries – Communicating your work with existing clients.
Get clients selections, allow clients to share & invite guests to view the gallery.

Each has it’s own requirements and functionality, but both represent you.
Our focus is keeping it all simple and efficient, so you can focus on your work.

Create a slick portfolio website – see how!

Portfolio Website at A new service for professional photographers, create your own portfolio website, super slick and elegant.

Another super cool feature are the private client galleries, upload low-res photos, send your client a secured link to proof, select or share with their friends and family.

Take a look!

Flash MouseWheel event on ALL browsers

Cut a long story short – took me a long time to find a solution to support Flash MouseWheel on all browsers, Windows AND Mac.

You can see this live here:

This solution is a combination of two technics, and as of today (March 2013) supports ALL browsers on Windows and Mac:
First, loading an AS2 SWF from internal byteArray (that version still supports mouseWheel), this works for IE. download the class here:
Second, adding JS function that listens to mouseWheel event and passes it to Flash via ExternalInterface (DOM).Each browser needs its own function because of the differences in the event object.

For efficiency my implementation is testing the browser user agent on the server (PHP) and writing the correct JS function to support the mouseWheel event on that browser.

The JS functions are as follows:


window.addEventListener("DOMMouseScroll", handleWheel, false);
function handleWheel(event)
var app = swfobject.getObjectById("FLASH_OBJECT_ID");
var _x = event.clientX;
var _y = event.clientY;
var _delta = event.detail;

if (app) {
var o = {x: _x, y: _y, delta: _delta, ctrlKey: event.ctrlKey, altKey: event.altKey, shiftKey: event.shiftKey};



window.addEventListener ("mousewheel", handleWheel, false);
function handleWheel(event)
var app = window.document["${application}"];
var _x = event.screenX;
var _y = event.screenY;
var _delta = event.wheelDelta * 4;
if (app) {
var o = {x: _x, y: _y, delta: _delta, ctrlKey: event.ctrlKey, altKey: event.altKey, shiftKey: event.shiftKey};


window.onmousewheel = deltaDispatcher;
function deltaDispatcher(event)
var app = swfobject.getObjectById("FLASH_OBJECT_ID");
var _delta = event.wheelDelta/60;
var _x = event.screenX;
var _y = event.screenY;
if (app) {
var o = {x: _x, y: _y, delta: _delta, ctrlKey: event.ctrlKey, altKey: event.altKey, shiftKey: event.shiftKey};

And in Flash AS main class:

import utils.MouseWheel;

After added to stage add these:

ExternalInterface.addCallback("handleWheel", handleWheel);
stage.addEventListener(Event.ACTIVATE, flashActive);
stage.addEventListener(Event.DEACTIVATE, flashDeactive);

And finally, add these fundtions:

private function handleWheel(event:Object) : void
var obj : InteractiveObject = null;
var mousePoint : Point = new Point(stage.mouseX, stage.mouseY);
var objects : Array = stage.getObjectsUnderPoint(mousePoint);

for (var i : int = objects.length - 1; i >= 0; i--) {
if (objects[i] is InteractiveObject) {
obj = objects[i] as InteractiveObject;
else {
if (objects[i] is Shape && (objects[i] as Shape).parent) {
obj = (objects[i] as Shape).parent;

if (obj) {
var mEvent : MouseEvent = new MouseEvent(MouseEvent.MOUSE_WHEEL, true, false,
mousePoint.x, mousePoint.y, obj,
event.ctrlKey, event.altKey, event.shiftKey,
false, Number(;
private function flashActive(event:Event):void
private function flashDeactive(event:Event):void

Injecting and calling JS functions from within flash using external

JS injection

I recently encountered a unique requirement in one of my projects, triggering the loading of a page in the background (outside of flash, using Ajax) from within flash.
Often you cannot rely on JS functions to be available, you could load public libraries (Jquery or equivalent) or inject your own functions to the DOM, I chose to inject my own.

This is how you do it:

1) import the external class.

import flash.external.ExternalInterface;

2) declare a constant variable with all the JS functions:

private const script_js :XML =
function() {

var ajaxRequest;
// Opera 8.0+, Firefox, Safari, Chrome
ajaxRequest = new XMLHttpRequest();"GET", _url, true);

} catch (e){
// Internet Explorer Browsers
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");"GET", _url, true);

} catch (e) {
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");"GET", _url, true);

} catch (e){
// Something went wrong
return false;


3) inject the JS to DOM:

try {
if( ExternalInterface.available ) script_js );
} catch( error:Error ) {
trace("ExternalInterface is not available");

4) call a function: "AJXFNC.ajaxFunction", "" );

Sweet isn’t it?

Random number without repeat as3

We’re using the random object for many things, by its nature it may repeat a number, but sometimes we don’t want to get the same number more than once, for example when showing a random image out of an array of images, or jumping to a random frame in a MovieClip. Currently there is no ‘unique’ function in Actionscript, you have to write your own solution.

Here is my class for generating random numbers:

Create an instance of RandomPlus, defining the numbers scope (start & end numbers), including negative values. in case only one parameter is passed the RandomPlus object will assume it is the end number and that the start number is zero:
var rp:RandomPlus = new RandomPlus( end:Number, start:Number = 0 );

After that you can use ‘getNum’ public function that will return a random number within the scope:
rp.getNum(); // returns a Number

You can use public var ‘len’ to retrieve the length of the scope in case you want to use it for your function:
rp.len; // returns a Number

*The object will return unlimited amount of numbers, each time the entire scope was returned it will reshuffle the items so it will continue to return random numbers within the scope, in an ever-changing order.

Let me know if you liked it (or if you have suggestions), enjoy :)

The iTunes clutter and users perception

Sometimes companies let technical considerations affect their product strategy in a bad way, allowing “practical” point of view override the “user” point of view. Startups often say “our technology does X, this can be interpreted into several actions, let’s wrap them together to make a bigger offering while keeping small resources and requirements on our side”.
They forget that each product is accepted by users perception under a contextual category, a definition, a purpose. for instance, for me Cyberduck is a ftp client, it’s a utility, it’s used for my professional productive activities. VLC is a video player, it’s for seeing movies, for fun. I see no point in mixing those together into one application, even if the core technology was the same. I said IF. Another point is using terms for ‘normal’ people, correct, understandable, don’t exaggerate. Don’t call your service ‘GPS’ if it only provides numeral coordinates, for me, and probably most users, GPS is something else, it has maps and gives directions, 3D view, etc. your marketing may look more effective but the truth will be revealed eventually and you will never gain my trust again.

Interesting bad example would be iTunes. yes, I love my mac, after 12 years I can’t see my self going back to windows, but still, Apple made some arrogant mistakes in this area, iTunes is one of them. It’s the best music player in the market, I never used the itunes store to buy movies or TV shows, because for me itunes is for music, I would expect to find movies and such in Quicktime, but it didn’t really bother me. Then I got an iPod. syncing music from itunes forced apple to use an interface originally designed for playlists and songs for file system & disk utilities actions, this added a new kind of screen with new set of controls to the ones I already knew in iTunes, which immediately made the entire app a bit more scary.
And then I got an iPhone, and the AppStore, and then came Ping, and over and over again the whole iTunes experience was stretched to new areas. Why?
Wouldn’t it be easier for us users and you Apple to split this clutter into several existing applications? let iTunes play tunes, let iSync do sync and backup, let Quicktime play movies?

The dark side of the moon

Started working on a new & interesting project for Microsoft’s Innovation Lab, can’t disclose any details, but I can say it’s pretty exciting.
So now I can play with all the coolest gadgets scattered around the lab, drink as much coke as I want, and best, show-off the shiny blue apple on my Mac to all the poor guys here with their industrial-black-plastic-laptops.. :)
Microsoft Innovation Lab

Mysterious voodoo phenomenon with eclipse line numbers

Working with a second monitor in Flashbuilder4 on MacOS 10.6 Snow Leopard, I noticed that the line numbers weren’t scrolling along with the page, after a quick googling I found it is a known bug (here) and that there is a patch (here) that fixes it.
So I tried it – replaced the existing .jar file with the patched one I downloaded, run Flashbuilder in “clean” but it didn’t start, reported some error. after few attempts I decided to leave this for now as I am in the middle of a project. Sadly I rolled back to the original .jar and restarted Flashbuilder just to find out that now it works!

Could it have to do with the song I was listening to (‘Voodoo child’ by Jimi Hendrix)??

Update: Nope. stopped scrolling again :(