Nils and I are talking about the same thing, I think. Basically, when
I use a MovieMaterial, I can interact with individual movieclips
inside the MovieMaterial. When I use a PhongMovieMaterial, it looks
like I can't.
Below is my even more simplified code I was using to try to reproduce
the behavior if it helps. When I use a MovieMaterial as the material
type, clicking on the sprites / movie clips inside the material shows
interactivity (both sprites output "clicked me"). When I use a
PhongMovieMaterial as the material type, leaving everything else the
same, it doesn't. Possibly this behavior is by design and/or I'm
doing something wrong - if anyone can lend any insight it'd be much
appreciated.
Thanks,
Scott
function testThingsOut():void
{
var materialSprite:Sprite = new Sprite();
var colorBackground:Sprite = new Sprite();
colorBackground.graphics.beginFill(ObjectBuilder.DEFAULTCOLOR);
colorBackground.graphics.drawRect(0, 0, 512, 512);
materialSprite.addChild(colorBackground);
colorBackground.addEventListener(MouseEvent.CLICK,
textureClickHandler);
materialSprite.addEventListener(MouseEvent.CLICK,
textureClickHandler);
var phongMovieMaterial:PhongMovieMaterial = new PhongMovieMaterial
(materialSprite, {smoooth:true, interactive:true});
//var movieMaterial:MovieMaterial = new MovieMaterial
(materialSprite, {smooth:true, interactive:true});
var s:Sphere = new Sphere({material: phongMovieMaterial, radius:
200, segmentsW:20, segmentsH:10});
s.ownCanvas = true;
scene.addChild(s);
}
function textureClickHandler(e:MouseEvent)
{
trace("clicked me");
}
On Aug 21, 4:20 am, Plopsi <[email protected]> wrote:
> Ok i uploaded a example you can fing it here:
>
> http://groups.google.com/group/away3d-dev/web/phongmoviematerial_bug_...
>
> the example is quiet simple, sry for that, but you can see that there
> is no interactivity with PMM change the lines in PlaneContent to
> MovieMaterial and you can see that at MM the interactive also isn't
> working every time, i'm pretty sure this two 'bug' are caused by the
> same problem. I did some minor changes on the MM and PMM classes, so i
> included them to the rar file. I marked the changes with a comment //
> CHANGED.
>
> use the left mousebutton to swap pages and the spacebar to reset.
>
> Greets
>
> Nils Diestler
>
> On 21 Aug., 11:48, Plopsi <[email protected]> wrote:
>
>
>
> > hm, no i don't think thats what e means, i made some tests and with
> > PhongMovieMaterial I don't get MouseEvents from the movieclip (even
> > the hovers don't work on a button i putted into the MovieClip i used
> > for PMM). I also realized that the interactivity on MovieMaterial
> > seems also to be a little bit choppy and not always works, but i have
> > to look into this and test maybe this was my fault.
>
> > I try to put an example here, but i'm not sure when i have the time to
> > do this.
>
> > Nils
>
> > On 21 Aug., 11:23, Rob Bateman <[email protected]> wrote:
>
> > > Hey Scott
>
> > > well, you should still be able to get mouse events off the phongmaterial,
> > > but at present the uv coords from the underlying texture won't be passed
> > > to
> > > the mouseevent3d object. is this what you mean?
>
> > > if you can't get any form of mouse interactivity with the
> > > phongbitmapmateiral, this is a bug and needs to be logged in teh issues
> > > tracker
>
> > > cheers
>
> > > Rob
>
> > > On Fri, Aug 21, 2009 at 1:40 AM, scott <[email protected]> wrote:
>
> > > > Hello,
>
> > > > I'm trying to use a PhongMovieMaterial to show shading while
> > > > supporting the same type of interactivity as a regular MovieMaterial.
> > > > Doesn't look like this is supported with PhongMovieMaterial - just
> > > > wanted to check that this is in fact the case, and if anyone has any
> > > > ideas for possible workarounds. Basically I want to create an
> > > > interactive material that also shows shading in conjunction with a
> > > > DirectionalLight3D or another type of light. If anyone can help with
> > > > advice that would be great.
>
> > > > Thanks,
>
> > > > Scott
>
> > > --
> > > Rob Bateman
> > > Flash Development & Consultancy
>
> > > [email protected] Hide quoted
> > > text -
>
> - Show quoted text -