Posts categorized “Actionscript”.

Using mercurial with eclipse to edit actionscript files on os x

We have recently switched to use mercurial as our DVCS. We’re hosting our many repositories on bitbucket.

I love it.

When it comes to actionscript files, flash has always had odd newlines. For some reason, it has always used \r as it’s newline. Mercurial, beeing a unix tool, likes it’s newlines to be \n. So what better to do, than to make mercurial encode/decode the files for us.

To do that, we can simply add the following to our .hgrc file:

[encode]
*.as = perl -pe 's/\r/\n/g'

[decode]
*.as = perl -pe 's/\r/\n/g'

I don’t really know wether the decode part is necessary, but I like to keep it around (if someone should commit poison).

Actionscript 3 – posting XML data with URLLoader

So, you want to POST some XML data to a web service.

Let’s for the fun of it say, that we would like to POST the following piece of XML to a PHP script:

1
<request command="run-command" />

More… »