STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229672 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2596 · P5191 |
This is the info page for Flash #65639 |
Hi newgrounds, this is my third tutorial. This time you'll learn how to make a cool scope-effect with AS2. Nagivate with arrowkeys. |
Okay, let's start. Make a new Flash-Document, import a picture (ctrl+r) and then convert it into a movieclip (F8). Name the movieclip scope. Same instance name. |
Doubleclick the symbol to step into it, select the pic again and convert it into a MC again. Name it pic. Give it the same instance name. Now make a new layer (still inside of the scope-MC). |
Duplicate the pic-MC and paste it to the second layer. This one must not have the same instance name so you better delete it. |
Scale the second pic (make it as big as you want but you should not make it smaller). Use pictures with higher resolution for better results. |
Give this code to the second picture Just select, copy and paste it. |
onClipEvent (load){ dif = _width-_root.scope.pic._width; verh = _root.scope.pic._width/dif; } onClipEvent (enterFrame){ this.setMask (_root.lens); _x = -_xmouse/verh; _y = -_ymouse/verh; } |
Now jump out of the scope (doubleclick anywhere but on the the pic or click 'Scene 1') make a second layer and draw a circle. This will be our lens. |
Convert the circle into a MC, name it lens and give it the same instance name. The code you added to the pic inside of the scope is to make the lens be a mask. |
Make sure to click this when you make the lens. |
Give the lens this code. |
onClipEvent (enterFrame){ _x = _root._xmouse; _y = _root._ymouse; } |
Test the movie, everything should work now. Keep watching for some improvements. If you decide to close this tutorial go ahead and do it but don't forget to recommend this for the tutorial collection please, thanks. And please review and rate my flash, bye! |
Okay, let's move on. On the next page you will see two examples you can use to pimp up the scope, you can even download them. |
Click an object to download it. The last one is my example for this tutorial. I used a pic which is a screenshot of a project made by a very good friend of mine. |
This is a simple glass. |
This is a sniper-style scope with changing coordinates. |
Thanks for watching! |
ActionScript [AS1/AS2]
Frame 1Stage.showMenu = false;Frame 21stop();Frame 45stop();Symbol 11 MovieClip Frame 1function timerHandler() { if (!loadingComplete) { var _local4 = _root.getBytesLoaded() / _root.getBytesTotal(); bar._xscale = 100 * _local4; if (_local4 == 1) { loadingComplete = true; if (AUTO_PLAY) { startMovie(); } else { gotoAndStop ("loaded"); } return(undefined); } } dt = getTimer() - time; time = time + dt; frameAccum = frameAccum + dt; var _local3 = 0; while ((frameAccum >= FRAME_TIME) && (_local3 < MAX_FRAME_SKIP)) { advanceFrame(tankLogo, true, true); advanceFrame(loadingText, false, true); advanceFrame(barGfx, false, true); if (loadingComplete) { advanceFrame(this, false, false); } (frameAccum = frameAccum - FRAME_TIME); _local3++; } updateAfterEvent(); } function advanceFrame(clip, recurse, loop) { if (!clip) { return(undefined); } clip.stop(); if (clip._currentframe == clip._totalframes) { if (loop) { clip.gotoAndStop(1); } } else { clip.nextFrame(); } if (recurse) { for (childName in clip) { if (typeof(clip[childName]) == "movieclip") { advanceFrame(clip[childName], recurse, loop); } } } } function startMovie() { clearInterval(intervalId); _root.play(); } _root.stop(); stop(); var FRAME_TIME = 33.3333333333333; var AUTO_PLAY = false; var MAX_FRAME_SKIP = 5; var loadingComplete; var intervalId; var time; var frameAccum; loadingComplete = false; intervalId = setInterval(this, "timerHandler", FRAME_TIME / 2); frameAccum = 0; time = getTimer(); timerHandler();Symbol 11 MovieClip Frame 37startMovie();Symbol 13 Buttonon (keyPress "<Down>") { stopAllSounds(); }Symbol 19 Buttonon (keyPress "<Right>") { play(); }Symbol 24 Buttonon (keyPress "<Right>") { nextFrame(); }Symbol 28 Buttonon (keyPress "<Right>") { nextFrame(); } on (keyPress "<Left>") { prevFrame(); }Symbol 61 Buttonon (release) { getURL ("http://www.mediafire.com/?ynjnwlnzgtm", "_blank"); }Symbol 62 Buttonon (release) { getURL ("http://www.mediafire.com/?dzavzztun4m", "_blank"); }Symbol 65 Buttonon (release) { getURL ("http://www.mediafire.com/?nywytj5jy5j", "_blank"); }Symbol 67 Buttonon (keyPress "<Left>") { prevFrame(); }
Library Items
Symbol 1 Graphic | Used by:Timeline | |
Symbol 2 Graphic | Used by:11 | |
Symbol 3 Graphic | Used by:11 | |
Symbol 4 Graphic | Used by:5 11 | |
Symbol 5 MovieClip | Uses:4 | Used by:11 |
Symbol 6 Graphic | Used by:7 | |
Symbol 7 Button | Uses:6 | Used by:11 |
Symbol 8 ShapeTweening | Used by:11 | |
Symbol 9 ShapeTweening | Used by:11 | |
Symbol 10 Graphic | Used by:11 | |
Symbol 11 MovieClip | Uses:2 3 5 7 4 8 9 10 | Used by:Timeline |
Symbol 12 Graphic | Used by:13 19 24 28 61 62 65 67 | |
Symbol 13 Button | Uses:12 | Used by:Timeline |
Symbol 14 Graphic | Used by:Timeline | |
Symbol 15 Sound | Used by:Timeline | |
Symbol 16 Graphic | Used by:Timeline | |
Symbol 17 Font | Used by:18 21 25 29 33 35 39 44 47 49 52 57 58 63 64 66 | |
Symbol 18 Text | Uses:17 | Used by:Timeline |
Symbol 19 Button | Uses:12 | Used by:Timeline |
Symbol 20 Font | Used by:21 | |
Symbol 21 Text | Uses:17 20 | Used by:Timeline |
Symbol 22 Bitmap | Used by:23 | |
Symbol 23 Graphic | Uses:22 | Used by:Timeline |
Symbol 24 Button | Uses:12 | Used by:Timeline |
Symbol 25 Text | Uses:17 | Used by:Timeline |
Symbol 26 Bitmap | Used by:27 | |
Symbol 27 Graphic | Uses:26 | Used by:Timeline |
Symbol 28 Button | Uses:12 | Used by:Timeline |
Symbol 29 Text | Uses:17 | Used by:Timeline |
Symbol 30 Bitmap | Used by:32 | |
Symbol 31 Bitmap | Used by:32 | |
Symbol 32 Graphic | Uses:30 31 | Used by:Timeline |
Symbol 33 Text | Uses:17 | Used by:Timeline |
Symbol 34 Graphic | Used by:Timeline | |
Symbol 35 Text | Uses:17 | Used by:Timeline |
Symbol 36 Font | Used by:37 50 | |
Symbol 37 EditableText | Uses:36 | Used by:Timeline |
Symbol 38 Graphic | Used by:Timeline | |
Symbol 39 Text | Uses:17 | Used by:Timeline |
Symbol 40 Bitmap | Used by:43 | |
Symbol 41 Bitmap | Used by:43 | |
Symbol 42 Bitmap | Used by:43 | |
Symbol 43 Graphic | Uses:40 41 42 | Used by:Timeline |
Symbol 44 Text | Uses:17 | Used by:Timeline |
Symbol 45 Bitmap | Used by:46 | |
Symbol 46 Graphic | Uses:45 | Used by:Timeline |
Symbol 47 Text | Uses:17 | Used by:Timeline |
Symbol 48 Graphic | Used by:Timeline | |
Symbol 49 Text | Uses:17 | Used by:Timeline |
Symbol 50 EditableText | Uses:36 | Used by:Timeline |
Symbol 51 Graphic | Used by:Timeline | |
Symbol 52 Text | Uses:17 | Used by:Timeline |
Symbol 53 Bitmap | Used by:56 | |
Symbol 54 Bitmap | Used by:56 | |
Symbol 55 Bitmap | Used by:56 | |
Symbol 56 Graphic | Uses:53 54 55 | Used by:Timeline |
Symbol 57 Text | Uses:17 | Used by:Timeline |
Symbol 58 Text | Uses:17 | Used by:Timeline |
Symbol 59 Bitmap | Used by:60 | |
Symbol 60 Graphic | Uses:59 | Used by:Timeline |
Symbol 61 Button | Uses:12 | Used by:Timeline |
Symbol 62 Button | Uses:12 | Used by:Timeline |
Symbol 63 Text | Uses:17 | Used by:Timeline |
Symbol 64 Text | Uses:17 | Used by:Timeline |
Symbol 65 Button | Uses:12 | Used by:Timeline |
Symbol 66 Text | Uses:17 | Used by:Timeline |
Symbol 67 Button | Uses:12 | Used by:Timeline |
Instance Names
"bar" | Symbol 11 MovieClip Frame 1 | Symbol 5 MovieClip |
Special Tags
FileAttributes (69) | Timeline Frame 1 | Access local files only, Metadata not present, AS1/AS2. |
Labels
"loaded" | Symbol 11 MovieClip Frame 2 |
|