capeachino
Technical User
Hi everyone,
You can download the file from here:
so I have this very simple slider which when you drag it, it switches between 5 MCs. What I want to do is when the slider is at the point where it should switch the MCs a simple fade tweening happens.
I have been going crazy trying to figure it out. Please any help is very much appreciated. I am sure it's an easy fix, but I really can't figure it out.
Thanks a Million!!
Here's the CODE that's on the frame 1 in the stage:
stop();
// What's Visible
import mx.transitions.*;
import mx.transitions.easing.*;
mc01._alpha = 100;
mc02._alpha = 0;
mc03._alpha = 0;
mc04._alpha = 0;
mc05._alpha = 0;
// Slider MC interaction
this.onEnterFrame=function(){
if (sliding.ratio >= 0)
{
new Tween(mc01, "_alpha", Regular.easeOut, 0, 100, 1, true);
mc02._alpha = 0;
mc03._alpha = 0;
mc04._alpha = 0;
mc05._alpha = 0;
if (sliding.ratio >= 20)
{
new Tween(mc01, "_alpha", Regular.easeOut, 100, 0, 1, true);
new Tween(mc02, "_alpha", Regular.easeOut, 0, 100, 1, true);
mc03._alpha = 0;
mc04._alpha = 0;
mc05._alpha = 0;
if (sliding.ratio >= 40)
{
mc01._alpha = 0;
new Tween(mc02, "_alpha", Regular.easeOut, 100, 0, 1, true);
new Tween(mc03, "_alpha", Regular.easeOut, 0, 100, 1, true);
mc04._alpha = 0;
mc05._alpha = 0;
if (sliding.ratio >= 60)
{
mc01._alpha = 0;
mc02._alpha = 0;
new Tween(mc03, "_alpha", Regular.easeOut, 100, 0, 1, true);
new Tween(mc04, "_alpha", Regular.easeOut, 0, 100, 1, true);
mc05._alpha = 0;
if (sliding.ratio >= 80)
{
mc01._alpha = 0;
mc02._alpha = 0;
mc03._alpha = 0;
new Tween(mc04, "_alpha", Regular.easeOut, 100, 0, 1, true);
new Tween(mc05, "_alpha", Regular.easeOut, 0, 100, 1, true);
}
}
}
}
}
}
You can download the file from here:
so I have this very simple slider which when you drag it, it switches between 5 MCs. What I want to do is when the slider is at the point where it should switch the MCs a simple fade tweening happens.
I have been going crazy trying to figure it out. Please any help is very much appreciated. I am sure it's an easy fix, but I really can't figure it out.
Thanks a Million!!
Here's the CODE that's on the frame 1 in the stage:
stop();
// What's Visible
import mx.transitions.*;
import mx.transitions.easing.*;
mc01._alpha = 100;
mc02._alpha = 0;
mc03._alpha = 0;
mc04._alpha = 0;
mc05._alpha = 0;
// Slider MC interaction
this.onEnterFrame=function(){
if (sliding.ratio >= 0)
{
new Tween(mc01, "_alpha", Regular.easeOut, 0, 100, 1, true);
mc02._alpha = 0;
mc03._alpha = 0;
mc04._alpha = 0;
mc05._alpha = 0;
if (sliding.ratio >= 20)
{
new Tween(mc01, "_alpha", Regular.easeOut, 100, 0, 1, true);
new Tween(mc02, "_alpha", Regular.easeOut, 0, 100, 1, true);
mc03._alpha = 0;
mc04._alpha = 0;
mc05._alpha = 0;
if (sliding.ratio >= 40)
{
mc01._alpha = 0;
new Tween(mc02, "_alpha", Regular.easeOut, 100, 0, 1, true);
new Tween(mc03, "_alpha", Regular.easeOut, 0, 100, 1, true);
mc04._alpha = 0;
mc05._alpha = 0;
if (sliding.ratio >= 60)
{
mc01._alpha = 0;
mc02._alpha = 0;
new Tween(mc03, "_alpha", Regular.easeOut, 100, 0, 1, true);
new Tween(mc04, "_alpha", Regular.easeOut, 0, 100, 1, true);
mc05._alpha = 0;
if (sliding.ratio >= 80)
{
mc01._alpha = 0;
mc02._alpha = 0;
mc03._alpha = 0;
new Tween(mc04, "_alpha", Regular.easeOut, 100, 0, 1, true);
new Tween(mc05, "_alpha", Regular.easeOut, 0, 100, 1, true);
}
}
}
}
}
}