Seb Lee-Delisle

Menu

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!

This entry was posted in Actionscript, Flash. Bookmark the permalink.

2 Responses to Code not working in MTASC?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *