getURL: length, same window

So, linking to a url outside of the swf. Wanted to open the url in the same browser window each time. You’d think that getURL(myURL, “myWindow”) would always open the same window. But, it’s inconsistent. So, you can call JavaScript to force the same window to open – but, the character length of the url has to be a lot shorter for the JavaScript call to work. Anyway, this was a pain, hopefully this will save someone a few hours of mind-numbingly-boring testing.

public function load(url_ : String) : Void {
//this doesn't work if over a certain length
if (url_.length< =165){
//957 works for MIE7 and FireFox - this works for MIE 6.029... (really long version #)
//if (url_.length<=957){
var urlToCall : String;
urlToCall="javascript:var popWin; if (!popWin || popWin.closed) {popWin = window.open('"+url_+"','popWinName')} else {popWin.focus(); popWin.location.replace('"+url_+"');}; void(0);";
getURL (urlToCall);
}else{
//call doesn't happen if over 2041
if (url_.length>2041){
url_=url_.slice(0,2041);
}
getURL(url_, "myWindow");
}
}

Tested on FireFox 2.004. MIE 7 and MIE 6.029 – WinXP. Swf published for Player 7 using MTASC 1.12. Swf embedded using swfObject.

Obviously this not really Flash’s fault but some combination of Flash, JavaScript, and the browser. Browsers suck.

Flash Player and Flex Betas

Beta of Flex 3 is posted on Labs.

And beta of Player 9 also posted.

The player beta will leverage your computer’s video card for faster rendering (apparently only in full-screen mode). And will cache Flex components, so Flex apps can be deployed as smaller swfs.

Justin has a post on the player here.

Wow – I haven’t posted for a month. So much for the once a week posting resolution. We just moved to a new house – that is my current excuse. Actually it’s a pretty good one. I now paint rooms instead of blog.