Danny Kopping
This user hasn't shared any biographical information
Posts by Danny Kopping
Flash Runtime implemented in JavaScript
Jan 13th
Now this completely threw me… I can’t believe how one guy can be so skilled!
This is completely ridiculous… Tobias Schneider has written a JavaScript-based Flash runtime! Well, this gives Internet Explorer another thing to completely fuck up! Very impressed indeed…
Using a Custom Cursor in Flex with CSS
Dec 16th
If you want to use a custom busyCursor animation in your Flex applications, you don’t need to do anything fancy… All you have to do is define one, solitary property in your CSS file:
CursorManager { /* You can use PNGs, SWFs or JPEGs */ busyCursor: Embed(source="path/to/your/resource"); }
To invoke the busy cursor, use the following line:
CursorManager.setBusyCursor();
…or you could set the showBusyCursor to true in your HTTPService or RemoteObject instances.
Converting GIF to SWF using Flash CS4
Dec 16th
A typical ballache… You want to use one of the cool loaders from http://ajaxload.info/ in your Flash/Flex apps, but it only generates a GIF file… So you’ll scour the net for a GIF2SWF application and you’ll undoubtedly come across a few, but you don’t have to look any further than Flash CS4 – surprisingly!
All you have to do is open a GIF file in Flash CS4 and it’ll automatically pull it apart and convert it to frames, which can then be converted to a SWF file
Hope it helps you at some point!
AMFPHP Genie v0.2
Dec 13th
AMFPHP Genie (0.2) is a simple tool to help you get shit done using Flex and AMFPHP.
Check out http://dannykopping.co.za/amfphp-genie/ for more information!
How's This For a Christmas Reading List?
Dec 13th
I decided to splurge a bit of loot on some new books (which i hope i’ll have time to ever read) with the money from a few invoices clearing over the past couple of weeks.
Here’s what I ordered… There are some great books here which i hope you’ll consider looking at:
- Breaking the Spell: Religion as a Natural Phenomenon by Daniel C Dennett
- The Age of Spiritual Machines by Ray Kurzweil
- Consciousness Explained by Daniel C Dennett
- Why People Believe Weird Things by Michael Shermer
- God is not Great – How Religion Poisons Everything by Christopher Hitchens
- Letter to a Christian Nation by Sam Harris
- Phantoms in the Brain – Probing the Mysteries of the Human Mind by V.S. Ramachandran
QuickTip: asSQL Connection Problem with non-localhost hostname
Dec 12th
asSQL is just great. It’s an ActionScript 3.0 library for connecting AIR applications to MySQL databases and it works brilliantly – when it works! Recently i gave it a shot again after an utter failure the last time i tried it… The library seems to be a port of the Java implementation of connecting to MySQL (Connections, Statements, Fields, etc). It takes a little getting used to but it’s an excellent library and i highly recommend it.
Background
My development environment is Windows-based (against my wishes… not enough loot or motivation for a Mac, lack of Adobe software on Linux) but i make up for this by running a virtual Linux installation in my Windows environment and networking the two together. It actually works really well, and the process for setting this up can be found here. To cut a very long and boring story short, essentially i cannot use localhost as your server when using this architecture since i have my LAMPP stack running on my Linux environment, so my “local server” can only be accessed using the IP address of the virtual system.
This complicates things a bit when trying to use asSQL to connect to my MySQL installation, because MySQL gets all paranoid and won’t accept connections from a foreign IP address (the IP of my Windows machine on which my AIR app is running)… To get around this, all you have to do is create a new user in MySQL (i used phpMyAdmin), set the user’s hostname to the IP address of your remote system (i’ve explained how to do this below) and you’re ready to rock and roll!
Solution
The first thing you need to do is get the IP address of the remote system…
Windows: Open the command line, type ipconfig
Linux & Mac: Open the terminal, type ifconfig
In this example, my IP address is 192.168.56.1
I’ll be using phpMyAdmin to fix the problem.
- Open phpMyAdmin and click on the Privileges tab.
- Click Add a new User
- Enter any username you like, paste the IP address obtained in the Host field and put in a password
- Under the Database for user panel, leave it at None
- Under the Global privileges, you can Check All
That should sort it out… Remember, this is HIGHLY insecure and should only be used on development environments and NOT production environments.
Children and Labels
Nov 22nd
I’m going to detach from my usual writing paradigm and shift over to the world of current affairs. As many of you may already have heard, the British Humanist Organization has come under fire recently for a new advertising campaign akin to their previous campaign (depicted below) that appeared on the side of several buses all over Britain.
This campaign was the invention of Ariane Sherine – a beautiful and intelligent proponent of the Humanist movement. This previous campaign enjoyed much notoriety and contention, and it had the backing of such highly public atheists like Richard Dawkins – one of my favourite authors and advocates of free-thinking and Atheism.
The BHA’s new campaign strays a little from the previous campaign’s focus of religion, and instead turns its attention to the highly controversial issue of children and the labeling thereof. The new advertisement (shown below) offers the view that metaphysical and ideological labels should not be tacked onto children before they have the mental capacity to invoke and employ Carl Sagan’s famed Baloney Detection Kit.
This new campaign will be seen across Britain but on billboards, not buses.
I was incredibly delighted to see an advertisement of this ilk being publicized and lately it has been popping up in vociferous articles in newspapers and on the net.
I personally applaud Ariane and the BHA for putting together these controversial and discussion-provoking posters. This debate about inculcation and indoctrination of very young and malleable minds is a heated one. We have all heard the impassioned and ardent rationalizations by the religious community advocating the teaching of scripture to children at a young age.
I’m tempted to invoke the practice by Islamic fundamentalists of raping their childrens’ minds with religious zeal and righteous dogma that finally evolves into a fervent hatred for infidels and the wielding of automatic rifles; it is not spurious to draw a parallel (in principle, not practice) between these extremists and the incredibly widespread Western practice of bringing up our children to believe in any of the not-yet defunct religions (and even sometimes defunct ones!).
Naturally, one will hear shrieks of indignation at this statement. I believe that it is not hyperbolic to assert that religious belief – whether it be a mawkish one like Anglicanism or a belligerent one like Islam – has the latent potential to turn an otherwise rational and calculating person into a mercenary for god. Now, if scripture can mar the mind of a full-grown human being, it can destroy the mind of a child if used in the wrong way.
What I love about this campaign is that it not only speaks out against religious labeling of children, but also shows a juxtaposition with ideological labels that we would never give to children – and they’re right! Why do we not call our children “Marxist” children or “Libertarian” children? That’s because to be a Marxist you need to (at least) understand political history and economic structures; to be a Libertarian you need to understand the concept of liberty, free market capitalism, etc.
If we are to actually take an interest in the future of our childrens’ lives, we need to afford them the opportunity to not have to be besieged by religious practices; to afford them the fundamental gift of critical thinking and rationality.
Religion can be used as a vehicle for good when it’s good, and for evil when it’s evil, but children have no business whatever is the mental masturbations of their parents.
Fixing that annoying feature of List controls
Nov 15th
Don’t you just hate it… Doesn’t it just piss you off when you want to display a gallery of images in Flex and Flex decides that it’s actually going to set it so that when you scroll, it’ll only then load the images displayed offscreen? I find this particularly “ball-ache-ish” with the TileList component.
I was browsing through the documentation like i had many times before, but this time i noticed the offscreenExtraRowsOrColumns property. At first you think “wtf” but then i got curious…
Say you have 25 images in a grid that displays one row of 5 images at a time:
The row in green will be the only row visible at this point in time. When you scroll, Flex will chuck out the first row and create the second row:
…and so on. Isn’t that just damn irritating? (If you’re thinking “nah, what’s the big deal?” then you obviously haven’t tried this before).
Anyway, the way to fix it is to tell Flex how many rows there are offscreen so that it can create them in the interim. This seems like a bit of a weird method because in the navigator classes (ViewStack, et al) there is a creationPolicy property which – when set to “all” – will create all the non-visible components before they’re navigated to, thus slowing down the processing a bit (depending on your app) but also speeding up the switch between views. Alas, no such property to be found in the TileList component. Can anybody tell me why? I think i should code a modified version of the TileList component to accept this property… +1 to TODO list… *sigh*
Hopefully this will help those of you experiencing the ball-ache that i did.
AIR 2.0
Nov 2nd
An exhaustive list of the new features of Adobe AIR 2.0 has been released
http://blogs.adobe.com/cantrell/archives/2009/10/everything_new_in_air_2.html

