Grabbing assets out of AIR apps

12 03 2009

I’ve done some work in the past with the Konfabulator (Now Yahoo! Widgets) widget patform and the workflow (no IDE) was that you used to rename the .widge files to .zip and decompress in order to view the JS and XML source. I was nosing at a few AIR apps today (Frienddeck and a Merapi AS3 to Java bridge application – in order to grab Skype metadata) and thought I’d give this method a test and yes you can kind of do the same with AIR! 

 Rename the .air to .zip and decompress (I use Winzip) – it throws an error but you get some source including a .swf which you can then run through a decompiler (I use Sothink) and you get the symbols (PNG’s, Movieclips etc…). This could be useful under certain circumstances so I thought I’d share. Cheerio :)



Excellent free HTML Editor for Eclipse

4 03 2009

Doing some AS3 projects in FDT (Eclipse plug in) with FlashVars & SWFAddress and it’s so good being able to pop into a decent HTML Editor in the same IDE. It’s just as good as EditPlus & free. Lovely. Just drop the .jar in your plugins directory. Details and Sourceforge link here 



JS String replace chars function

5 12 2007

handy way to replace chars in strings with JS

[code lang="javascript"]
function replace (origStr, searchStr, replaceStr) {
var tempStr = "";
var startIndex = 0;
if (searchStr == "") {
return origStr;
}
if (origStr.indexOf(searchStr) != -1) {
while ((searchIndex = origStr.indexOf(searchStr, startIndex)) != -1) {
tempStr += origStr.substring(startIndex, searchIndex);
tempStr += replaceStr;
startIndex = searchIndex + searchStr.length;
}
return tempStr + origStr.substring(startIndex);
} else {
return origStr;
}
}

[/code]



JS Get query string variables

5 12 2007

Easy way to grab Variables from the query string using JS
[code lang="javascript"]

function getQueryStringVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;
var pair = vars[i].split("=");
if (pair[0] == variable) {
// Var value or just true if exists - your call
//return pair[1];
return true;
}
}
return false;
}
[/code]