STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228114
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/23445575?noj=FRM23445575-10DC" width="1" height="1"></div>

Custom Mouse Tutorial.swf

This is the info page for
Flash #56498

(Click the ID number above for more basic data on this flash file.)


Text
Custom Mouse tutorial

Learn to make a mouse similar to this

Start

Start

Credits

Credits

Sound Credits
Sound design magical accent swell harp twinkle sparkle science fiction 01
Created By: SFX Bible
Dark Atmosphere
Created By: celso cano
www. soundsnap.com

Next

Welcome to the Custom Mouse Tutorial! This tutorial will teach you how to
create your very own unique mouse by showing you how you can use code
to create unique effects.

Assuming you have used the flash tools before, click on the square drawing
tool and draw to squares of an equal size on the stage.
Then, fully highlight one of the squares and go to:
Modify/Transform/FreeTransform
and put the square on a 45 degree angle.
Then put that square directly over the other. It should look somthing like this.

If it looks like this, turn it into a movieclip called mainImg and go to the next
part.

Now, you will need to go into your property tab and give your new movieclip. a
instance name, which will be the same as its movieClip name, mainImg

OK, now its time to imput our first bit of code. Put this in the mainImg
movieClip.
onClipEvent (load) //When the movieClip loads
{
Mouse.hide();//Hides the mouse
startDrag("", true);//Starts dragging the object at mouse position
}

The code you previously entered should now hide your current mouse and put
the mainImg movieclip in the place of it. Check that it is running properly now
too before you continue.

If it is perfectly fine, copy the  mainImg movie clip 7 times, giving them the
instance names of follower1 to follower and reduce their width and height so
they are smaller than one another. For an example
mainImg width and height is 30 and 30
follower1 width and height 25 and 25
follower2 width and height 20 and 20
and so on.
If you run into the problem of the width and height are going to be smaller than
0, either dont add them or increase the size of mainImg appropriately.
go to the next page to see an example of what im writting.

The copied images

Follower 1 and Follower 2

These are simply examples
of my current custom
mouse. Depending on size,
yours may vary a little

If you play this, your mouse still works, but not the other movieClips. This is
because we need to implement more code. to each of the follower instances..
IMPORTANT!!: Make sure you erase any other code in the follower instances
onClipEvent(enterFrame)
{
this._x =_root.mainImg.previousX;/*Sets this object xposition to
mainImg previous x position*/
this._y = _root.mainImg.previousY;/*Sets this object yposition to
mainImg previous y position*/
previousX = currentX;//holds the previous x position
previousY = currentY;//holds the previous y postion
currentX = this._x;//holds the current x position
currentY = this._y;//holds the current y position
}

Once you have inputed that into eacht of the follower instances, your going
to have to go  back to follower2 to the last follower and change the following
lines:
this._x =_root.mainImg.previousX;/*Sets this object xposition to
mainImg previous x position*/
this._y = _root.mainImg.previousY;/*Sets this object yposition to
mainImg previous x position*/
to:
this._x =_root.follower1.previousX;
this._y = _root.follower1.previousY;
BEFORE you go enter this code in each follower,  there is a special way you need
to do it. If your in follower2, you will need to change the mainImg part to
follower1, if  your in follower3, change the mainImg part to follower2 and so on.

We are almost there in making the object follow one another. But now, we need to
add more code into the mainImg movieClip...
onClipEvent(enterFrame)
{
previousX = currentX;//saves the previous xposition
previousY = currentY;//saves the previous yposition
currentX = this._x;//saves the current xposition
currentY = this._y;//saves the current yposition
}
If done correctly,  when you run your program, the movieClips will now follow
another and if it does, Congratulations for getting this far!

We now have gone well overhalf way! congratulations for getting this far! But we
still arent finished. We still need to give our object constantly changing colors,
make it rotate and make small spart to fall from the mainImg. Lets concentrate
on getting the movieClips to rotate. In this example, each movieClip is rotating an
opposite way, so we need to add:
this._rotation +=1;
To MainImg MovieClip and this to every odd follower movieclip e.g follower1,3,5:
this._rotation -=1;
And this to every even follower movieClip e.g follower ,4,5
this._rotation +=1;
To the enterFrame clipEvent.
If done correctly, your star-like objects will now rotate in the properly

