[Papervision3D] MovieScene3D.getChild()
Patrick Matte | BLITZ
PMatte at blitzagency.com
Mon Jun 18 16:14:33 EDT 2007
Yeah that property would be best cause you wouldn't need to loop through the spriteList to find that DisplayObject3D.
BLITZ | Patrick Matte 310-551-0200 x214
From: Papervision3D-bounces at osflash.org [mailto:Papervision3D-bounces at osflash.org] On Behalf Of John Grden
Sent: Monday, June 18, 2007 12:59 PM
To: Papervision3D at osflash.org
Subject: Re: [Papervision3D] MovieScene3D.getChild()
in as3 we wouldn't get away with that since Sprite doesn't have that property (it's not a dynamic object, so we can't have inappropriate relations with it).
what would be nice, and this is part of our rewrite discussion, is to designate an object that extends Sprite for PV3D to use when creating the containers. And, you'd probably be right, if right about now, you were thinking we should create a Sprite3D() and use that ;)
It's a good argument. I'm glad we had it ;)
On 6/18/07, Patrick Matte | BLITZ <PMatte at blitzagency.com <mailto:PMatte at blitzagency.com> > wrote:
Yeah that's why I thought you guys should put it in the source code.
Or maybe just create a simple reference to the DisplayObject3D inside the container...
Like :
private function mouseDownEvent( e : MouseEvent ) : void {
var cube:DisplayObject3D = e.target.displayObject3D;
trace("cube = " + cube);
}
BLITZ | Patrick Matte 310-551-0200 x214
From: Papervision3D-bounces at osflash.org<mailto:Papervision3D-bounces at osflash.org> [mailto: Papervision3D-bounces at osflash.org<mailto:Papervision3D-bounces at osflash.org>] On Behalf Of John Grden
Sent: Monday, June 18, 2007 11:25 AM
To: Papervision3D at osflash.org<mailto:Papervision3D at osflash.org>
Subject: Re: [Papervision3D] MovieScene3D.getChild()
Hey Pat, I think that's useful
On 6/18/07, Patrick Matte | BLITZ <PMatte at blitzagency.com<mailto:PMatte at blitzagency.com>> wrote:
Hey Papervision guys, tell me if there's an easier way of doing this but I wrote this method for the MovieScene3D and I think it's pretty useful so maybe you'd like to add it. So here's the method :
public function getChild(container:Sprite):DisplayObject3D {
var child:DisplayObject3D;
for(var i in spriteList){
if(container == spriteList[i]){
child = i;
}
}
return child;
}
And it's used like this :
scene = new MovieScene3D(container);
for(var i=0;i<20;i++){
var plane:Plane = new Plane();
scene.addChild(plane);
plane.container.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownEvent);
}
private function mouseDownEvent( e : MouseEvent ) : void {
var cube:DisplayObject3D = scene.getChild (e.target as Sprite);
trace("cube = " + cube);
}
_______________________________________________
Papervision3D mailing list
Papervision3D at osflash.org<mailto:Papervision3D at osflash.org>
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
--
[ JPG ]
_______________________________________________
Papervision3D mailing list
Papervision3D at osflash.org<mailto:Papervision3D at osflash.org>
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
--
[ JPG ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20070618/a05de2a3/attachment.htm
More information about the Papervision3D
mailing list