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

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

Doors.swf

This is the info page for
Flash #6850

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


ActionScript [AS1/AS2]
Symbol 123 MovieClip Frame 1
_global.doors_movie = this; Main.getInstance().init(); this.onEnterFrame = function () { Main.getInstance().step(); };
Symbol 124 MovieClip [__Packages.Main] Frame 0
class Main { var doors, shadows, plint, knob, door_frames, soundman, ref_pos, interval_init, door_in_center; function Main () { doors = _global.doors_movie.mc_doors; shadows = _global.doors_movie.mc_shadows; plint = _global.doors_movie.mc_plint; knob = _global.doors_movie.mc_extra_knob; door_frames = Parameters.door_frames; soundman = new SoundManager(); ref_pos = []; var _local4 = _global.doors_movie.mc_ref; var _local3 = 1; while (_local3 <= _local4._totalframes) { _local4.gotoAndStop(_local3); ref_pos[_local3] = _local4.mc_circle._x; _local3++; } _local4._visible = false; if (Parameters.delay_dingdong > 0) { interval_init = setInterval(this, "onInit", Parameters.delay_dingdong); } else { onInit(); } } static function getInstance() { if (instance == null) { instance = new Main(); } return(instance); } function init() { var _local4 = [doors, shadows]; var _local3 = 0; while (_local3 < _local4.length) { var _local2 = _local4[_local3]; for (var _local5 in _local2) { if (typeof(_local2[_local5]) == "movieclip") { _local2[_local5].removeMovieClip(); } else { delete _local2[_local5]; } } _local3++; } door_objs = []; appendDoor(); setPlint(); } function step() { max_frame = 0; min_frame = 100; var _local2 = 0; while (_local2 < door_objs.length) { var _local3 = door_objs[_local2]; _local3.step(); setDepthOfDoor(_local2); max_frame = Math.max(max_frame, _local3.__get__frame()); min_frame = Math.min(min_frame, _local3.__get__frame()); _local2++; } if (min_frame > 1) { appendDoor(); } if ((max_frame < door_frames) and (counter > door_objs.length)) { insertDoor(); } setPlint(); if ((door_in_center != undefined) and ((door_in_center.__get__frame() == 49) or (door_in_center.__get__frame() == 50))) { knob.gotoAndStop(door_in_center.__get__frame() - 48); knob._visible = true; } else { door_in_center = null; knob._visible = false; } } function setDepthOfDoor(n) { var _local2 = door_objs[n].frame; var _local4 = ((_local2 > 50) ? (((4 * door_frames) * door_frames) - ((door_frames * _local2) + (door_frames - n))) : ((door_frames * _local2) + (door_frames - n))); door_objs[n].setDepth(_local4); } function appendDoor() { var _local3 = createDoor(counter); door_objs.push(_local3); _local3.id = counter; counter++; var _local2 = door_objs.length; if (_local2 > 1) { door_objs[_local2 - 1].door_prev = door_objs[_local2 - 2]; door_objs[_local2 - 2].door_next = door_objs[_local2 - 1]; } } function insertDoor() { var _local2 = createDoor((counter - door_objs.length) - 1); _local2.id = (counter - door_objs.length) - 1; door_objs.unshift(_local2); _local2.gotoFrame(door_frames, true); var _local3 = door_objs.length; if (_local3 > 1) { door_objs[1].door_prev = _local2; _local2.door_next = door_objs[1]; } } function createDoor(n) { var _local3 = doors.attachMovie("door", "door" + n, 1); var _local4 = shadows.attachMovie("shadow", "shadows" + n, 1); var _local2 = new Door(_local3, _local4, ref_pos); _local2.addListener(this, onCollision, "onCollision"); _local2.addListener(this, onComplete, "onComplete"); _local2.addListener(this, onClosed, "onClosed"); _local2.addListener(this, onCenter, "onCenter"); _local2.addListener(this, onOpening, "onOpening"); return(_local2); } function setPlint() { plint.gotoAndStop(1); while (max_frame > plint._currentframe) { plint.nextFrame(); } } function onCenter(door) { door_in_center = door; } function onCollision(force, frame) { var _local2 = Parameters.vol_min + (((100 - Parameters.vol_min) * force) / Parameters.max_vol_at_force); var _local4 = -100 + ((200 * (ref_pos[frame] - ref_pos[ref_pos.length - 1])) / (ref_pos[1] - ref_pos[ref_pos.length - 1])); var _local3 = "hit0" + (random(3) + 1); soundman.playSound(_local3, _local2, _local4); } function onComplete(door) { var _local6 = Parameters.vol_min + (((100 - Parameters.vol_min) * Math.abs(door.__get__speed())) / Parameters.max_vol_at_force); var _local8 = -100; var _local7 = "close0" + (random(2) + 1); soundman.playSound(_local7, _local6, _local8); var _local2 = 0; while (_local2 < door_objs.length) { if (door_objs[_local2] == door) { var _local4 = _local2; break; } _local2++; } if (_local4 > 0) { door_objs[0].destroy(); door_objs.shift(); var _local3 = 0; while (_local3 < door_objs.length) { setDepthOfDoor(_local3); _local3++; } } } function onClosed(door) { var _local6 = Parameters.vol_min + (((100 - Parameters.vol_min) * Math.abs(door.__get__speed())) / Parameters.max_vol_at_force); var _local8 = 100; var _local7 = "close0" + (random(2) + 1); soundman.playSound(_local7, _local6, _local8); var _local2 = door_objs.length - 1; while (_local2 >= 0) { if (door_objs[_local2] == door) { var _local4 = _local2; break; } _local2--; } if (_local4 < (door_objs.length - 1)) { door_objs[door_objs.length - 1].destroy(); door_objs.pop(); counter--; var _local3 = 0; while (_local3 < door_objs.length) { setDepthOfDoor(_local3); _local3++; } } } function onOpening(door) { var _local2 = 100; var _local4 = ((door.__get__frame() < (door_frames / 2)) ? 100 : -100); var _local3 = "open"; soundman.playSound(_local3, _local2, _local4); } function onInit() { clearInterval(interval_init); var _local2 = 100; var _local4 = 0; var _local3 = "doorbell"; soundman.playSound(_local3, _local2, _local4); } static var instance = null; var door_objs = []; var min_frame = 0; var max_frame = 0; var counter = 0; }
Symbol 125 MovieClip [__Packages.Door] Frame 0
class Door { var dragging, mc_door, mc_shadow, ref_pos, dx_per_frame, maxspeed, friction, demping, frames, lastpos, origpos, door_prev, door_next; function Door (mcdoor, mcshadow, ref_xs) { dragging = false; mc_door = mcdoor; mc_shadow = mcshadow; mc_door.stop(); mc_shadow.stop(); ref_pos = ref_xs; mc_door.container = this; mc_door.onPress = function () { this.container.onPress(); this.onRelease = (this.onReleaseOutside = function () { this.container.onRelease(); }); }; dx_per_frame = Parameters.dx_per_frame; maxspeed = Parameters.maxstepsize * dx_per_frame; friction = Parameters.friction; demping = Parameters.demping; collision_table = Parameters.collision_table; frames = mc_door._totalframes; counter = 0; speed = (0); } function destroy() { mc_door.removeMovieClip(); mc_shadow.removeMovieClip(); } function show(bool) { mc_door._visible = ((bool == undefined) ? true : (bool)); } function step() { var _local6 = mc_door._xmouse; if (dragging) { var _local8 = Math.round(_local6 - lastpos); var _local3 = _local6 - origpos; if ((_local3 < ref_pos[frame + 1]) and (frame < frames)) { var _local5 = 1; var _local2 = frame + 1; while (_local2 <= frames) { if (_local3 > ref_pos[_local2]) { var _local4 = frame + Math.ceil(((_local2 - 1) - frame) / 2); break; } _local2++; } if (_local4 == undefined) { var _local4 = frame + Math.ceil((frames - frame) / 2); } } else if ((_local3 > ref_pos[frame - 1]) and (frame > 1)) { var _local5 = -1; var _local2 = frame - 1; while (_local2 >= 1) { if (_local3 < ref_pos[_local2]) { var _local4 = frame + Math.floor(((_local2 + 1) - frame) / 2); break; } _local2--; } if (_local4 == undefined) { var _local4 = frame + Math.floor((1 - frame) / 2); } } lastpos = _local6; speed = (((_local4 == undefined) ? 0 : (Math.round(ref_pos[_local4] - ref_pos[frame])))); } else { counter = counter + Math.abs(speed); if ((counter / dx_per_frame) >= 1) { var _local7 = Math.floor(counter / dx_per_frame); counter = counter % dx_per_frame; var _local5 = (-speed) / Math.abs(speed); var _local4 = Math.min(frames, Math.max(1, frame + (_local5 * _local7))); } } if (_local4 != undefined) { if (_local4 == frames) { } else if (_local4 == 1) { } else if (_local5 == 1) { if ((door_prev != undefined) and (getCollisionFrame(door_prev.__get__frame(), _local5) < _local4)) { var _local4 = getCollisionFrame(door_prev.__get__frame(), _local5); notifyListeners("onCollision", [Math.abs(speed) + Math.abs(door_prev.__get__speed()), door_prev.__get__frame()]); door_prev.addSpeed(speed * demping); speed = (0); } } else if ((door_next != undefined) and (getCollisionFrame(door_next.__get__frame(), _local5) > _local4)) { var _local4 = getCollisionFrame(door_next.__get__frame(), _local5); notifyListeners("onCollision", [Math.abs(speed) + Math.abs(door_next.__get__speed()), door_next.__get__frame()]); door_next.addSpeed(speed * demping); speed = (0); } gotoFrame(_local4); } speed = speed * friction; } function getCollisionFrame(fr, dir) { var _local4 = 0; var _local2 = 0; while (_local2 < collision_table.length) { var _local3 = collision_table[_local2]; if (fr < _local3[0]) { break; } _local4 = _local3[1]; _local2++; } return(fr - (dir * _local4)); } function setDepth(n) { mc_door.swapDepths(n); mc_shadow.swapDepths(n); } function gotoFrame(n, bool_dont_notify) { n = Math.min(frames, Math.max(1, n)); var _local3 = frame; mc_door.gotoAndStop(n); mc_shadow.gotoAndStop(n); if (bool_dont_notify) { return(undefined); } if (((_local3 == 1) and (n > 1)) or ((_local3 == frames) and (n < frames))) { notifyListeners("onOpening", [this]); } else if ((n == 49) or (n == 50)) { notifyListeners("onCenter", [this]); } else if (n >= frames) { notifyListeners("onComplete", [this]); speed = (0); counter = 0; if (Parameters.stop_dragging_on_end) { dragging = false; } } else if (n <= 1) { notifyListeners("onClosed", [this]); speed = (0); counter = 0; if (Parameters.stop_dragging_on_end) { dragging = false; } } } function get mc() { return(mc_door); } function get frame() { return(mc_door._currentframe); } function set speed(n) { _speed = Math.max(-maxspeed, Math.min(maxspeed, n)); counter = 0; //return(speed); } function get speed() { return(_speed); } function addSpeed(n) { speed = (speed + n); } function onPress() { _speed = 0; dragging = true; lastpos = mc_door._xmouse; origpos = mc_door._xmouse - ref_pos[frame]; } function onRelease() { dragging = false; } function addListener(cbobj, cbfn, eventname) { if (_listeners[eventname] eq undefined) { _listeners[eventname] = []; } for (var _local5 in _listeners[eventname]) { if (_listeners[eventname][_local5][0] == cbobj) { var _local3 = true; break; } } if (!_local3) { _listeners[eventname].push([cbobj, cbfn]); } } function removeListener(cbobj, eventname) { if (eventname != undefined) { for (var _local4 in _listeners) { for (var _local5 in _listeners[_local4]) { if (_listeners[_local4][_local5][0] == cbobj) { _listeners[_local4][_local5][0] = null; } } } } else { for (var _local5 in _listeners[eventname]) { if (_listeners[eventname][_local5][0] == cbobj) { _listeners[_local4][_local5][0] = null; } } } } function notifyListeners(eventname, args) { var _local2 = 0; while (_local2 < _listeners[eventname].length) { var _local3 = _listeners[eventname][_local2]; _local3[1].apply(_local3[0], args); _local2++; } } var collision_table = []; var _speed = 0; var counter = 0; var _listeners = {}; }
Symbol 126 MovieClip [__Packages.Parameters] Frame 0
class Parameters { function Parameters () { } static var delay_dingdong = 300; static var dx_per_frame = 10; static var maxstepsize = 25; static var friction = 0.95; static var demping = 0.7; static var stop_dragging_on_end = false; static var vol_min = 40; static var max_vol_at_force = 70; static var sound_pan_factor = 1; static var collision_table = [[1, 0], [8, 2], [12, 3], [18, 4], [83, 3], [89, 2], [93, 1], [101, 0]]; static var door_frames = 101; }
Symbol 127 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager { function SoundManager () { } function playSound(id, vol, pan) { var _local4 = _global.root.getNextHighestDepth(); var _local3 = _global.doors_movie.createEmptyMovieClip("mc_sound" + _local4, _local4); var snd = new Sound(_local3); snd.setVolume(((vol == undefined) ? 100 : (vol))); snd.setPan(Parameters.sound_pan_factor * ((pan == undefined) ? 0 : (pan))); snd.attachSound(id); snd.start(); _local3.snd = snd; _local3.onEnterFrame = function () { if (snd.position == snd.duration) { this.removeMovieClip(); } }; } }

Library Items

Symbol 1 Sound [open]
Symbol 2 Sound [hit03]
Symbol 3 Sound [hit02]
Symbol 4 Sound [hit01]
Symbol 5 Sound [doorbell]
Symbol 6 Sound [close02]
Symbol 7 Sound [close01]
Symbol 8 GraphicUsed by:109
Symbol 9 GraphicUsed by:109
Symbol 10 GraphicUsed by:109
Symbol 11 GraphicUsed by:109
Symbol 12 GraphicUsed by:109
Symbol 13 GraphicUsed by:109
Symbol 14 GraphicUsed by:109
Symbol 15 GraphicUsed by:109
Symbol 16 GraphicUsed by:109
Symbol 17 GraphicUsed by:109
Symbol 18 GraphicUsed by:109
Symbol 19 GraphicUsed by:109
Symbol 20 GraphicUsed by:109
Symbol 21 GraphicUsed by:109
Symbol 22 GraphicUsed by:109
Symbol 23 GraphicUsed by:109
Symbol 24 GraphicUsed by:109
Symbol 25 GraphicUsed by:109
Symbol 26 GraphicUsed by:109
Symbol 27 GraphicUsed by:109
Symbol 28 GraphicUsed by:109
Symbol 29 GraphicUsed by:109
Symbol 30 GraphicUsed by:109
Symbol 31 GraphicUsed by:109
Symbol 32 GraphicUsed by:109
Symbol 33 GraphicUsed by:109
Symbol 34 GraphicUsed by:109
Symbol 35 GraphicUsed by:109
Symbol 36 GraphicUsed by:109
Symbol 37 GraphicUsed by:109
Symbol 38 GraphicUsed by:109
Symbol 39 GraphicUsed by:109
Symbol 40 GraphicUsed by:109
Symbol 41 GraphicUsed by:109
Symbol 42 GraphicUsed by:109
Symbol 43 GraphicUsed by:109
Symbol 44 GraphicUsed by:109
Symbol 45 GraphicUsed by:109
Symbol 46 GraphicUsed by:109
Symbol 47 GraphicUsed by:109
Symbol 48 GraphicUsed by:109
Symbol 49 GraphicUsed by:109
Symbol 50 GraphicUsed by:109
Symbol 51 GraphicUsed by:109
Symbol 52 GraphicUsed by:109
Symbol 53 GraphicUsed by:109
Symbol 54 GraphicUsed by:109
Symbol 55 GraphicUsed by:109
Symbol 56 GraphicUsed by:109
Symbol 57 GraphicUsed by:109 119
Symbol 58 GraphicUsed by:109
Symbol 59 GraphicUsed by:109
Symbol 60 GraphicUsed by:109
Symbol 61 GraphicUsed by:109
Symbol 62 GraphicUsed by:109
Symbol 63 GraphicUsed by:109
Symbol 64 GraphicUsed by:109
Symbol 65 GraphicUsed by:109
Symbol 66 GraphicUsed by:109
Symbol 67 GraphicUsed by:109
Symbol 68 GraphicUsed by:109
Symbol 69 GraphicUsed by:109
Symbol 70 GraphicUsed by:109
Symbol 71 GraphicUsed by:109
Symbol 72 GraphicUsed by:109
Symbol 73 GraphicUsed by:109
Symbol 74 GraphicUsed by:109
Symbol 75 GraphicUsed by:109
Symbol 76 GraphicUsed by:109
Symbol 77 GraphicUsed by:109
Symbol 78 GraphicUsed by:109
Symbol 79 GraphicUsed by:109
Symbol 80 GraphicUsed by:109
Symbol 81 GraphicUsed by:109
Symbol 82 GraphicUsed by:109
Symbol 83 GraphicUsed by:109
Symbol 84 GraphicUsed by:109
Symbol 85 GraphicUsed by:109
Symbol 86 GraphicUsed by:109
Symbol 87 GraphicUsed by:109
Symbol 88 GraphicUsed by:109
Symbol 89 GraphicUsed by:109
Symbol 90 GraphicUsed by:109
Symbol 91 GraphicUsed by:109
Symbol 92 GraphicUsed by:109
Symbol 93 GraphicUsed by:109
Symbol 94 GraphicUsed by:109
Symbol 95 GraphicUsed by:109
Symbol 96 GraphicUsed by:109
Symbol 97 GraphicUsed by:109
Symbol 98 GraphicUsed by:109
Symbol 99 GraphicUsed by:109
Symbol 100 GraphicUsed by:109
Symbol 101 GraphicUsed by:109
Symbol 102 GraphicUsed by:109
Symbol 103 GraphicUsed by:109
Symbol 104 GraphicUsed by:109
Symbol 105 GraphicUsed by:109
Symbol 106 GraphicUsed by:109
Symbol 107 GraphicUsed by:109
Symbol 108 GraphicUsed by:109
Symbol 109 MovieClip [door]Uses: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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 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
Symbol 110 GraphicUsed by:111
Symbol 111 MovieClip [shadow]Uses:110
Symbol 112 MovieClipUsed by:123
Symbol 113 GraphicUsed by:123
Symbol 114 GraphicUsed by:116
Symbol 115 GraphicUsed by:116
Symbol 116 MovieClipUses:114 115Used by:123
Symbol 117 MovieClipUsed by:123
Symbol 118 GraphicUsed by:119
Symbol 119 MovieClipUses:118 57Used by:123
Symbol 120 GraphicUsed by:121
Symbol 121 MovieClipUses:120Used by:122
Symbol 122 MovieClipUses:121Used by:123
Symbol 123 MovieClipUses:112 113 116 117 119 122Used by:Timeline
Symbol 124 MovieClip [__Packages.Main]
Symbol 125 MovieClip [__Packages.Door]
Symbol 126 MovieClip [__Packages.Parameters]
Symbol 127 MovieClip [__Packages.SoundManager]

Instance Names

"mc_total"Frame 1Symbol 123 MovieClip
"mc_circle"Symbol 122 MovieClip Frame 1Symbol 121 MovieClip
"mc_shadows"Symbol 123 MovieClip Frame 1Symbol 112 MovieClip
"mc_plint"Symbol 123 MovieClip Frame 1Symbol 116 MovieClip
"mc_doors"Symbol 123 MovieClip Frame 1Symbol 117 MovieClip
"mc_extra_knob"Symbol 123 MovieClip Frame 1Symbol 119 MovieClip
"mc_ref"Symbol 123 MovieClip Frame 1Symbol 122 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS1/AS2.
ExportAssets (56)Timeline Frame 1Symbol 1 as "open"
ExportAssets (56)Timeline Frame 1Symbol 2 as "hit03"
ExportAssets (56)Timeline Frame 1Symbol 3 as "hit02"
ExportAssets (56)Timeline Frame 1Symbol 4 as "hit01"
ExportAssets (56)Timeline Frame 1Symbol 5 as "doorbell"
ExportAssets (56)Timeline Frame 1Symbol 6 as "close02"
ExportAssets (56)Timeline Frame 1Symbol 7 as "close01"
ExportAssets (56)Timeline Frame 1Symbol 109 as "door"
ExportAssets (56)Timeline Frame 1Symbol 111 as "shadow"
ExportAssets (56)Timeline Frame 1Symbol 124 as "__Packages.Main"
ExportAssets (56)Timeline Frame 1Symbol 125 as "__Packages.Door"
ExportAssets (56)Timeline Frame 1Symbol 126 as "__Packages.Parameters"
ExportAssets (56)Timeline Frame 1Symbol 127 as "__Packages.SoundManager"




http://swfchan.com/2/6850/info.shtml
Created: 10/5 -2019 03:09:44 Last modified: 10/5 -2019 03:09:44 Server time: 05/11 -2024 06:37:52