Whenever we interact with the world, we use an interface. Most shoes are easy to put on because the process of slipping feet into them is easy. Your typical shoe interface is simple and elegant, at least until you get to the laces.
My friends at Needmore Designs noticed a problem with the latest ActionScript, the language used to create Flash movies:
And until recently, it was appropriately simple: you just use the getURL command, and pass it a string exactly like you would in your web browser. Hard to improve on such simplicity and perfection, isn’t it?
Oh, but they have. Now you use the navigateToURL command… but you can’t just pass it the link… now you must first create a URLRequest object to pass it.
What Adobe must have seen as a technical fix was really an interface change. In the name of making something powerful, they removed a simple command that worked really well for most users.
There are tough decisions in determining any interface. Do you fix something you think is broken when many users have already learned it? There are trade-offs to making any change, even if you think it’s the right choice.
But in this case, Adobe and their users could have had it both ways. The getURL command could have put together its own call to the more complicated navigateToURL. Users could still have their old, simple way and their new, powerful method.
Raymond Brigleb says
Hear hear.
Phillip Kerman says
You could just do:
function getURL(url:String, window:String = null){
var request = new flash.net.URLRequest(url);
flash.net.navigateToURL(request,window);
}
Or, use AS2. I’m not sure the point exactly. I don’t think AS3 intentionally makes things difficult. Some stuff seems like overkill–but it’s all in the name of consistency.
Adam says
Agreed. Writing a wrapper seems like the obvious thing, which is why I think they should have included it!