lundi 21 décembre 2015

convert action script 2 to action script 3

OK I read the forums and seems like anyone asking about converting AS2 to AS3 gets flamed with posts like "why would you use AS2, just rewrite it in AS3 from scratch". So please do not answer like this, I just need help figuring out this particular snippet of the code. This is AS2, I have no clue what it is trying to do.

if (_root.components == undefined) {
     _root.components = "";
_root.components = _root.components + _root.getInstanceAtDepth(this.getDepth()) + " ";

I googled the individual methods 'getInstanceAtDepth' and 'getDepth', and understand they deal with the layering of the movie. Trouble is '_root.components'. If this is referring to a movieclip as 'root', then there is no method or property named 'components'. You can put components on the stage and make them a part of the movieclip fla file but again this does not seem to explain what the code is doing. Does anyone have any idea what _root could be referring to here, what object has a property 'components'?


Aucun commentaire:

Enregistrer un commentaire