«

»

Dec 01

Swishmax 4 – Pixie Dust Mouse Effect Tutorial

Example:

Step.1making the particle
You need to make your dust particle, to do this select the Rectangle Tool from the tools panel
and whilst holing down the Shift Key draw a uniform Square on your stage 100 x 100 pixels for now.

with the square selected go to the transform panel and make the rotation 45º

your square should now look like a diamond shape  on the stage.

Right click on the diamond shape and using the quadratic option make your diamond into your star shape pixie dust particle.

you can use whatever colour you like, just set it out as shown in the image below.

your particle should now look like the one shown below.

Step.2

Group the particle shape as a movieclip and name it twinkle
Group the twinkle movieclip as a movieclip and this time name it spark
your outline tree should now look like the image shown below.

right click on the spark movieclip click on Object Attibutes then Assets and apply the setting shown in the image below.

once you have set the linkage for the movieclip add the following script to the spark movieclip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
onFrame (1) {
    sparkle._alpha = 0;
decay = 3.000000E-002;
if (fallspeed == null)
{
    fallspeed = Math.random() * 1.500000E+000 + 5.000000E-001;
} 
if (totalDecay == null)
{
    totalDecay = 1;
}
else if (totalDecay <= 0)
{
    stop ();
}
else
{
    twinkle._y = twinkle._y + fallspeed;
    twinkle._rotation = 180 - Math.random() * 360;
    twinkle._yscale = totalDecay * (Math.random() * 20 + 100);
    twinkle._xscale = totalDecay * (twinkle._yscale / (Math.random() * 1 + 1));
    alpha1 = Math.random() * 100 + 70;
    alpha2 = Math.random() * 80 + 50;
    totalDecay = totalDecay - decay;
    if (alphacheck == 1)
    {
        alphacheck = 2;
        twinkle._alpha = totalDecay * alpha1;
    }
    else
    {
        alphacheck = 1;
        twinkle._alpha = totalDecay * alpha2;
    } 
} 
 
}
onFrame (2) {
 
    gotoAndPlay(1);
}

now the script is added, right click on the spark movieclip, click Library, Add to Library and apply the following setting as shown in the image below.

the spark movieclip will have now dissapeared from the outline and taken up residence in the Library.

Step.3
insert a new movieclip to the stage, leave it empty and name it sparkleEmmiter, group that movieclip as a movieclip and name it dust
see the image below for the outline view.

finally add the following script to the dust movieclip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
onFrame (1) {
this.sparkleEmmiter._visible = false;
var r = 2;
_parent.onMouseMove = function ()
{
    if (i == null)
    {
        i = 0;
    }
    sparkIt = !(i % r);
    if (sparkIt)
    {
        this.attachMovie("animatedSparkle", "spark" + i, this.getNextHighestDepth());
        this["spark" + i]._x = this._xmouse - Math.random() * 15;
        this["spark" + i]._y = this._ymouse - (Math.random() * 10 + 5);
        this["spark" + i].blendMode = 8;
    } 
    ++i;
};
 
}

That’s all there is to it, press ctrlt+t to test your movie in the flash player.

to make the twinkle random colours. add the following script to the existing script in frame 1 of the spark movieclip

1
2
3
myColor = Math.round( Math.random()*0xFFFFFF );
myColoredObject = new Color (twinkle);
myColoredObject.setRGB(myColor);

if you wish not to follow the tutorial you can but the source file for this tutorial below.
swishmax 4 swi file
this file will only open with swishmax 4.
please contact me if you want the file for another version of swishmax.
Price £2.50


VN:F [1.9.22_1171]
Rating: 5.0/5 (4 votes cast)
VN:F [1.9.22_1171]
Rating: +4 (from 4 votes)
Swishmax 4 - Pixie Dust Mouse Effect Tutorial, 5.0 out of 5 based on 4 ratings

2 comments

  1. solaris

    Very nice this effect, compliments
    but
    when I try the movie the star rotates only once and then it disappears,
    I can not understand why, but I run the tutorial step by step

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  2. Craig Lowe

    hello send me your file in an email with the link to this tutorial and i will take a look at were you might have gone wrong. craig at loweonline dot co dot uk is the email

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Leave a Reply

9 visitors online now
3 guests, 5 bots, 1 members
Max visitors today: 17 at 07:02 pm UTC
This month: 27 at 05-17-2013 01:24 pm UTC
This year: 39 at 01-01-2013 12:46 pm UTC
All time: 109 at 12-07-2012 11:00 pm UTC