STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229595 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2595 · P5190 |
This is the info page for Flash #35573 |
4000/4000 |
Next |
Hello, and welcome to my tutorial. |
Here you will learn how to: |
Back |
Make An Object Movable With The Arrow Keys Make an item draggable (Good for dress up game) Make a custom cursor And make a rotating 3D cube. |
So lets get started! |
(Click)-----> |
Lesson One: Object Movable With Keys |
Below we have an example of what we'll be making. It's really simple. Try it out! (move ball with arrow keys) |
Ok, lets get started. First, draw what you want to move with the arrow keys I'll use a circle |
Then make your object a movie clip, do this by pressing a F8. There should be 3 choices, "Movie Clip, Button And Graphic" |
F8 |
Select Movie Clip |
Then when you're done with that, select your movie clip. There should be a blue box around it. Like the one below, once there is the blue box around it you can move on. |
Ok, now comes the tricky part. The actions. The actions tell the movie clip what it's going to do. So if you're ready to get the actions. Click the "Next" button, and good luck lol. |
F9 |
Press F9 to open the actions panel |
Ok, you pressed it. Here's the actions. Just copy and paste them to the action panel (press F9 to open them) |
onClipEvent (enterFrame) { if (Key.isDown(Key.UP)) { speed += 5; } if (Key.isDown(Key.DOWN)) { speed -= 5; } if (Math.abs(speed)>20) { speed *= .7; } if (Key.isDown(Key.LEFT)) { _rotation -= 15; } if (Key.isDown(Key.RIGHT)) { _rotation += 15; } speed *= .60; x = Math.sin(_rotation*(Math.PI/180))*speed; y = Math.cos(_rotation*(Math.PI/180))*speed*-1; if (!_root.land.hitTest(_x+x, _y+y, true)) { _x += x; _y += y; } else { speed *= -.8; } } |
And now you can test it out! Press the next button for another tutorial. |
Lesson Two: Obect Draggable |
Ok, here you will learn how to make an object draggable when you click and hold it. Great for dress up games. Below is a simple dress up game that I made. Try it out! |
: ) |
Now, once again draw your character. Then press F8 and select movie clip And then make another layer above that one Select Insert>Timeline>Layer |
Then once you're done with all that junk go to the top layer (the one you just created) Say you're making a shirt draggable. If you where, you'd trace his upper torso, where the shirt would go. So trace the article of clothing that you want and press F8 and select "Movie Clip" |
Then select that article of clothing (there should be a blue box around it) and once again press F9 to open the actions panel Click then "Next" button for the actions. |
on(press){ startdrag(""); } on(release){ stopDrag(); } |
Woohoo! You did it!!! Good work! Next Lesson: Custom Cursor |
Lesson Three: Custom Cursor |
Ok, making a custom cursor is always fun. So lets get started. First draw what you want to be your custom cursor |
Now make it a movie clip. Once again press F8 and select Movie Clip |
Then select your custom cursor and hit F9 to open the actions panel. |
Press the next button for the actions |
onClipEvent (load) { startDrag ("", true); Mouse.hide();} |
Success.. You did it!!! Good work! Next is a really cool trick that will teach you how to make a 3D rotating cube with **ONLY** action script! No drawing necessary! |
e |
b |
u |
C |
D |
3 |
g |
n |
i |
t |
a |
o |
R |
: |
r |
F |
s |
L |
There's not much to explaine because it's all action script... so lets get started. First hit the F9 button to open the actions panel. Hit The "Next" button for the actions (prepare yourslf, it's a big one) |
. |
k |
c |
i |
r |
t |
p |
s |
n |
o |
a |
e |
v |
f |
y |
m |
b |
h |
, |
g |
l |
A |
this.createEmptyMovieClip("center", 0); center._x = Stage.width/2; center._y = Stage.height/2; focalLength = 400; cube = {}; cube.vertexList = []; cube.vertexList.push({x:-50, y:-50, z:50}); cube.vertexList.push({x:50, y:-50, z:50}); cube.vertexList.push({x:50, y:-50, z:-50}); cube.vertexList.push({x:-50, y:-50, z:-50}); cube.vertexList.push({x:-50, y:50, z:50}); cube.vertexList.push({x:50, y:50, z:50}); cube.vertexList.push({x:50, y:50, z:-50}); cube.vertexList.push({x:-50, y:50, z:-50}); cube.side = []; cube.side.push([0,1,2,3]); cube.side.push([2,1,5,6]); cube.side.push([1,0,4,5]); cube.side.push([5,4,7,6]); cube.side.push([0,3,7,4]); cube.side.push([3,2,6,7]); render = function(model) { if (transformMatrix) { for (var i = 0; i < model.vertexList.length; i++) { var vert = model.vertexList[i]; var x = transformMatrix.a*vert.x + transformMatrix.b*vert.y + transformMatrix.c*vert.z; var y = transformMatrix.d*vert.x + transformMatrix.e*vert.y + transformMatrix.f*vert.z; var z = transformMatrix.g*vert.x + transformMatrix.h*vert.y + transformMatrix.i*vert.z;; vert.x = x; vert.y = y; vert.z = z; } delete transformMatrix; } center.clear(); center.lineStyle(2, 0, 100); verts2D = []; depthArray = []; for (var i = 0; i < model.side.length; i++) { var zDepth = 0; for (var j = 0; j < model.side[i].length; j++) { var whichVert = model.side[i][j]; if (verts2D[whichVert] == undefined) { verts2D[whichVert] = {}; var scale = focalLength/(focalLength - model.vertexList[whichVert].z); verts2D[whichVert].x = model.vertexList[whichVert].x * scale; verts2D[whichVert].y = model.vertexList[whichVert].y * scale; } zDepth += model.vertexList[whichVert].z; } depthArray.push([model.side[i], zDepth]); } depthArray.sort(function(a,b) { return a[1] > b[1] }); for (var i = 0; i < depthArray.length; i++) { var sideVerts = depthArray[i][0]; center.moveTo(verts2D[sideVerts[0]].x, verts2D[sideVerts[0]].y); center.beginFill(0x666666, 100); for (var j = 1; j < sideVerts.length; j++) { center.lineTo(verts2D[sideVerts[j]].x, verts2D[sideVerts[j]].y); } center.lineTo(verts2D[sideVerts[0]].x, verts2D[sideVerts[0]].y); center.endFill(); } } rotateX = function(model, degree) { var rad = degree*Math.PI/180; var sin = Math.sin(rad); var cos = Math.cos(rad); var matrix = {a:1, b:0, c:0, d:0, e:cos, f:sin, g:0, h:-sin, i:cos}; transform(matrix, model); } rotateY = function(model, degree) { var rad = degree*Math.PI/180; var sin = Math.sin(rad); var cos = Math.cos(rad); var matrix = {a:cos, b:0, c:-sin, d:0, e:1, f:0, g:sin, h:0, i:cos}; transform(matrix, model); } rotateZ = function(model, degree) { var rad = degree*Math.PI/180; var sin = Math.sin(rad); var cos = Math.cos(rad); var matrix = {a:cos, b:sin, c:0, d:-sin, e:cos, f:0, g:0, h:0, i:1}; transform(matrix, model); } scale = function(model, percent) { var rad = degree*Math.PI/180; var matrix = {a:percent, b:0, c:0, d:0, e:percent, f:0, g:0, h:0, i:percent}; transform(matrix, model); } transform = function(matrix, model) { if (transformMatrix) { var a = matrix.a*transformMatrix.a + matrix.b*transformMatrix.d + matrix.c*transformMatrix.g; var b = matrix.a*transformMatrix.b + matrix.b*transformMatrix.e + matrix.c*transformMatrix.h; var c = matrix.a*transformMatrix.c + matrix.b*transformMatrix.f + matrix.c*transformMatrix.i; var d = matrix.d*transformMatrix.a + matrix.e*transformMatrix.d + matrix.f*transformMatrix.g; var e = matrix.d*transformMatrix.b + matrix.e*transformMatrix.e + matrix.f*transformMatrix.h; var f = matrix.d*transformMatrix.c + matrix.e*transformMatrix.f + matrix.f*transformMatrix.i; var g = matrix.g*transformMatrix.a + matrix.h*transformMatrix.d + matrix.i*transformMatrix.g; var h = matrix.g*transformMatrix.b + matrix.h*transformMatrix.e + matrix.i*transformMatrix.h; var i = matrix.g*transformMatrix.c + matrix.h*transformMatrix.f + matrix.i*transformMatrix.i; transformMatrix = {a:a, b:b, c:c, d:d, e:e, f:f, g:g, h:h, i:i}; } else { transformMatrix = matrix } } center.onEnterFrame = function() { rotateX(cube, 3); rotateY(cube, 6); rotateZ(cube, 10); render(cube); }; |
Just copy that and paste it to your action panel. |
That's the end of my tutorial! Hope you learned a thing or two. If you had any problems you can contact me at VanceButler27@Yahoo.com I'd be happy to help! |
Replay? |
ActionScript [AS1/AS2]
Frame 2setProperty("/light", _visible , true); startDrag ("/light", true);Frame 102stop();Instance of Symbol 41 MovieClip in Frame 104onClipEvent (enterFrame) { if (Key.isDown(38)) { speed = speed + 5; } if (Key.isDown(40)) { speed = speed - 5; } if (Math.abs(speed) > 20) { speed = speed * 0.7; } if (Key.isDown(37)) { _rotation = (_rotation - 15); } if (Key.isDown(39)) { _rotation = (_rotation + 15); } speed = speed * 0.6; x = Math.sin(_rotation * (Math.PI/180)) * speed; y = (Math.cos(_rotation * (Math.PI/180)) * speed) * -1; if (!_root.land.hitTest(_x + x, _y + y, true)) { _x = (_x + x); _y = (_y + y); } else { speed = speed * -0.8; } }Instance of Symbol 64 MovieClip in Frame 111on (press) { startDrag (""); } on (release) { stopDrag(); }Symbol 18 Buttonon (release) { getURL ("http://www.newgrounds.com", "blank"); }Symbol 22 Buttonon (release) { _root.play(); }Symbol 23 MovieClip Frame 1_root.stop(); PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100; KB_out = (int(_root.getBytesLoaded() / 1000) + "/") + int(_root.getBytesTotal() / 1000); if (PercentLoaded != 100) { setProperty(barmask.bar, _xscale , PercentLoaded); } else { gotoAndStop ("loaded"); }Symbol 23 MovieClip Frame 2gotoAndPlay (1);Symbol 28 Buttonon (release) { nextFrame(); }Symbol 34 Buttonon (release) { prevFrame(); }Symbol 122 Buttonon (release) { prevFrame(); }Symbol 130 Buttonon (release) { nextFrame(); }
Library Items
Symbol 1 Graphic | Used by:2 | ||
Symbol 2 MovieClip | Uses:1 | Used by:Timeline | |
Symbol 3 Graphic | Used by:Timeline | ||
Symbol 4 Bitmap | Used by:5 | ||
Symbol 5 Graphic | Uses:4 | Used by:23 | |
Symbol 6 Font | Used by:7 | ||
Symbol 7 EditableText | Uses:6 | Used by:23 | |
Symbol 8 Bitmap | Used by:9 21 | ||
Symbol 9 Graphic | Uses:8 | Used by:23 | |
Symbol 10 Graphic | Used by:14 | ||
Symbol 11 Graphic | Used by:12 | ||
Symbol 12 MovieClip | Uses:11 | Used by:14 | |
Symbol 13 Graphic | Used by:14 | ||
Symbol 14 MovieClip | Uses:10 12 13 | Used by:23 | |
Symbol 15 Bitmap | Used by:16 | ||
Symbol 16 Graphic | Uses:15 | Used by:23 | |
Symbol 17 Graphic | Used by:18 22 | ||
Symbol 18 Button | Uses:17 | Used by:19 | |
Symbol 19 MovieClip | Uses:18 | Used by:23 | |
Symbol 20 Bitmap | Used by:21 | ||
Symbol 21 Graphic | Uses:8 20 | Used by:23 | |
Symbol 22 Button | Uses:17 | Used by:23 | |
Symbol 23 MovieClip | Uses:5 7 9 14 16 19 21 22 | Used by:Timeline | |
Symbol 24 Sound | Used by:Timeline | ||
Symbol 25 Graphic | Used by:28 | ||
Symbol 26 Font | Used by:27 30 31 33 35 36 37 38 39 42 43 49 51 52 55 57 58 59 61 62 65 67 68 69 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 124 125 126 127 129 | ||
Symbol 27 Text | Uses:26 | Used by:28 | |
Symbol 28 Button | Uses:25 27 | Used by:Timeline | |
Symbol 29 Font | |||
Symbol 30 Text | Uses:26 | Used by:Timeline | |
Symbol 31 Text | Uses:26 | Used by:Timeline | |
Symbol 32 Graphic | Used by:34 122 | ||
Symbol 33 Text | Uses:26 | Used by:34 122 | |
Symbol 34 Button | Uses:32 33 | Used by:Timeline | |
Symbol 35 Text | Uses:26 | Used by:Timeline | |
Symbol 36 Text | Uses:26 | Used by:Timeline | |
Symbol 37 Text | Uses:26 | Used by:Timeline | |
Symbol 38 Text | Uses:26 | Used by:Timeline | |
Symbol 39 Text | Uses:26 | Used by:Timeline | |
Symbol 40 Graphic | Used by:41 Timeline | ||
Symbol 41 MovieClip | Uses:40 | Used by:Timeline | |
Symbol 42 Text | Uses:26 | Used by:Timeline | |
Symbol 43 Text | Uses:26 | Used by:Timeline | |
Symbol 44 Graphic | Used by:48 54 | ||
Symbol 45 Font | Used by:46 53 | ||
Symbol 46 Text | Uses:45 | Used by:48 | |
Symbol 47 Graphic | Used by:48 54 | ||
Symbol 48 MovieClip | Uses:44 46 47 | Used by:Timeline | |
Symbol 49 Text | Uses:26 | Used by:Timeline | |
Symbol 50 Graphic | Used by:Timeline | ||
Symbol 51 Text | Uses:26 | Used by:Timeline | |
Symbol 52 Text | Uses:26 | Used by:Timeline | |
Symbol 53 Text | Uses:45 | Used by:54 | |
Symbol 54 MovieClip | Uses:44 53 47 | Used by:Timeline | |
Symbol 55 Text | Uses:26 | Used by:Timeline | |
Symbol 56 Graphic | Used by:Timeline | ||
Symbol 57 Text | Uses:26 | Used by:Timeline | |
Symbol 58 EditableText | Uses:26 | Used by:Timeline | |
Symbol 59 Text | Uses:26 | Used by:Timeline | |
Symbol 60 Graphic | Used by:Timeline | ||
Symbol 61 Text | Uses:26 | Used by:Timeline | |
Symbol 62 Text | Uses:26 | Used by:Timeline | |
Symbol 63 Graphic | Used by:64 | ||
Symbol 64 MovieClip | Uses:63 | Used by:Timeline | |
Symbol 65 Text | Uses:26 | Used by:Timeline | |
Symbol 66 Graphic | Used by:Timeline | ||
Symbol 67 Text | Uses:26 | Used by:Timeline | |
Symbol 68 Text | Uses:26 | Used by:Timeline | |
Symbol 69 Text | Uses:26 | Used by:Timeline | |
Symbol 70 Graphic | Used by:Timeline | ||
Symbol 71 EditableText | Uses:26 | Used by:Timeline | |
Symbol 72 Text | Uses:26 | Used by:Timeline | |
Symbol 73 Text | Uses:26 | Used by:Timeline | |
Symbol 74 Text | Uses:26 | Used by:Timeline | |
Symbol 75 Text | Uses:26 | Used by:Timeline | |
Symbol 76 Text | Uses:26 | Used by:Timeline | |
Symbol 77 Text | Uses:26 | Used by:Timeline | |
Symbol 78 Graphic | Used by:Timeline | ||
Symbol 79 EditableText | Uses:26 | Used by:Timeline | |
Symbol 80 Text | Uses:26 | Used by:Timeline | |
Symbol 81 Text | Uses:26 | Used by:Timeline | |
Symbol 82 Text | Uses:26 | Used by:Timeline | |
Symbol 83 Text | Uses:26 | Used by:Timeline | |
Symbol 84 Text | Uses:26 | Used by:Timeline | |
Symbol 85 Text | Uses:26 | Used by:Timeline | |
Symbol 86 Text | Uses:26 | Used by:Timeline | |
Symbol 87 Text | Uses:26 | Used by:Timeline | |
Symbol 88 Text | Uses:26 | Used by:Timeline | |
Symbol 89 Text | Uses:26 | Used by:Timeline | |
Symbol 90 Text | Uses:26 | Used by:Timeline | |
Symbol 91 Text | Uses:26 | Used by:Timeline | |
Symbol 92 Text | Uses:26 | Used by:Timeline | |
Symbol 93 Text | Uses:26 | Used by:Timeline | |
Symbol 94 Text | Uses:26 | Used by:Timeline | |
Symbol 95 Text | Uses:26 | Used by:Timeline | |
Symbol 96 Text | Uses:26 | Used by:Timeline | |
Symbol 97 Text | Uses:26 | Used by:Timeline | |
Symbol 98 Text | Uses:26 | Used by:Timeline | |
Symbol 99 Text | Uses:26 | Used by:Timeline | |
Symbol 100 Text | Uses:26 | Used by:Timeline | |
Symbol 101 Text | Uses:26 | Used by:Timeline | |
Symbol 102 Text | Uses:26 | Used by:Timeline | |
Symbol 103 Text | Uses:26 | Used by:Timeline | |
Symbol 104 Text | Uses:26 | Used by:Timeline | |
Symbol 105 Text | Uses:26 | Used by:Timeline | |
Symbol 106 Text | Uses:26 | Used by:Timeline | |
Symbol 107 Text | Uses:26 | Used by:Timeline | |
Symbol 108 Text | Uses:26 | Used by:Timeline | |
Symbol 109 Text | Uses:26 | Used by:Timeline | |
Symbol 110 Text | Uses:26 | Used by:Timeline | |
Symbol 111 Text | Uses:26 | Used by:Timeline | |
Symbol 112 Text | Uses:26 | Used by:Timeline | |
Symbol 113 Text | Uses:26 | Used by:Timeline | |
Symbol 114 Text | Uses:26 | Used by:Timeline | |
Symbol 115 Text | Uses:26 | Used by:Timeline | |
Symbol 116 Text | Uses:26 | Used by:Timeline | |
Symbol 117 Text | Uses:26 | Used by:Timeline | |
Symbol 118 Text | Uses:26 | Used by:Timeline | |
Symbol 119 Text | Uses:26 | Used by:Timeline | |
Symbol 120 Text | Uses:26 | Used by:Timeline | |
Symbol 121 Text | Uses:26 | Used by:Timeline | |
Symbol 122 Button | Uses:32 33 | Used by:Timeline | |
Symbol 123 Graphic | Used by:Timeline | ||
Symbol 124 EditableText | Uses:26 | Used by:Timeline | |
Symbol 125 EditableText | Uses:26 | Used by:Timeline | |
Symbol 126 Text | Uses:26 | Used by:Timeline | |
Symbol 127 Text | Uses:26 | Used by:Timeline | |
Symbol 128 Graphic | Used by:130 | ||
Symbol 129 Text | Uses:26 | Used by:130 | |
Symbol 130 Button | Uses:128 129 | Used by:Timeline |
Instance Names
"light" | Frame 1 | Symbol 2 MovieClip |
"bar" | Symbol 14 MovieClip Frame 1 | Symbol 12 MovieClip |
"barmask" | Symbol 23 MovieClip Frame 1 | Symbol 14 MovieClip |
Labels
"loaded" | Symbol 23 MovieClip Frame 3 |
Dynamic Text Variables
KB_out | Symbol 7 EditableText | "4000/4000" |
|