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

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

Tutorial - 'Scope Effect'.swf

This is the info page for
Flash #65639

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


Text
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 1
Stage.showMenu = false;
Frame 21
stop();
Frame 45
stop();
Symbol 11 MovieClip Frame 1
function 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 37
startMovie();
Symbol 13 Button
on (keyPress "<Down>") { stopAllSounds(); }
Symbol 19 Button
on (keyPress "<Right>") { play(); }
Symbol 24 Button
on (keyPress "<Right>") { nextFrame(); }
Symbol 28 Button
on (keyPress "<Right>") { nextFrame(); } on (keyPress "<Left>") { prevFrame(); }
Symbol 61 Button
on (release) { getURL ("http://www.mediafire.com/?ynjnwlnzgtm", "_blank"); }
Symbol 62 Button
on (release) { getURL ("http://www.mediafire.com/?dzavzztun4m", "_blank"); }
Symbol 65 Button
on (release) { getURL ("http://www.mediafire.com/?nywytj5jy5j", "_blank"); }
Symbol 67 Button
on (keyPress "<Left>") { prevFrame(); }

Library Items

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

Instance Names

"bar"Symbol 11 MovieClip Frame 1Symbol 5 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS1/AS2.

Labels

"loaded"Symbol 11 MovieClip Frame 2




http://swfchan.com/14/65639/info.shtml
Created: 12/4 -2019 12:14:52 Last modified: 12/4 -2019 12:14:52 Server time: 13/05 -2024 09:02:33