2012-09-21

JSFL and Flash

Just a short post so I'll be able to find this in the future. I just decided to start look into JSFL, the reason is that I found a lot of FLA-files in the past where there are a lot of items that are "exported/imported" that I need to access. And they are found in deep hierarchies and kind of hard to grasp. So I'm about to start organizing these and place them in seperate folders.

Found this great page where you can start using something called "organizeLibrary". I will probably expand on this in the future.

http://code.google.com/p/guttershark/source/browse/branches/development/lib/jsfl/?r=405

2012-09-05

Windows7 Firewall turn off doesn't mean turn off

So, two days ago I installed Guild Wars 2 and intended to play. I had some issues with accessing internet so I did some regular port forwarding in router (80, 443, 6112, 6600) and turned off windows firewall.

After a couple of hours of trying to figure out what's wrong it turns out that by deactivating windows firewall, NO new applications can access internet. So when you turn off windows firewall, the only that thing that REALLY happens is that you turn off queries for allowing applications to access internet that previously hasn't been marked as safe. That's a new functionality of "turn off" that I previously wasn't aware of.

Oh Microsoft, why, why, why?

2012-09-04

Providing default values if null or empty

So, I was curious about wether there were a better way to do stuff like:


_parsedBetData["prizeLevel"] = params["prizeLevel"] == null ? "default" : params["prizeLevel"];
And posted my question on StackOverflow turns out this could be solved with the help of a regular ||=. 
So that specific code can be simplified as
_parsedBetData["prizeLevel"] = params["prizeLevel"] || "default";
If you are interested in providing a default value if _parsedBetData["prizeLevel"] is null or empty that can simply be done by:
_parsedBetData["prizeLevel"] ||= "default";
It's important to note that the check would return false for both and empty string and null.