I have a clip that needs to fade out, as it gets closer to a boundary.
I have the boundaries set in and object called __bounds
Code:
public function setBounds(b) {
__bounds.top = b.yMin;
__bounds.bottom = b.yMax;
__bounds.left = b.xMin;
__bounds.right = b.xMax;
}
I also have a mc traveling at a specific velocity
Each clip has a random velocity
What I’m trying to do is create a function in my class to figure out
If my clip is within a 20-30-pixel distance of its boundary then fade out according to the speed it is coming towards the boundary.
I set up a function to fade if it was within 30 pixels of its boundary but the problem was to fade it according to the speed it is coming towards the boundary so it has totally faded out as it hits its boundary.
Can anyone explain how to do this?
Thanks