Eric,

Using the function for a parabola is the easiest way I can think of to let you drag a clip in an arc (but it's not quite the same as the yepp example -- you'd need to have the equation for that curve or figure out how to do it with a bezier for that kind of motion). Here is some code which will make a square and a parabola and drag the square along that curve and change its scale and alpha according to where it is (paste into empty movie to see):

// parabola equation for curve facing left:   y**2 = -4ax
function parabola_x(a:Number, y:Number) {
   return( 0 - (y * y / (4 * a)) );
}

this.createEmptyMovieClip("s", 2);
s.beginFill(0,100);
s.moveTo(-20,-20);
s.lineTo(20,-20);
s.lineTo(20,20);
s.lineTo(-20,20);
s.endFill();

// vary a to change the shape of the parabola
var a:Number = 50;
this.createEmptyMovieClip("curve", 1);
curve.lineStyle(2, 0x666666, 100);
curve.moveTo(200+parabola_x(a, -100), -100);
for (var y=(-90); y<100; y+=10) {
   curve.lineTo(200+parabola_x(a, y), y);
}
curve._y += 200;
s._x = 200+parabola_x(a, 0);
s._y = 200;
s.onPress = function() {
   this.startDrag();
   this.onMouseMove = function() {
       this._x = 200 + parabola_x(a, 200-this._y);
this._xscale = this._yscale = this._alpha = 140 - Math.abs(200 - this._y);
   }
}

s.onRelease = s.onReleaseOutside = function() {
   delete this.onMouseMove;
   this.stopDrag();
}

Helen

--
http://flash-creations.com
http://i-technica.com



eric dolecki wrote:

Thats very cool too - but I would like to dynamically affect the position of
a MC, not using a tween engine where i tell it go from here to there. I just
wanna be able to tell a mc to be:

a scale
an alpha
at this x, y

and when I move my mouse up/down, affect all three of those, while moving it
on an arc.

    http://www.ericd.net/new_css/img/arc.jpg

Like that - ultimately with more than one object - using a bunch of them...



On 3/3/06, Moses Gunesch <[EMAIL PROTECTED]> wrote:
Eric,

Yeah Uhlmann's stuff is incredible, really sophisticated, although I
agree with you that it's not as approachable as it could be. Robert
Penner wrote a move-on-path thing that's been used in a lot of these
types of products. He da man.

Fuse 1.1 has simple (cubic) bezier functionality, and it's pretty
easy to use because you can pass relative positions for the control
points, much easier than absolute ones. Adding other tween props into
a bezier tween in no problem. (Check out fuse at my site
mosessupposes.com. It got a warm response at my Flash Forward pres,
which was really a great experience.)

Moses


On Mar 3, 2006, at 11:30 AM, eric dolecki wrote:

I foud something called AnimationPackage and its a huge collection
of stuff
- but I think its overkill :/ Nice stuff though!

I'd like to generate a curve (not a circle) - one that bows out to
the
right... and animate mcs along the curve. Up and down. Once I can
get that
working, I'll play with scale.
_______________________________________________


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to