March 24, 2010

   |   

By Ryan Robinson

   |   

No Comments »

After spending a decent amount of time searching, I was unable to find any helpful postings on this very simple Papervision task, so here is a quick workaround.

Once you’ve created a MovieAssetMaterial, the 2D MovieClip inside the material can be referenced via the movie property (i.e. MyAssetMaterial.movie). The problem is that the display list inside is not direcly accessible since the movie property is typed as “DisplayObject” rather than MovieClip or Sprite as needed. So you must type it yourself! Example:

1
2
3
4
5
var testMaterial:MovieAssetMaterial = new MovieAssetMaterial("firstClip", true, false, false, true)

var myClip = MovieClip(testMaterial.movie);
var myText = myClip.getChildByName("menuLabel");
myText.text = "Updated Dynamic Text";
Posted in Flash



Leave a Reply