[Papervision3D] movieAssetMaterial play and stop

Buti butilon at gmail.com
Tue Jul 14 11:46:43 PDT 2009


I use this function. Don't remember where I got it.

protected function getMaterial(donde:*):MovieClip{
	var mat:MovieMaterial = donde.material as MovieMaterial;
	if( mat ){
	// cast as our sub class, then test for null
		var mov:MovieClip = mat.movie as MovieClip;
		if( mov ){
			// now you’re talking to the instance directly
			return mov;
		}
	}
			return null;
}

var obj:*= getMaterial(plane as displayObject3D);
obj.rollover();


Javier España | javierespana.com wrote:
> Hi there,
> 
> I have managed to create a Plane with a material that is a running 
> movieClip with 8 frames. The thing is that I want to be able to play and 
> stop that movieClip that's acting as the material of the Plane but can't 
> seem to get to it...
> 
> Here's how I load it:
> 
> movieAssetMaterial = new MovieAssetMaterial("walkingTest", true);
> movieAssetMaterial.animated = true;
> movieAssetMaterial.doubleSided = true;
> movieAssetMaterial.interactive = true;
> 
> walkingDoll = new Plane(movieAssetMaterial, 600, 600, 3, 3);
> scene.addChild(walkingDoll);
> 
> That movieClip called "walkingTest" that I'm using as the material, has 
> another movieClip inside it called animatedDoll that is the one I need 
> to play and stop. Any help on how to reach it? If I use:
> 
> walkingTest.animatedDoll.stop();
> 
> I get an error...
> 
> Thanks a lot,
> 
> Javier
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org





More information about the Papervision3D mailing list