Great! now, to make the movieClips change color you need to add to the clipEvent
enterframe of each of the follower instance and the  mainImg instance.
red = random(255);
green = random(255);
blue = random(255);
changecolor = new Color(this);
changecolor.setTransform({ra:100, rb:red,ga:100,gb:green,ba:100,bb:blue,aa:100,ab:0});
Now, for the last part of this tutorial. creating the sparks of the cursor we have
created. Create a small yellow or gold circle approximately 2Width and 2Height
wide and convert it into a movieClip called sparkle aswell as a instance name
called sparkle0 as in sparkle and the number zero.

Then add the following code to it
onClipEvent(load)
{
randomXPos = random(_root.mainImg._width/2)-10;
this._x =_root.mainImg._x + randomXPos;
this._y =_root.mainImg._y + (_root.mainImg._height/2)-7;
fallSpeed = 0;
this._alpha = random(100);
gravity = .1;
}

onClipEvent(enterFrame)
{
fallSpeed += gravity
this._y +=fallSpeed;
this._alpha -=1;
if(this._alpha < 2)
{
this.removeMovieClip();
}
}

And this:

This Code is what will control the spark and tell it what to do, but nothing is
initialising it. To initialize it, we need to add the following code on the next page
to the mainImg movieClip

Add this to mainImg's ClipEvent load
sparkleCounter = 1;
and this to mainImg's ClipEvent enterFrame
prevValue = sparkleCounter - 1;
_root["sparkle"+prevValue].duplicateMovieClip("sparkle"+sparkleCounter,
_root.getNextHighestDepth());
sparkleCounter++;
if(sparkleCounter > 5)
{
sparkleCounter = 0;
}
And thats everything! if everything works now, congratulations for getting
through this rather long and possibly tricky tutorial. so I just want to say..

CONGRATULATIONS!

ActionScript [AS1/AS2]

Frame 1
stop(); if (isNaN(firstload)) { creditOpen = 1; firstload = 9; i = 0; while (i < 500) { prevValue = i - 1; _root["star" + prevValue].duplicateMovieClip("star" + i, this.getNextHighestDepth()); i++; } _root.page = 1; var buttonsnd = new Sound(); var snd = new Sound(); buttonsnd.attachSound("twinkle"); snd.attachSound("Dark_atmosphere"); _root.snd.start(0, 999); }
Instance of Symbol 4 MovieClip [mainImg] "mainImg" in Frame 1
onClipEvent (load) { sparkleCounter = 1; Mouse.hide(); startDrag ("", true); } onClipEvent (enterFrame) { this._rotation = this._rotation + 1; previousX = currentX; previousY = currentY; currentX = this._x; currentY = this._y; red = random(255); green = random(255); blue = random(255); changecolor = new Color(this); changecolor.setTransform({ra:100, rb:red, ga:100, gb:green, ba:100, bb:blue, aa:100, ab:0}); prevValue = sparkleCounter - 1; _root["sparkle" + prevValue].duplicateMovieClip("sparkle" + sparkleCounter, _root.getNextHighestDepth()); sparkleCounter++; if (sparkleCounter > 5) { sparkleCounter = 0; } }
Instance of Symbol 4 MovieClip [mainImg] "follower1" in Frame 1
onClipEvent (enterFrame) { this._rotation = this._rotation - 1; this._x = _root.mainImg.previousX; this._y = _root.mainImg.previousY; previousX = currentX; previousY = currentY; currentX = this._x; currentY = this._y; red = random(255); green = random(255); blue = random(255); changecolor = new Color(this); changecolor.setTransform({ra:100, rb:red, ga:100, gb:green, ba:100, bb:blue, aa:100, ab:0}); }
Instance of Symbol 4 MovieClip [mainImg] "follower2" in Frame 1
onClipEvent (enterFrame) { this._rotation = this._rotation + 1; this._x = _root.follower1.previousX; this._y = _root.follower1.previousY; previousX = currentX; previousY = currentY; currentX = this._x; currentY = this._y; red = random(255); green = random(255); blue = random(255); changecolor = new Color(this); changecolor.setTransform({ra:100, rb:red, ga:100, gb:green, ba:100, bb:blue, aa:100, ab:0}); }
Instance of Symbol 4 MovieClip [mainImg] "follower3" in Frame 1
onClipEvent (enterFrame) { this._rotation = this._rotation - 1; this._x = _root.follower2.previousX; this._y = _root.follower2.previousY; previousX = currentX; previousY = currentY; currentX = this._x; currentY = this._y; red = random(255); green = random(255); blue = random(255); changecolor = new Color(this); changecolor.setTransform({ra:100, rb:red, ga:100, gb:green, ba:100, bb:blue, aa:100, ab:0}); }
Instance of Symbol 4 MovieClip [mainImg] "follower4" in Frame 1
onClipEvent (enterFrame) { this._rotation = this._rotation + 1; this._x = _root.follower3.previousX; this._y = _root.follower3.previousY; previousX = currentX; previousY = currentY; currentX = this._x; currentY = this._y; red = random(255); green = random(255); blue = random(255); changecolor = new Color(this); changecolor.setTransform({ra:100, rb:red, ga:100, gb:green, ba:100, bb:blue, aa:100, ab:0}); }
Instance of Symbol 4 MovieClip [mainImg] "follower5" in Frame 1
onClipEvent (enterFrame) { this._rotation = this._rotation - 1; this._x = _root.follower4.previousX; this._y = _root.follower4.previousY; previousX = currentX; previousY = currentY; currentX = this._x; currentY = this._y; red = random(255); green = random(255); blue = random(255); changecolor = new Color(this); changecolor.setTransform({ra:100, rb:red, ga:100, gb:green, ba:100, bb:blue, aa:100, ab:0}); }
Instance of Symbol 6 MovieClip "star0" in Frame 1
onClipEvent (load) { this._x = random(550); this._y = random(400); alphaModifier = -1; maxAlpha = random(100); this._alpha = maxAlpha; } onClipEvent (enterFrame) { this._alpha = this._alpha + alphaModifier; if (this._alpha < 10) { alphaModifier = 1; } if (this._alpha > maxAlpha) { alphaModifier = -1; } }
Instance of Symbol 8 MovieClip "sparkle0" in Frame 1
onClipEvent (load) { randomXPos = random(_root.mainImg._width / 2) - 10; this._x = _root.mainImg._x + randomXPos; this._y = (_root.mainImg._y + (_root.mainImg._height / 2)) - 7; fallSpeed = 0; this._alpha = random(100); gravity = 0.1; } onClipEvent (enterFrame) { fallSpeed = fallSpeed + gravity; this._y = this._y + fallSpeed; this._alpha = this._alpha - 1; if (this._alpha < 2) { this.removeMovieClip(); } }
Instance of Symbol 4 MovieClip [mainImg] "follower6" in Frame 1
onClipEvent (enterFrame) { this._rotation = this._rotation + 1; this._x = _root.follower5.previousX; this._y = _root.follower5.previousY; previousX = currentX; previousY = currentY; currentX = this._x; currentY = this._y; red = random(255); green = random(255); blue = random(255); changecolor = new Color(this); changecolor.setTransform({ra:100, rb:red, ga:100, gb:green, ba:100, bb:blue, aa:100, ab:0}); }
Instance of Symbol 4 MovieClip [mainImg] "follower7" in Frame 1
onClipEvent (enterFrame) { this._rotation = this._rotation - 1; this._x = _root.follower6.previousX; this._y = _root.follower6.previousY; previousX = currentX; previousY = currentY; currentX = this._x; currentY = this._y; red = random(255); green = random(255); blue = random(255); changecolor = new Color(this); changecolor.setTransform({ra:100, rb:red, ga:100, gb:green, ba:100, bb:blue, aa:100, ab:0}); }
Instance of Symbol 23 MovieClip "creditsList" in Frame 1
onClipEvent (enterFrame) { if (_root.creditOpen < 1) { this._x = this._x + 10; if (this._x > (Stage.width / 2)) { this._x = Stage.width / 2; } } }
Frame 2
stop();
Frame 3
stop();
Frame 4
stop();
Frame 5
stop();
Frame 6
stop();
Frame 7
stop();
Frame 8
stop();
Frame 9
stop();
Frame 10
stop();
Frame 11
stop();
Frame 12
stop();
Frame 13
stop();
Frame 14
stop();
Symbol 17 Button
on (release) { _root.buttonsnd.start(0, 1); play(); _root.creditOpen = 3; _root.page++; }
Symbol 21 Button
on (press) { _root.creditOpen = 0; }
Symbol 26 Button
on (release) { _root.page++; _root.buttonsnd.start(0, 1); play(); }

Library Items

Symbol 1 Sound [twinkle]
Symbol 2 Sound [Dark_atmosphere]
Symbol 3 GraphicUsed by:4
Symbol 4 MovieClip [mainImg]Uses:3Used by:Timeline
Symbol 5 GraphicUsed by:6
Symbol 6 MovieClipUses:5Used by:Timeline
Symbol 7 GraphicUsed by:8
Symbol 8 MovieClipUses:7Used by:Timeline
Symbol 9 FontUsed by:10 12 13 15 18 20 22 24 27 28 31 32 37 38 39 43 50 51 52 53 54 55 56 57 59 60 61 62
Symbol 10 TextUses:9Used by:11
Symbol 11 MovieClipUses:10Used by:Timeline
Symbol 12 TextUses:9Used by:Timeline
Symbol 13 TextUses:9Used by:14 17
Symbol 14 MovieClipUses:13Used by:17
Symbol 15 TextUses:9Used by:16 17
Symbol 16 MovieClipUses:15Used by:17
Symbol 17 ButtonUses:13 14 16 15Used by:Timeline
Symbol 18 TextUses:9Used by:19 21
Symbol 19 MovieClipUses:18Used by:21
Symbol 20 TextUses:9Used by:21
Symbol 21 ButtonUses:18 19 20Used by:Timeline
Symbol 22 TextUses:9Used by:23
Symbol 23 MovieClipUses:22Used by:Timeline
Symbol 24 TextUses:9Used by:25 26
Symbol 25 MovieClipUses:24Used by:26
Symbol 26 ButtonUses:24 25Used by:Timeline
Symbol 27 TextUses:9Used by:Timeline
Symbol 28 TextUses:9Used by:Timeline
Symbol 29 GraphicUsed by:30
Symbol 30 MovieClipUses:29Used by:Timeline
Symbol 31 TextUses:9Used by:Timeline
Symbol 32 TextUses:9Used by:Timeline
Symbol 33 BitmapUsed by:34
Symbol 34 GraphicUses:33Used by:35
Symbol 35 MovieClipUses:34Used by:Timeline
Symbol 36 FontUsed by:37 52 53 54 55 56 57 58 61
Symbol 37 TextUses:9 36Used by:Timeline
Symbol 38 TextUses:9Used by:Timeline
Symbol 39 TextUses:9Used by:Timeline
Symbol 40 BitmapUsed by:41
Symbol 41 GraphicUses:40Used by:42
Symbol 42 MovieClipUses:41Used by:Timeline
Symbol 43 TextUses:9Used by:Timeline
Symbol 44 BitmapUsed by:45
Symbol 45 GraphicUses:44Used by:46
Symbol 46 MovieClipUses:45Used by:Timeline
Symbol 47 BitmapUsed by:48
Symbol 48 GraphicUses:47Used by:49
Symbol 49 MovieClipUses:48Used by:Timeline
Symbol 50 TextUses:9Used by:Timeline
Symbol 51 TextUses:9Used by:Timeline
Symbol 52 TextUses:9 36Used by:Timeline
Symbol 53 TextUses:9 36Used by:Timeline
Symbol 54 TextUses:9 36Used by:Timeline
Symbol 55 TextUses:9 36Used by:Timeline
Symbol 56 TextUses:9 36Used by:Timeline
Symbol 57 TextUses:9 36Used by:Timeline
Symbol 58 TextUses:36Used by:Timeline
Symbol 59 TextUses:9Used by:Timeline
Symbol 60 TextUses:9Used by:Timeline
Symbol 61 TextUses:9 36Used by:Timeline
Symbol 62 TextUses:9Used by:Timeline

Instance Names

"mainImg"Frame 1Symbol 4 MovieClip [mainImg]
"follower1"Frame 1Symbol 4 MovieClip [mainImg]
"follower2"Frame 1Symbol 4 MovieClip [mainImg]
"follower3"Frame 1Symbol 4 MovieClip [mainImg]
"follower4"Frame 1Symbol 4 MovieClip [mainImg]
"follower5"Frame 1Symbol 4 MovieClip [mainImg]
"star0"Frame 1Symbol 6 MovieClip
"sparkle0"Frame 1Symbol 8 MovieClip
"follower6"Frame 1Symbol 4 MovieClip [mainImg]
"follower7"Frame 1Symbol 4 MovieClip [mainImg]
"creditsList"Frame 1Symbol 23 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS1/AS2.
ExportAssets (56)Timeline Frame 1Symbol 1 as "twinkle"
ExportAssets (56)Timeline Frame 1Symbol 2 as "Dark_atmosphere"
ExportAssets (56)Timeline Frame 1Symbol 4 as "mainImg"




http://swfchan.com/12/56498/info.shtml
Created: 19/4 -2019 07:27:50 Last modified: 19/4 -2019 07:27:50 Server time: 10/05 -2024 00:51:33