Hi,

Well I tried to do it the way in that thread.

2 problems :

1) I'm not using the Tweener class , I use TweenLite
2) I don't want to tween the color over time. I just want to apply a
tint to it based on the slider value.

Here's my attempt :

private function onSliderChange(evt:SliderEvent):void
                {
                        var clr:Color = new Color(0xFFFF00);
                        clr.setTint(0xFF0000, evt.value / 100);
                        TweenLite.to(plane.material, 0, {color:clr.color,
ease:Linear.easeNone});
                }

Problem in the code above is , when the slider value = 0, the
clr.color is Black. Shouldn't it be Yellow , which I've set it to
initially ?

Thanks

Sameer

On May 5, 1:06 am, savagelook <[email protected]> wrote:
> http://groups.google.com/group/away3d-dev/browse_thread/thread/3fee58...
>
> On May 4, 3:05 pm, smaira <[email protected]> wrote:
>
> > Hi,
>
> > I'm a beginner using Away3D. I'm trying to achieve something simple (I
> > guess!). I've made an example in flash to explain what I'm trying to
> > do. Basically, I would like that the color of a mesh changes from 0%
> > (Yellow) to 100% (Red) based on a slider. The problem is that I am
> > applying a ColorMaterial on the faces. I looked at the docs and the
> > ColorMaterial doesn't have any "Tint" property or a function to do so.
> > Neither can I set the Blend Mode to additive or something. I'm
> > guessing that how the tinting would work is that the "Base" color of
> > the face would be set to "Yellow" and a Red tint with an alpha value
> > (based on the slider) would be added on it. Right ?
>
> > I'd really appreciate it, if someone could point me in the right
> > direction.
>
> > Here's my flash example with a movieclip instead of a mesh 
> > :http://dazzlecode.com/downloads/ChangeTint.swf
>
> > Thanks a bunch
>
> > Cheers!
>
> > -Sameer

Reply via email to