Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › How to create Disney like Fairy Dust (Pixie Dust)

  • How to create Disney like Fairy Dust (Pixie Dust)

    Posted by Daniel Martin on September 5, 2007 at 5:44 pm

    I am a beginner in After Effects Expressions and want to do something a bit complicated.

    I want to have “Pixie Dust” follow a charator. I can create this effect in Flash, but I don’t really know what to do in After Effects.

    In Flash I have a graphic “Star”. In AE a solid.

    In Flash I have a movie “StarSpin”. In AE a comp. “StarSpin” spins the “Star”.

    In Flash I have a movie “Sparkle”. It is three KeyFrames with code.
    The first keyframe sets position, a random velocity, and its Life.
    The second keyframe gets the current position and adds the velocity to it. Using Life it reduces the opacity and scale. It also checks to see if the life is less than zero and then it removes the movie.
    The third keyframe is just creates a loop to the second. the loop continues till the movie removes itself from the scene.

    In Flash in the main scene I replicate the movie as the Mouse moves.

    Below is the code in Flash. Does anyone know what I could do to do the same in AE?

    MAIN SCENE
    var n = 1;
    _root.sparkle._visible=false;
    _root.onMouseMove = function() {
    var t = “sparkle” + n;
    duplicateMovieClip(“_root.sparkle”, t, n);
    n = Number(n)+1;
    };

    SPARKLE-KeyFrame1
    // Initialize particle
    this._x=_root._xmouse;
    this._y=_root._ymouse;
    this._visible=true;
    // Initialize X and Y velocities
    vx = (random(3)-1)/5;
    vy = (random(3)-1)/5;
    // Set number of loops particle will live
    life = 70;

    SPARKLE-KeyFrame2
    // Get current position and add XYVelocities
    curx = getProperty(“”, _x);
    cury = getProperty(“”, _y);
    this._x=this._x+vx;
    this._y=this._y+vy;
    // Alpha is dependent on proximity to death
    ap = 100*life/70;
    this._alpha=ap;
    this._xscale=ap;
    this._yscale=ap;
    // Eratic behavior closer to death
    vx = Number(vx)+Number((random(51)-25)/ap);
    vy = Number(vy)+Number((random(51)-25)/ap);
    // Reduce particle life
    life = life-1;
    if (Number(life)<0) {
    // Life counter is up, remove particle
    this.removeMovieClip;
    stop ();
    }

    SPARKLE-KeyFrame3
    // Repeat until particle is dead
    gotoAndPlay(_currentframe-1);

    Daniel Martin replied 19 years ago 2 Members · 3 Replies
  • 3 Replies

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy