November 10th, 2008
admin
I’ve found a solution to creating singleton classes that make it absolutely impossible for any class outside it to instantiate it directly.
The idea is that you create an inline class (in this case called ‘SingletonEnforcer’) and require an instance of that inline class as a parameter in the constructor of the singleton class. No class outside of it can instantiate SingletonEnforcer, and therefore no class outside of it can directly instantiate the singleton class itself!
Here’s the example code:
package
{
public class SingletonClass
{
private static var instance : SingletonClass;
public static function getInstance() : SingletonClass
{
if (!instance)
{
instance = new SingletonClass(new SingletonEnforcer());
}
return instance;
}
public function SingletonClass(enforcer : SingletonEnforcer)
{
if (!enforcer)
{
throw new Error(”SingletonClass must be instantiated through SingletonClass.getInstance()”);
}
}
}
}
class SingletonEnforcer {}
I’ve found this example on PixelBreaker’s blog. Check it out.
In the project I’m currently working on, I found that HTML links in textfields weren’t properly executing, although the text seemed to be rendered properly. My mouse cursor even changed to a hand cursor on rollover of the link within the text, but I could only actually ópen the link through the context menu that popped up after a control-click (or right click for the PC user).
After some searching, I found the simple answer to my problem on the Flex Examples blog: in order for the HTML link to be properly executed, the ’selectable’ property of the containing TextField must be set to ‘true’! If the text is not selectable, your HTML link won’t automatically be opened on click. Way to go Adobe!
Right now I’m working on a project in which Flex integrates Flash components in its application and we encountered the infamous yellow focus borders when hitting the tab key from inside the application.
It wasn’t as easy as I thought it would be to Google the solution to prevent the ugly yellow rectangles from being displayed. I’ve found the solution in the Flex help though, so I’ll try to improve the search results on Google by providing the solution here.
When you look at the focusRect property description of flash.display.InteractiveObject, it says: “Specifies whether this object displays a focus rectangle. A value of null indicates that this object obeys the stageFocusRect property set on the Stage.”
And there’s your solution! In your Flex application, create a method that is called on creationComplete and in this method add the following code:
stage.stageFocusRect = null;
Now all focus rectangles are globally disabled in your application. It’s as simple as that.
September 9th, 2008
admin
I’ve just presented my graduation work on the physical induction of emotions and an implementation for entertainment on the IFIP Entertainment Computing Symposium.
The presentation can be downloaded at http://www.rockabit.com/downloads/IFIP_ECS_2008.ppt.
The paper can be downloaded in PDF format here:
full version (16 pages)
short version (8 pages)
September 9th, 2008
admin
Here’s some small experiments I did in ActionScript 3 with particles in combination with perlin noise determining how they move.
In all cases it’s a bunch of particles placed in a circle, each one having its position linked to a randomly chosen pixel in a scrolling perlin noise filled bitmap. The third example has only a few particles and interconnects them with a curve, creating a moving type of amorphous blob.
pulsating iris
pulsating fountain
globule
Edit: I’ve added a small motion blur effect to the globule to make it a little bit more interesting, visually.
I’ve just upgraded my blog with the newest version of the software, so that I can add posts from my iPhone.
It is now WordPress version 2.6.1 and if you can read this, then blogging from my mobile works!
Let’s see if this works to increase my blogging frequency
I recently ‘beautified’ the design of my travel blog and it’s now online at www.reisabit.com (beware: it’s in Dutch).
Before, it looked too much like an application, very rigid and unpersonal. The color scheme was also too dark, using black and dark red.
Hopefully this new design gives the website a more open feel.
After having helped to expand the functionality of the new video player for the Netherlands Public Broadcasting (NPO) this player is now in the news and appears to be the subject of political debate here in Holland.
Complaints about how the online video broadcasts of NPO are only available in Microsoft based formats have apparently even led to concerns from politicians. It’s a good thing that the NPO is switching to Flash to display their video content then
The player is quite nice, with functionality like embedding only a fragment of a video, adding comments on the timeline and subscribing to a series. You can try it out on http://pilot.omroepplayer.nl.
Remember when you saw that cool QuickTime movie on the web, but couldn’t save it because you didn’t have QuickTime Pro installed?
Well, I found a post by Electric Monk explaining how to easily get around this problem:
1. Open the file in your stand alone QuickTime player, not in your browser
2. Do a ctrl-click on the first or last frame of the movie (you might lose that frame) and select Cut
3. Close the window
4. Confirm that you want to save the changes you’ve made
5. Specify where to save the file
I couldn’t believe it would be that simple, but it is! No need to buy Pro, you can now save any QuickTime movie through the regular player! Thanks, Electric Monk!
Original post:
http://www.macosxhints.com/article.php?story=20050430173712176