MovieAssetMaterial: reference to root lost?

2 messages Options
Embed this post
Permalink
Lars Schwarz

MovieAssetMaterial: reference to root lost?

Reply Threaded More More options
Print post
Permalink
hi all,

i'm trying to reference a function on root (yeah, good old timeline
based application) from within
a MovieAssetMaterial but it's always "returning" null. it's a nested
movieclip in the material firing
a click event and from within the mousevent i'm trying to call the
function on root. "this" and "parent"
are null also. material is interactive, scene, too.

what am i missing?

all works just fine when i place the movieclip as regular display
object on the stage for testing purpose.

thanks: lars

_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
Krobill

Re: MovieAssetMaterial: reference to root lost?

Reply Threaded More More options
Print post
Permalink
Hi,

you can't access the root property unless your movieClip is actually part of the display list currently displayed by your flash application. Even if papervision uses it as a material ressource and it shows somehow on screen, it doesn't mean it has been added as a regular child or descendant of your scene, so its root property is null. To access a 'root' function, providing you're using a class document (you really should), one of your option is to use a static variable pointing to your stage. This var can then be used to access any public function you'll define in the class document from anywhere.

Hope it helps,

Alain
www.alkemi-games.com

Lars Schwarz wrote:
hi all,

i'm trying to reference a function on root (yeah, good old timeline
based application) from within
a MovieAssetMaterial but it's always "returning" null. it's a nested
movieclip in the material firing
a click event and from within the mousevent i'm trying to call the
function on root. "this" and "parent"
are null also. material is interactive, scene, too.

what am i missing?

all works just fine when i place the movieclip as regular display
object on the stage for testing purpose.

thanks: lars

_______________________________________________
Papervision3D mailing list
Papervision3D@osflash.org
http://osflash.org/mailman/listinfo/papervision3d_osflash.org