AS2/AS3 root

AS2 ActionScript Code:

_root.gotoAndPlay("whatever");

AS3 ActionScript Code:

MovieClip(root).gotoAndPlay("whatever");

This casting to the MovieClip type has been explained many times on these forums. Basically, the reason for this is that there are cases where „root“ might not be a MovieClip, for example, if you used a Document Class that extended Sprite instead of MovieClip.

Dieser Eintrag wurde veröffentlicht in Allgemein von admin. Setze ein Lesezeichen zum Permalink.