addmethod on mouseover

Software: Away3D 4.x

Qbrain, Member
Posted: 23 December 2012 02:26 PM   Total Posts: 92

Hey Everyone,

Experimenting with away 4.1 is going good! Love it! This is maybe a silly little question compared to what I already achieved, but I simply don’t get this to work.

I am using the assesLibrary to load a couple of embedded meshes. I have for example a Mesh called “Poster_Thisonesformama”. I am giving this mesh a new multiplassmaterial inside my actrionscript file and give it a defuse,specular and normal map.

What I simply want to achieve is that if you go with your mouse over the mesh, the material of the mesh gets an outlinemethod, simply to give people feedback that the object is clickable.

I have the listeners MouseOver3D and MouseOut3D set up and they work when I trace stuff (did the mouseEnabled = true and stuff),

However, when I want to change the material I get the following error:

Main.as(608): col28 ErrorImplicit coercion of a value with static type away3d.materials:MaterialBase to a possibly unrelated type away3d.materials:TextureMultiPassMaterial

The problem, I think, is that the MaterialBase does not support the “addMethod” function.
Does anyone has a solution/example how to add/remove methods to materials on mouseover?

thanks!

-Q

   

Avatar
loth, Sr. Member
Posted: 24 December 2012 12:44 PM   Total Posts: 236   [ # 1 ]

maybe you can force type
MaterialBase(myMaterial);
is juste a idea

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X