Code not working in MTASC?

Just spent a couple of days trying to work out why the same code base was working differently in two different swfs. The reason: one was compiled in Flash and one was compiled in MTASC.

It was made all the more difficult to track down because the problem was occuring within some particularly complicated open source encryption code.

I finally worked out that the culprit was the Array instantiation. In the Flash IDE compiler it’s perfectly acceptable to use the syntax :

var w = Array(80);

which will give you an empty array. However, in MTASC it will silently fail and give you null! So I changed it to :

var w = new Array(80);

and now it works perfectly. So if you’re finding weird differences between MTASC and the Flash compiler, check your arrays!

2 replies on “Code not working in MTASC?”

Comments are closed.