Instance of Symbol 122 MovieClip in Frame 1
//component parameters
onClipEvent (initialize) {
xin_motion_val = "Toward";
xin_alphatype_val = "No";
xout_motion_val = "None";
xout_alphatype_val = "No";
perc_req_val = 100;
show_perc_val = "Yes";
slow_factor_val = 0.2;
init_action_val = "_root.stop();";
play_action_val = "_root.play();";
}
Frame 21
this.stop();
Frame 22
this.stop();
this.game_data = "BLOODHOUNDS|What type of dog do vampires like best?|BOO|How does a ghost cry? ___ Hoo!|SKELETON|What kind of key should you always take to a haunted house?|BAT|Why do vampires need mouthwash? Because they have ___ breath.|DEAD|What kind of street to zombies like? ___ ends.|FROSTBITE|What do you get when you cross a vampire with a snowman?|SPELLING|What was the witch's favorite subject in school?|MUMMY|What did the dead Egyptian say when he got lost? I want my ____.|SCARE|What do witches put in their hair? ____ Spray.|GHOUL|How does a monster score a touchdown? He runs over a ____ line.|WRAP|What kind of music do mummies listen to?|COFFIN|How can you tell when Dracula has a cold? When he starts _______.|WRAPPED|Why couldn't the mummy answer the phone? Because he was all _______ up.|GORE|Why are vampires Democrats? They want _____ in 2000!|AHEAD|Why did the headless horsemen go into business for himself? He wanted to get _______ in life?|PUMPKIN|How did the ghost patch his sheet? With a _____ patch.|TOMBSTONES|What kind of rocks does Frankenstein have in his collection?|SQUASH|What do you get when you drop a pumpkin?|TOOTH|What does a vampire fear most? _____ Decay.|DIG|Who did the Zombie invite to his party? Anybody he could ____ up.|BLOOD|How do vampires get around on Halloween night? With ______ vessels.|DYING|Why are there fences around cemeteries? Because people are _____ to get in.|SPOOK|What did the mommy ghost say to the baby ghost? Don't ____ until you're spooken to.|HUNGRY|What do you call a monster chasing a train full of people?|PUPIL|Why did the cyclops quit teaching? He had only one ____.|VACUUM|Why do witches use brooms to fly on? Because ____ cleaners are too heavy.|SHEET|What did the daddy ghost say to his family when they went out for a drive? Fasten your _____ belts.|SLIME|What is a ghouls favorite drink? ____ juice.|STAKE|What does a vampire never order at a restaurant? A ____ Sandwich.|NECK|What's it like to be kissed by a vampire? It's a pain in the ____.|SCREAM|What does a ghost have for desert? I-_______.|TROMBONE|What is a skeleton's favorite instrument? A _______.|LAB|What kind of dog does a mad scientist have? A _____.";
Instance of Symbol 107 MovieClip [CrosswordGameSymbol] in Frame 22
//component parameters
onClipEvent (initialize) {
words_textfile_val = "creepycrossword.txt";
num_columns_val = 15;
num_rows_val = 15;
target_num_words_val = 40;
shadow_alpha_val = 50;
shadow_offset_x_val = 8;
shadow_offset_y_val = 8;
horizontal_scrolling_val = false;
use_preset_puzzles_val = false;
correct_sounds_label = "correct1|correct2|correct3|correct4|correct5|correct6|correct7|correct8|correct9|correct10|correct11|correct12|correct13";
incorrect_sounds_label = "incorrect1|incorrect2|incorrect3|incorrect4|incorrect5|incorrect6|incorrect7|incorrect8|incorrect9";
num_preset_puzzles = 0;
incorrect_sounds_load_type = "Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL";
incorrect_sounds_load_url = "http://|http://|http://|http://|http://|http://|http://|http://|http://";
incorrect_sounds_load_target = "_blank|_blank|_blank|_blank|_blank|_blank|_blank|_blank|_blank";
incorrect_sounds_swf_type = "Level|Level|Level|Level|Level|Level|Level|Level|Level";
incorrect_sounds_swf_level = "1|1|1|1|1|1|1|1|1";
incorrect_sounds_swf_mc = "_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content";
incorrect_sounds_simple = "||||||||";
correct_sounds_load_type = "Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL|Load URL";
correct_sounds_load_url = "http://|http://|http://|http://|http://|http://|http://|http://|http://|http://|http://|http://|http://";
correct_sounds_load_target = "_blank|_blank|_blank|_blank|_blank|_blank|_blank|_blank|_blank|_blank|_blank|_blank|_blank";
correct_sounds_swf_type = "Level|Level|Level|Level|Level|Level|Level|Level|Level|Level|Level|Level|Level";
correct_sounds_swf_level = "1|1|1|1|1|1|1|1|1|1|1|1|1";
correct_sounds_swf_mc = "_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content|_root.content";
correct_sounds_simple = "||||||||||||";
game_type_val = "Regular";
}
Frame 23
this.stop();
Symbol 23 MovieClip [StringExtensionsES] Frame 1
#initclip 4
String.prototype.searchReplace = function (find, replace) {
var _local1 = this.split(find);
return(_local1.join(replace));
};
#endinitclip
Symbol 67 MovieClip Frame 1
this.stop();
Symbol 73 MovieClip [ExtensionsSymbol] Frame 1
#initclip 1
Math.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + Math.floor(a));
};
Math.randf = function (a, b) {
return((Math.random() * (b - a)) + a);
};
Array.prototype.rande = function () {
return(this[Math.randi(0, this.length)]);
};
Array.prototype.swap = function (a, b) {
var _local1 = this;
var _local2 = _local1[a];
_local1[a] = _local1[b];
_local1[b] = _local2;
};
Array.prototype.shuffle = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.length) {
_local2.swap(_local1, Math.randi(0, _local2.length));
_local1++;
}
};
Array.prototype.hasElement = function (e) {
var _local2 = this;
var _local3 = e;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == _local3) {
return(true);
}
_local1++;
}
return(false);
};
_global.returnConstantString = function (char, n) {
var _local3 = char;
var _local2 = "";
var _local1 = 0;
while (_local1 < n) {
_local2 = _local2 + _local3;
_local1++;
}
return(_local2);
};
ASSetPropFlags(_global, "returnConstantString", 1);
_global.recursiveObjectTrace = function (obj, level) {
var _local1 = level;
var _local2 = obj;
if (_local1 == undefined) {
_local1 = 0;
}
for (var _local3 in _local2) {
if (typeof(_local2[_local3]) == "object") {
trace(((returnConstantString(" ", _local1 * 4) + _local3) + " = ") + _local2[_local3]);
trace(returnConstantString(" ", _local1 * 4) + "{");
recursiveObjectTrace(_local2[_local3], _local1 + 1);
trace(returnConstantString(" ", _local1 * 4) + "}");
} else {
trace(((returnConstantString(" ", _local1 * 4) + _local3) + " = ") + _local2[_local3]);
}
}
};
ASSetPropFlags(_global, "recursiveObjectTrace", 1);
#endinitclip
Symbol 76 MovieClip Frame 1
this.stop();
Symbol 78 MovieClip [list_clue_item] Frame 1
this.onPress = function () {
var _local1 = this;
_local1._parent._parent.cursor_x = _local1.word_x;
_local1._parent._parent.cursor_y = _local1.word_y;
if (direction == "across") {
_local1._parent._parent.prev_cursor_y = _local1.word_y;
} else {
_local1._parent._parent.prev_cursor_x = _local1.word_x;
}
_local1._parent._parent.set_selection(_local1.word_y, _local1.word_x, _local1.direction);
};
Symbol 82 MovieClip Frame 1
this._visible = false;
this._width = (this._heght = 1);
Symbol 83 MovieClip [ScrollbarComponentES] Frame 1
#initclip 2
ScrollbarClass = function () {
if (this._name != undefined) {
this.initialize();
}
};
ScrollbarClass.prototype = new MovieClip();
Object.registerClass("ScrollbarComponentES", ScrollbarClass);
ScrollbarClass.prototype.initialize = function () {
var _local1 = this;
var _local2 = _local1._rotation;
_local1._rotation = 0;
_local1.initialize_variables();
_local1.initialize_graphics();
_local1.render_scroll_bar();
_local1.render_scroll_content();
_local1._rotation = _local2;
};
ScrollbarClass.prototype.initialize_variables = function () {
var _local1 = this;
_local1.text = _local1.text;
_local1.use_html = _local1.use_html_val;
_local1.scroll_target = _local1.scroll_target_val;
_local1.content_type = _local1.content_type_val;
_local1.orientation = _local1.orientation_val;
_local1.mask_type = _local1.mask_type_val;
_local1.mask_width = Number(_local1.mask_width_val);
_local1.mask_height = Number(_local1.mask_height_val);
_local1.scrollbar_style = _local1.scrollbar_style_val;
_local1.skins = _local1.skins_val;
_local1.scroll_up_skin = _local1.scroll_up_skin_val;
_local1.scroll_down_skin = _local1.scroll_down_skin_val;
_local1.track_skin = _local1.track_skin_val;
_local1.drag_skin = _local1.drag_skin_val;
_local1.use_hand_cursor = _local1.use_hand_cursor_val;
_local1.continuous_scroll_delay = Number(_local1.continuous_scroll_delay_val);
_local1.easing_factor = Number(_local1.easing_factor_val);
_local1.depth = 0;
_local1.original_width = _local1._width;
_local1.original_height = _local1._height;
_local1._xscale = (_local1._yscale = 100);
_local1.scroll_position = 0;
_local1.use_hand_cursor = ((((_local1.use_hand_cursor == "True") || (_local1.use_hand_cursor == "true")) || (_local1.use_hand_cursor == true)) ? true : false);
_local1.scroll_ref = _local1._parent[_local1.scroll_target];
_local1.scroll_content_original_x = _local1.scroll_ref._x;
_local1.scroll_content_original_y = _local1.scroll_ref._y;
if (((((_local1.content_type == "Textfield") && (_local1.text != "")) && (_local1.text != " ")) && (_local1.text != undefined)) && (_local1.text != null)) {
if (((_local1.use_html == "True") || (_local1.use_html == "true")) || (_local1.use_html == true)) {
_local1.scroll_ref.html = true;
_local1.scroll_ref.htmlText = _local1.text;
} else {
_local1.scroll_ref.html = false;
_local1.scroll_ref.text = _local1.text;
}
}
if (_local1.content_type == "Textfield") {
_local1.scroll_ref.addListener({onChanged:_local1.on_text_change, onScroller:_local1.on_text_scroll, ref:_local1});
}
_local1.update_scroll_properties();
};
ScrollbarClass.prototype.initialize_graphics = function () {
var _local1 = this;
_local1.calculate_skin_linkages();
_local1.create_scrollbar_skins();
_local1.position_skins();
_local1.create_scroll_content_mask();
};
ScrollbarClass.prototype.calculate_skin_linkages = function () {
var _local1 = this;
if (_local1.skins == "Custom") {
} else {
var _local2 = _local1.skins.toLowerCase().searchReplace(" ", "");
_local1.scroll_up_skin = _local2 + "_scroll_up";
_local1.scroll_down_skin = _local2 + "_scroll_down";
_local1.track_skin = _local2 + "_track";
_local1.drag_skin = _local2 + "_drag";
}
};
ScrollbarClass.prototype.create_scrollbar_skins = function () {
var _local1 = this;
if ((((_local1.scrollbar_style == "Track and Buttons") || (_local1.scrollbar_style == "Track Only")) || (_local1.scrollbar_style == "Track and Bottom Buttons")) || (_local1.scrollbar_style == "Track and Top Buttons")) {
_local1.create_track_skins();
}
if ((((((_local1.scrollbar_style == "Track and Buttons") || (_local1.scrollbar_style == "Buttons Only")) || (_local1.scrollbar_style == "Bottom Buttons Only")) || (_local1.scrollbar_style == "Track and Bottom Buttons")) || (_local1.scrollbar_style == "Track and Top Buttons")) || (_local1.scrollbar_style == "Top Buttons Only")) {
_local1.create_scroll_button_skins();
}
};
ScrollbarClass.prototype.create_track_skins = function () {
var _local1 = this;
_local1.attachMovie(_local1.track_skin, "track", _local1.depth++);
_local1.attachMovie(_local1.drag_skin, "drag", _local1.depth++);
for (var _local2 in _local1.track) {
_local1.track[_local2].useHandCursor = ((((_local1.use_hand_cursor == "True") || (_local1.use_hand_cursor == "true")) || (_local1.use_hand_cursor == true)) ? true : false);
}
for (var _local2 in _local1.drag) {
_local1.drag[_local2].useHandCursor = ((((_local1.use_hand_cursor == "True") || (_local1.use_hand_cursor == "true")) || (_local1.use_hand_cursor == true)) ? true : false);
}
_local1.track.useHandCursor = _local1.use_hand_cursor;
_local1.drag.useHandCursor = _local1.use_hand_cursor;
};
ScrollbarClass.prototype.create_scroll_button_skins = function () {
var _local1 = this;
_local1.attachMovie(_local1.scroll_up_skin, "scroll_up", _local1.depth++);
_local1.attachMovie(_local1.scroll_down_skin, "scroll_down", _local1.depth++);
for (var _local2 in _local1.scroll_up) {
_local1.scroll_up[_local2].useHandCursor = _local1.use_hand_cursor;
}
for (var _local2 in _local1.scroll_down) {
_local1.scroll_down[_local2].useHandCursor = _local1.use_hand_cursor;
}
_local1.scroll_up.useHandCursor = _local1.use_hand_cursor;
_local1.scroll_down.useHandCursor = _local1.use_hand_cursor;
};
ScrollbarClass.prototype.position_skins = function () {
var _local1 = this;
if (_local1.scrollbar_style == "Track and Buttons") {
_local1.scroll_down._y = _local1.original_height - _local1.scroll_down._height;
_local1.track._y = _local1.scroll_up._height;
_local1.track._height = _local1.scroll_down._y - _local1.scroll_up._height;
_local1.drag._y = _local1.scroll_up._height;
} else if (_local1.scrollbar_style == "Track and Bottom Buttons") {
_local1.scroll_down._y = _local1.original_height - _local1.scroll_down._height;
_local1.scroll_up._y = _local1.scroll_down._y - _local1.scroll_up._height;
_local1.track._height = _local1.scroll_up._y;
} else if (_local1.scrollbar_style == "Buttons Only") {
_local1.scroll_down._y = _local1.original_height - _local1.scroll_down._height;
} else if (_local1.scrollbar_style == "Bottom Buttons Only") {
_local1.scroll_down._y = _local1.original_height - _local1.scroll_down._height;
_local1.scroll_up._y = _local1.scroll_down._y - _local1.scroll_up._height;
} else if (_local1.scrollbar_style == "Track Only") {
_local1.track._height = _local1.original_height;
} else if (_local1.scrollbar_style == "Track and Top Buttons") {
_local1.scroll_down._y = _local1.scroll_up._y + _local1.scroll_up._height;
_local1.track._y = _local1.scroll_down._y + _local1.scroll_down._height;
_local1.track._height = (_local1.original_height - _local1.scroll_up._height) - _local1.scroll_down._height;
} else if (_local1.scrollbar_style == "Top Buttons Only") {
_local1.scroll_down._y = _local1.scroll_up._y + _local1.scroll_up._height;
}
_local1.calculate_drag_scroller_bounds();
};
ScrollbarClass.prototype.create_scroll_content_mask = function () {
var _local1 = this;
if (_local1.scroll_ref.__ES_SCROLL_MASKED) {
} else if ((_local1.content_type == "MovieClip") && (_local1.mask_type == "Automatic")) {
var _local3 = 5643 + Math.randi(0, 2000);
var _local2 = _local1._parent.createEmptyMovieClip("mask" + _local3, _local3, {_x:_local1.scroll_content_original_x, _y:_local1.scroll_content_original_y});
_local2._x = _local1.scroll_content_original_x;
_local2._y = _local1.scroll_content_original_y;
_local2.lineStyle(0, 0, 100);
_local2.beginFill(0, 100);
_local2.moveTo(0, 0);
_local2.lineTo(_local1.mask_width, 0);
_local2.lineTo(_local1.mask_width, _local1.mask_height);
_local2.lineTo(0, _local1.mask_height);
_local2.endFill();
_local1.scroll_ref.setMask(_local2);
_local1.scroll_ref.__ES_SCROLL_MASKED = true;
}
};
ScrollbarClass.prototype.calculate_drag_scroller_bounds = function () {
var _local1 = this;
_local1.drag_min_y = _local1.track._y;
_local1.drag_max_y = (_local1.track._y + _local1.track._height) - _local1.drag._height;
};
ScrollbarClass.prototype.onMouseDown = function () {
var _local1 = this;
var _local2 = _root;
if (_local1.scroll_up.hitTest(_local2._xmouse, _local2._ymouse, true)) {
_local1.scroll_up_press();
} else if (_local1.scroll_down.hitTest(_local2._xmouse, _local2._ymouse, true)) {
_local1.scroll_down_press();
} else if (_local1.drag.hitTest(_local2._xmouse, _local2._ymouse, true)) {
_local1.drag_press();
} else if (_local1.track.hitTest(_local2._xmouse, _local2._ymouse, true)) {
_local1.track_press();
}
};
ScrollbarClass.prototype.onMouseUp = function () {
var _local1 = this;
if (_local1.pressing_scroll_up) {
_local1.scroll_up_release();
} else if (_local1.pressing_scroll_down) {
_local1.scroll_down_release();
} else if (_local1.pressing_drag) {
_local1.drag_release();
} else if (_local1.pressing_track) {
_local1.track_release();
}
_local1.pressing_scroll_up = false;
_local1.pressing_scroll_down = false;
_local1.pressing_track = false;
_local1.pressing_drag = false;
};
ScrollbarClass.prototype.scroll_up_press = function () {
var _local1 = this;
_local1.pressing_scroll_up = true;
_local1.scroll_position = _local1.scroll_position - _local1.scroll_inc;
_local1.scroll_up_press_time = getTimer();
_local1.check_scrollbar_errors();
};
ScrollbarClass.prototype.scroll_down_press = function () {
var _local1 = this;
_local1.pressing_scroll_down = true;
_local1.scroll_position = _local1.scroll_position + _local1.scroll_inc;
_local1.scroll_down_press_time = getTimer();
_local1.check_scrollbar_errors();
};
ScrollbarClass.prototype.track_press = function () {
var _local1 = this;
_local1.pressing_track = true;
_local1.scroll_position = _local1.scroll_position + ((Math.abs(_local1._ymouse - _local1.drag._y) / (_local1._ymouse - _local1.drag._y)) * _local1.scroll_inc);
_local1.track_press_time = getTimer();
};
ScrollbarClass.prototype.drag_press = function () {
var _local1 = this;
_local1.pressing_drag = true;
_local1.drag.startDrag(false, _local1.drag._x, _local1.drag_min_y, _local1.drag._x, _local1.drag_max_y + _local1.drag_displacement);
};
ScrollbarClass.prototype.scroll_up_release = function () {
};
ScrollbarClass.prototype.scroll_down_release = function () {
};
ScrollbarClass.prototype.track_release = function () {
};
ScrollbarClass.prototype.drag_release = function () {
this.drag.stopDrag();
};
ScrollbarClass.prototype.update_scroll_properties = function () {
var _local1 = this;
if (_local1.content_type == "Textfield") {
_local1.update_textfield_scroll_properties();
} else {
_local1.update_movieclip_scroll_properties();
}
_local1.scroll_inc = (((_local1.content_type == "Textfield") && (_local1.orientation == "Vertical")) ? 1 : 15);
_local1.drag_displacement = ((_local1.track._height - _local1.drag._height) / (_local1.max_pos - _local1.min_pos)) * _local1.scroll_inc;
_local1.calculate_drag_scroller_bounds();
_local1.check_scrollbar_errors();
};
ScrollbarClass.prototype.check_scrollbar_errors = function () {
var _local1 = this;
_local1.min_pos = Math.max(_local1.min_pos, 0);
_local1.max_pos = Math.max(_local1.max_pos, 0);
_local1.scroll_position = Math.max(_local1.min_pos, _local1.scroll_position);
_local1.scroll_position = Math.min(_local1.max_pos, _local1.scroll_position);
};
ScrollbarClass.prototype.update_textfield_scroll_properties = function () {
var _local1 = this;
if (_local1.orientation == "Vertical") {
_local1.page_size = _local1.scroll_ref.bottomScroll - _local1.scroll_ref.scroll;
_local1.min_pos = 1;
_local1.max_pos = _local1.scroll_ref.maxscroll;
} else {
_local1.page_size = _local1.scroll_ref._width;
_local1.min_pos = 0;
_local1.max_pos = _local1.scroll_ref.maxhscroll;
}
};
ScrollbarClass.prototype.update_movieclip_scroll_properties = function () {
var _local1 = this;
if (_local1.orientation == "Vertical") {
_local1.page_size = _local1.mask_height;
_local1.min_pos = 0;
_local1.max_pos = _local1.scroll_ref._height - _local1.mask_height;
} else {
_local1.page_size = _local1.mask_width;
_local1.min_pos = 0;
_local1.max_pos = _local1.scroll_ref._width - _local1.mask_width;
}
};
ScrollbarClass.prototype.render_scroll_bar = function () {
this.render_drag_scroller();
this.keep_drag_on_track();
};
ScrollbarClass.prototype.render_drag_scroller = function () {
var _local1 = this;
_local1.drag._height = Math.max(4, (_local1.page_size / ((_local1.max_pos - _local1.min_pos) + _local1.page_size)) * _local1.track._height);
if (!_local1.pressing_drag) {
_local1.drag._y = (((_local1.scroll_position - _local1.min_pos) * (_local1.track._height - _local1.drag._height)) / (_local1.max_pos - _local1.min_pos)) + _local1.track._y;
}
};
ScrollbarClass.prototype.onEnterFrame = function () {
var _local1 = this;
_local1.update_scroll_properties();
_local1.render_scroll_bar();
_local1.calculate_scroll_from_drag();
_local1.check_automatic_scroll();
if ((((_local1.pressing_scroll_up || (_local1.pressing_scroll_down)) || (_local1.pressing_track)) || (_local1.pressing_drag)) || (_local1.content_type == "MovieClip")) {
_local1.render_scroll_content();
}
};
ScrollbarClass.prototype.check_automatic_scroll = function () {
var _local1 = this;
if (_local1.pressing_scroll_down && ((getTimer() - _local1.scroll_down_press_time) > _local1.continuous_scroll_delay)) {
_local1.scroll_position = _local1.scroll_position + _local1.scroll_inc;
} else if (_local1.pressing_scroll_up && ((getTimer() - _local1.scroll_up_press_time) > _local1.continuous_scroll_delay)) {
_local1.scroll_position = _local1.scroll_position - _local1.scroll_inc;
} else if (_local1.pressing_track && ((getTimer() - _local1.track_press_time) > _local1.continuous_scroll_delay)) {
var _local2 = _local1._ymouse - (_local1.drag._y + (_local1.drag._height / 2));
_local1.scroll_position = _local1.scroll_position + ((Math.abs(_local2) / _local2) * _local1.scroll_inc);
if (Math.abs(_local1._ymouse - (_local1.drag._y + (_local1.drag._height / 2))) <= _local1.drag_displacement) {
_local1.track_press_time = Number.MAX_VALUE;
}
}
};
ScrollbarClass.prototype.calculate_scroll_from_drag = function () {
var _local1 = this;
if (_local1.pressing_drag) {
var _local2 = (_local1.drag._y - _local1.drag_min_y) / (_local1.drag_max_y - _local1.drag_min_y);
_local1.scroll_position = (_local2 * (_local1.max_pos - _local1.min_pos)) + _local1.min_pos;
_local1.scroll_position = Math.max(_local1.min_pos, _local1.scroll_position);
_local1.scroll_position = Math.min(_local1.max_pos, _local1.scroll_position);
}
};
ScrollbarClass.prototype.keep_drag_on_track = function () {
var _local1 = this;
_local1.drag._y = Math.max(_local1.drag._y, _local1.drag_min_y);
_local1.drag._y = Math.min(_local1.drag._y, _local1.drag_max_y);
};
ScrollbarClass.prototype.on_text_change = function () {
this.ref.on_content_change();
};
ScrollbarClass.prototype.on_content_change = function () {
this.render_scroll_bar();
};
ScrollbarClass.prototype.on_text_scroll = function () {
this.ref.on_content_scroll();
};
ScrollbarClass.prototype.on_content_scroll = function () {
var _local1 = this;
if (_local1.orientation == "Vertical") {
_local1.scroll_position = _local1.scroll_ref.scroll;
} else {
_local1.scroll_position = _local1.scroll_ref.hscroll;
}
_local1.render_scroll_content();
};
ScrollbarClass.prototype.render_scroll_content = function () {
var _local1 = this;
if (_local1.content_type == "MovieClip") {
_local1.render_movieclip_scroll_content();
} else if (_local1.orientation == "Vertical") {
_local1.render_vertical_scroll_content();
} else if (_local1.orientation == "Horizontal") {
_local1.render_horizontal_scroll_content();
}
};
ScrollbarClass.prototype.render_movieclip_scroll_content = function () {
var _local1 = this;
var _local2 = ((_local1.orientation == "Vertical") ? "_y" : "_x");
_local1.scroll_ref[_local2] = _local1.scroll_ref[_local2] + ((((-_local1.scroll_position) + _local1["scroll_content_original" + _local2]) - _local1.scroll_ref[_local2]) / _local1.easing_factor);
};
ScrollbarClass.prototype.render_vertical_scroll_content = function () {
this.scroll_ref.scroll = this.scroll_position;
};
ScrollbarClass.prototype.render_horizontal_scroll_content = function () {
this.scroll_ref.hscroll = this.scroll_position;
};
#endinitclip
Symbol 98 Button
on (press) {
this.solve_puzzle();
}
Symbol 104 Button
on (press) {
_root.gotoAndStop("Starting Screen");
}
Symbol 107 MovieClip [CrosswordGameSymbol] Frame 1
#initclip 3
CrosswordGame = function () {
var _local1 = this;
_local1._x = 0;
_local1._y = 0;
_local1.load_data();
};
CrosswordGame.prototype = new MovieClip();
Object.registerClass("CrosswordGameSymbol", CrosswordGame);
CrosswordGame.prototype.load_data = function () {
var _local1 = this;
_local1.game_type = _local1.game_type_val;
_local1.words_textfile = _local1.words_textfile_val;
_local1.num_columns = Number(_local1.num_columns_val);
_local1.num_rows = Number(_local1.num_rows_val);
_local1.target_num_words = Number(_local1.target_num_words_val);
_local1.shadow_alpha = Number(_local1.shadow_alpha_val);
_local1.shadow_offset_x = Number(_local1.shadow_offset_x_val);
_local1.shadow_offset_y = Number(_local1.shadow_offset_y_val);
_local1.horizontal_scrolling = _local1.horizontal_scrolling_val;
_local1.use_preset_puzzles = _local1.use_preset_puzzles_val;
_local1.correct_sounds = _local1.correct_sounds_label.split("|");
_local1.incorrect_sounds = _local1.incorrect_sounds_label.split("|");
_local1.onDataID = setInterval(_local1.onData, 10, _local1);
};
CrosswordGame.prototype.onData = function (ref) {
var _local1 = ref;
_local1.word_list = new Array();
_local1.maximum_word_length = Number.NEGATIVE_INFINITY;
_local1.game_data = _local1._parent.game_data.split("|");
var _local2 = 0;
while (_local2 < _local1.game_data.length) {
_local1.word_list.push({word:_local1.game_data[_local2], clue:_local1.game_data[_local2 + 1], used:false});
if (_local1.game_data[_local2].length > _local1.maximum_word_length) {
_local1.maximum_word_length = _local1.game_data[_local2].length;
}
_local2 = _local2 + 2;
}
_local1.word_list.shuffle();
_local1.initialize();
clearInterval(_local1.onDataID);
};
CrosswordGame.prototype.initialize = function () {
var _local1 = this;
var start = getTimer();
_local1.gather_preset_puzzle_data();
_local1.initialize_variables();
_local1.initialize_crossword();
_local1.initialize_crossword_numbering();
_local1.render_crossword_grid();
_local1.render_word_lists();
_local1.render_selection();
_local1.num_correct_words = _local1.calculate_num_correct_words();
_local1.old_num_correct_words = _local1.calculate_num_correct_words();
};
CrosswordGame.prototype.gather_preset_puzzle_data = function () {
var _local2 = this;
_local2.preset_puzzles = new Array();
var _local1 = 0;
while (_local1 < _local2.num_preset_puzzles) {
var _local3 = _local2["preset_puzzle" + _local1];
_local1++;
}
};
CrosswordGame.prototype.initialize_variables = function () {
var _local1 = this;
_local1.depth = 0;
_local1.cell_width = _local1.board_mc._width / _local1.num_columns;
_local1.cell_height = _local1.board_mc._height / _local1.num_rows;
};
CrosswordGame.prototype.initialize_crossword = function () {
var _local1 = this;
if (_local1.use_preset_puzzles) {
_local1.initialize_crossword_preset();
} else {
_local1.initialize_crossword_random();
}
};
CrosswordGame.prototype.initialize_crossword_preset = function () {
var _local3 = this;
_local3.crossword_grid = _local3.get_empty_crossword_grid();
var _local1 = Math.randi(0, _local3.num_preset_puzzles);
_local3.num_created_words = _local3["num_preset_puzzle_words" + _local1];
var pp = _local3["preset_puzzle" + _local1].toString().split(",");
var fl = _local3["first_letter" + _local1].toString().split(",");
var wd0 = _local3["word_directions0_" + _local1].toString().split(",");
var wd1 = _local3["word_directions1_" + _local1].toString().split(",");
var td0 = _local3["through_directions0_" + _local1].toString().split(",");
var td1 = _local3["through_directions1_" + _local1].toString().split(",");
var wul0 = _local3["words_using_letter0_" + _local1].toString().split(",");
var wul1 = _local3["words_using_letter1_" + _local1].toString().split(",");
var flx = _local3["first_letter_x" + _local1].toString().split(",");
var fly = _local3["first_letter_y" + _local1].toString().split(",");
var index = 0;
var j = 0;
while (j < _local3.num_rows) {
var k = 0;
while (k < _local3.num_columns) {
_local1 = (j * _local3.num_columns) + k;
var _local2 = _local3.crossword_grid[j][k];
_local2.letter = pp[_local1];
_local2.first_letter = fl[_local1] == "true";
if (wd0[_local1].length != 0) {
_local2.word_directions = [wd0[_local1]];
}
if (wd1[_local1].length != 0) {
_local2.word_directions = [wd0[_local1], wd1[_local1]];
}
if (td0[_local1].length != 0) {
_local2.through_directions = [td0[_local1]];
}
if (td1[_local1].length != 0) {
_local2.through_directions = [td0[_local1], td1[_local1]];
}
if (wul0[_local1].length != 0) {
_local2.words_using_letter = [_local3.get_word_obj(wul0[_local1])];
}
if (wul1[_local1].length != 0) {
_local2.words_using_letter = [_local3.get_word_obj(wul0[_local1]), _local3.get_word_obj(wul1[_local1])];
}
_local2.first_letter_x = Number(flx[_local1]);
_local2.first_letter_y = Number(fly[_local1]);
_local2.words_using_letter[0].used = true;
_local2.words_using_letter[1].used = true;
k++;
}
j++;
}
};
CrosswordGame.prototype.get_word_obj = function (word) {
var _local2 = this;
var _local3 = word;
var _local1 = 0;
while (_local1 < _local2.word_list.length) {
if (_local2.word_list[_local1].word == _local3) {
return(_local2.word_list[_local1]);
}
_local1++;
}
return(undefined);
};
CrosswordGame.prototype.initialize_crossword_random = function () {
var _local1 = this;
_local1.crossword_grid = _local1.get_empty_crossword_grid();
_local1.num_created_words = 0;
var _local2 = 0;
_local1.embed_initial_words();
do {
var _local3 = _local1.num_created_words;
_local1.test_embedding_possibilities();
if (_local3 == _local1.num_created_words) {
_local2++;
} else {
_local2 = 0;
}
} while (!((_local2 == 2) || (_local1.num_created_words > _local1.target_num_words)));
};
CrosswordGame.prototype.initialize_crossword_numbering = function () {
var _local1 = this;
_local1.word_index = 0;
_local1.across_cells = [];
_local1.down_cells = [];
var j = 0;
while (j < _local1.num_rows) {
var _local3 = 0;
while (_local3 < _local1.num_columns) {
var _local2 = _local1.crossword_grid[j][_local3];
if (_local2.first_letter) {
_local2.index = ++_local1.word_index;
if (_local2.index == 1) {
_local1.cursor_x = _local3;
_local1.cursor_y = j;
_local1.prev_cursor_x = _local1.cursor_x;
_local1.prev_cursor_y = _local1.cursor_y;
_local1.set_selection(j, _local3, (_local2.word_directions.hasElement("across") ? "across" : "down"));
}
if (_local2.word_directions.hasElement("across")) {
_local1.across_cells.push(_local2);
}
if (_local2.word_directions.hasElement("down")) {
_local1.down_cells.push(_local2);
}
}
_local3++;
}
j++;
}
};
CrosswordGame.prototype.render_word_lists = function () {
var _local2 = this;
var max_width = 0;
var y = 0;
if (_local2.game_type == "Kids") {
_local2.across_cells.shuffle();
_local2.down_cells.shuffle();
}
var j = 0;
while (j <= _local2.across_cells.length) {
var _local3 = _local2.across_cells[j];
var _local1 = _local2.across_list.attachMovie("list_clue_item", "clue" + j, j + 1);
if (_local2.game_type == "Regular") {
_local1.clue.text = _local3.index + ".) ";
} else {
_local1.clue.text = "";
}
if (_local3.through_directions[0] == "across") {
_local1.clue.text = _local1.clue.text + ((_local2.game_type == "Regular") ? (_local3.words_using_letter[0].clue) : (_local3.words_using_letter[0].word));
_local1.word = _local3.words_using_letter[0].word;
} else if (_local3.through_directions[1] == "across") {
_local1.clue.text = _local1.clue.text + ((_local2.game_type == "Regular") ? (_local3.words_using_letter[1].clue) : (_local3.words_using_letter[1].word));
_local1.word = _local3.words_using_letter[1].word;
}
if (!_local2.horizontal_scrolling) {
_local1.clue.autoSize = true;
_local1.clue.multiline = true;
_local1.clue.wordWrap = true;
_local1.clue._width = _local2.across_vertical.mask_width;
_local1.background._width = _local1.clue._width;
_local1.background._height = _local1.clue._height;
_local1._y = y;
y = y + _local1._height;
} else {
_local1.clue.autoSize = true;
_local1.clue.multiline = false;
_local1.clue.wordWrap = false;
max_width = Math.max(_local2.across_vertical.mask_width, Math.max(max_width, _local1.clue._width));
_local1.clue._width = max_width;
var k = 0;
while (k <= j) {
_local2.across_list["clue" + k].background._width = (_local2.across_list["clue" + k].clue._width = max_width);
k++;
}
_local1.background._width = _local1.clue._width;
_local1.background._height = _local1.clue._height;
_local1._y = y;
y = y + _local1._height;
}
_local1.word_x = _local3.k;
_local1.word_y = _local3.j;
_local1.direction = "across";
if (j == _local2.across_cells.length) {
_local1.removeMovieClip();
}
j++;
}
var max_width = 0;
var y = 0;
var j = 0;
while (j <= _local2.down_cells.length) {
var _local3 = _local2.down_cells[j];
var _local1 = _local2.down_list.attachMovie("list_clue_item", "clue" + j, j + 1);
if (_local2.game_type == "Regular") {
_local1.clue.text = _local3.index + ".) ";
} else {
_local1.clue.text = "";
}
if (_local3.through_directions[0] == "down") {
_local1.clue.text = _local1.clue.text + ((_local2.game_type == "Regular") ? (_local3.words_using_letter[0].clue) : (_local3.words_using_letter[0].word));
_local1.word = _local3.words_using_letter[0].word;
} else if (_local3.through_directions[1] == "down") {
_local1.clue.text = _local1.clue.text + ((_local2.game_type == "Regular") ? (_local3.words_using_letter[1].clue) : (_local3.words_using_letter[1].word));
_local1.word = _local3.words_using_letter[1].word;
}
if (!_local2.horizontal_scrolling) {
_local1.clue.autoSize = true;
_local1.clue.multiline = true;
_local1.clue.wordWrap = true;
_local1.clue._width = _local2.down_vertical.mask_width;
_local1.background._width = _local1.clue._width;
_local1.background._height = _local1.clue._height;
_local1._y = y;
y = y + _local1._height;
} else {
_local1.clue.autoSize = true;
_local1.clue.multiline = false;
_local1.clue.wordWrap = false;
max_width = Math.max(_local2.down_vertical.mask_width, Math.max(max_width, _local1.clue._width));
_local1.clue._width = max_width;
var k = 0;
while (k <= j) {
_local2.down_list["clue" + k].background._width = (_local2.down_list["clue" + k].clue._width = max_width);
k++;
}
_local1.background._width = _local1.clue._width;
_local1.background._height = _local1.clue._height;
_local1._y = y;
y = y + _local1._height;
}
_local1.word_x = _local3.k;
_local1.word_y = _local3.j;
_local1.direction = "down";
if (j == _local2.down_cells.length) {
_local1.removeMovieClip();
}
j++;
}
};
CrosswordGame.prototype.render_selection = function () {
var _local1 = this;
var j = 0;
while (j < _local1.num_rows) {
var k = 0;
while (k < _local1.num_columns) {
_local1.crossword_grid[j][k]._mc.background.gotoAndStop(1);
_local1.crossword_grid[j][k]._mc.letter.text = _local1.crossword_grid[j][k].display_letter;
k++;
}
j++;
}
var selected_cell = _local1.crossword_grid[_local1.selected_y][_local1.selected_x];
var x = _local1.selected_x;
var y = _local1.selected_y;
var selected_word = "";
while ((_local1.crossword_grid[y][x].letter != "") && (_local1.crossword_grid[y][x] != undefined)) {
_local1.crossword_grid[y][x]._mc.background.gotoAndStop(3);
selected_word = selected_word + _local1.crossword_grid[y][x].letter;
if (selected_cell.selected_direction == "across") {
x++;
} else {
y++;
}
}
var j = 0;
while (j < Math.max(_local1.across_cells.length, _local1.down_cells.length)) {
var _local3 = _local1.across_cells[j];
var _local2 = _local1.down_cells[j];
var aselected_word = "";
var abuilt_word = "";
var aword_cells = [];
var dselected_word = "";
var dbuilt_word = "";
var dword_cells = [];
var n = 0;
while ((_local1.crossword_grid[_local3.j][_local3.k + n].letter != "") && (_local1.crossword_grid[_local3.j][_local3.k + n] != undefined)) {
aselected_word = aselected_word + _local1.crossword_grid[_local3.j][_local3.k + n].letter;
abuilt_word = abuilt_word + _local1.crossword_grid[_local3.j][_local3.k + n].display_letter;
aword_cells.push(_local1.crossword_grid[_local3.j][_local3.k + n]);
n++;
}
if (aselected_word == abuilt_word) {
for (var n in aword_cells) {
aword_cells[n]._mc.background.gotoAndStop(4);
}
}
var n = 0;
while ((_local1.crossword_grid[_local2.j + n][_local2.k].letter != "") && (_local1.crossword_grid[_local2.j + n][_local2.k] != undefined)) {
dselected_word = dselected_word + _local1.crossword_grid[_local2.j + n][_local2.k].letter;
dbuilt_word = dbuilt_word + _local1.crossword_grid[_local2.j + n][_local2.k].display_letter;
dword_cells.push(_local1.crossword_grid[_local2.j + n][_local2.k]);
n++;
}
if (dselected_word == dbuilt_word) {
for (var n in dword_cells) {
dword_cells[n]._mc.background.gotoAndStop(4);
}
}
j++;
}
var cursor_cell = _local1.crossword_grid[_local1.cursor_y][_local1.cursor_x];
cursor_cell._mc.background.gotoAndStop(2);
if (_local1.game_type == "Regular") {
for (var j in _local1.across_list) {
_local1.across_list[j].background.gotoAndStop(1);
}
for (var j in _local1.down_list) {
_local1.down_list[j].background.gotoAndStop(1);
}
var d = selected_cell.selected_direction;
var num_words = _local1[d + "_cells"].length;
var list = _local1[d + "_list"];
var scroll = _local1[d + "_vertical"];
var j = 0;
while (j < num_words) {
var _mc = list["clue" + j];
if (_mc.word == selected_word) {
scroll.scroll_position = _mc._y;
scroll.check_scrollbar_errors();
_mc.background.gotoAndStop(2);
}
j++;
}
}
};
CrosswordGame.prototype.test_embedding_possibilities = function () {
var possibilities = this.get_analyzed_filtered_possibilities();
possibilities.shuffle();
var j = 0;
while (j < possibilities.length) {
var _local1 = possibilities[j];
var start = ((_local1.direction == "across") ? (_local1.possible_start.k) : (_local1.possible_start.j));
var end = ((_local1.direction == "across") ? (_local1.k) : (_local1.j));
var _local2 = start;
while (_local2 <= end) {
var len = (_local1.possible_length - (_local2 - start));
var list0 = this.filter_words_lesser_greater_length(this.word_list, _local2 - start, _local1.possible_length);
var list1 = this.filter_words_containing_letter_at(list0, _local1.letter, end - _local2);
list1.shuffle();
var x = ((_local1.direction == "across") ? (_local2) : (_local1.k));
var y = ((_local1.direction == "down") ? (_local2) : (_local1.j));
var _local3 = 0;
while (_local3 < list1.length) {
var result = this.embed_word_at(list1[_local3], y, x, _local1.direction);
if (result) {
return(true);
}
_local3++;
}
_local2++;
}
j++;
}
return(false);
};
CrosswordGame.prototype.get_analyzed_filtered_possibilities = function () {
var possibilities = this.get_cell_possibilities_list();
var j = 0;
while (j < possibilities.length) {
var _local1 = possibilities[j];
var _local3 = _local1.k + ((_local1.direction == "across") ? -1 : 0);
var _local2 = _local1.j + ((_local1.direction == "down") ? -1 : 0);
var len2 = 0;
while (this.crossword_grid[_local2][_local3].letter.length == 0) {
len2++;
if (_local1.direction == "across") {
_local3--;
}
if (_local1.direction == "down") {
_local2--;
}
}
if (this.crossword_grid[_local2][_local3] != undefined) {
len2 = len2 - 2;
if (_local1.direction == "across") {
_local3 = _local3 + 2;
}
if (_local1.direction == "down") {
_local2 = _local2 + 2;
}
} else {
if (_local1.direction == "across") {
_local3++;
}
if (_local1.direction == "down") {
_local2++;
}
}
_local1.possible_start = {j:_local2, k:_local3};
_local3 = _local1.k + ((_local1.direction == "across") ? 1 : 0);
_local2 = _local1.j + ((_local1.direction == "down") ? 1 : 0);
var len1 = 0;
while (this.crossword_grid[_local2][_local3].letter.length == 0) {
len1++;
if (_local1.direction == "across") {
_local3++;
}
if (_local1.direction == "down") {
_local2++;
}
}
if (this.crossword_grid[_local2][_local3] != undefined) {
len1 = len1 - 2;
if (_local1.direction == "across") {
_local3 = _local3 - 2;
}
if (_local1.direction == "down") {
_local2 = _local2 - 2;
}
} else {
if (_local1.direction == "across") {
_local3--;
}
if (_local1.direction == "down") {
_local2--;
}
}
_local1.possible_end = {j:_local2, k:_local3};
_local1.start_length = len1;
_local1.end_length = len2;
_local1.possible_length = (len1 + len2) + 1;
if (_local1.possible_length < 2) {
possibilities.splice(j, 1);
j--;
}
j++;
}
return(possibilities);
};
CrosswordGame.prototype.get_cell_possibilities_list = function () {
var _local3 = this;
var list = new Array();
var j = 0;
while (j < _local3.num_rows) {
var _local2 = 0;
while (_local2 < _local3.num_columns) {
var _local1 = _local3.crossword_grid[j][_local2];
if ((_local1.letter != "") && (_local3.adjacents_valid_configuration(_local1))) {
list.push(_local1);
}
_local2++;
}
j++;
}
return(list);
};
CrosswordGame.prototype.adjacents_valid_configuration = function (cell) {
var adjacents = this.get_list_adjacent_cells(cell.j, cell.k);
if (adjacents.length >= 3) {
return(false);
}
var j = 0;
while (j < adjacents.length) {
var _local2 = adjacents[j];
var _local3 = j + 1;
while (_local3 < adjacents.length) {
var _local1 = adjacents[_local3];
if (Math.abs(_local2.j - _local1.j) == 2) {
cell.direction = "across";
}
if (Math.abs(_local2.k - _local1.k) == 2) {
cell.direction = "down";
}
if ((Math.abs(_local2.j - _local1.j) == 1) && (Math.abs(_local2.k - _local1.k) == 1)) {
return(false);
}
_local3++;
}
j++;
}
if (adjacents.length == 1) {
if (Math.abs(cell.j - adjacents[0].j) == 1) {
cell.direction = "across";
}
if (Math.abs(cell.k - adjacents[0].k) == 1) {
cell.direction = "down";
}
}
return(true);
};
CrosswordGame.prototype.get_list_adjacent_cells = function (j, k) {
var _local1 = this;
var _local2 = k;
var _local3 = j;
var adjacents = new Array();
if (_local1.crossword_grid[_local3 + 1][_local2].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3 + 1][_local2]);
}
if (_local1.crossword_grid[_local3 - 1][_local2].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3 - 1][_local2]);
}
if (_local1.crossword_grid[_local3][_local2 + 1].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3][_local2 + 1]);
}
if (_local1.crossword_grid[_local3 + 1][_local2 + 1].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3 + 1][_local2 + 1]);
}
if (_local1.crossword_grid[_local3 - 1][_local2 + 1].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3 - 1][_local2 + 1]);
}
if (_local1.crossword_grid[_local3][_local2 - 1].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3][_local2 - 1]);
}
if (_local1.crossword_grid[_local3 + 1][_local2 - 1].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3 + 1][_local2 - 1]);
}
if (_local1.crossword_grid[_local3 - 1][_local2 - 1].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3 - 1][_local2 - 1]);
}
return(adjacents);
};
CrosswordGame.prototype.get_list_cardinal_adjacent_cells = function (j, k) {
var _local1 = this;
var _local2 = k;
var _local3 = j;
var adjacents = new Array();
if (_local1.crossword_grid[_local3 + 1][_local2].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3 + 1][_local2]);
}
if (_local1.crossword_grid[_local3 - 1][_local2].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3 - 1][_local2]);
}
if (_local1.crossword_grid[_local3][_local2 + 1].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3][_local2 + 1]);
}
if (_local1.crossword_grid[_local3][_local2 - 1].letter.length > 0) {
adjacents.push(_local1.crossword_grid[_local3][_local2 - 1]);
}
return(adjacents);
};
CrosswordGame.prototype.embed_initial_words = function () {
var _local1 = this;
var list0 = _local1.filter_words_exact_length(_local1.word_list, _local1.maximum_word_length);
var _local3 = list0.rande();
var _local2 = Math.floor(((_local1.num_columns - _local3.word.length) - 1) / 2);
var x = Math.randi(_local2, 2 * _local2);
var y = Math.randi(Math.floor(_local1.num_rows / 3), Math.floor(0.666666666666667 * _local1.num_rows));
var bool = _local1.embed_word_at(_local3, y, x, "across");
};
CrosswordGame.prototype.embed_word_at = function (word_obj, j, k, direction) {
if (!this.word_is_embeddable(word_obj, j, k, direction)) {
return(false);
}
this.crossword_grid[j][k].first_letter = true;
this.crossword_grid[j][k].word_directions.push(direction);
var _local3 = 0;
while (_local3 < word_obj.word.length) {
var _local2 = ((direction == "across") ? (k + _local3) : (k));
var _local1 = ((direction == "down") ? (j + _local3) : (j));
var word_letter = word_obj.word.charAt(_local3);
var grid_letter = this.crossword_grid[_local1][_local2].letter;
this.crossword_grid[_local1][_local2].through_directions.push(direction);
this.crossword_grid[_local1][_local2].words_using_letter.push(word_obj);
this.crossword_grid[_local1][_local2].first_letter_x = k;
this.crossword_grid[_local1][_local2].first_letter_y = j;
if ((word_letter == grid_letter) || (grid_letter == "")) {
this.crossword_grid[_local1][_local2].letter = word_letter;
}
_local3++;
}
word_obj.used = true;
this.num_created_words++;
return(true);
};
CrosswordGame.prototype.word_is_embeddable = function (word_obj, j, k, direction) {
var _local3 = 0;
while (_local3 < word_obj.word.length) {
var _local2 = ((direction == "across") ? (k + _local3) : (k));
var _local1 = ((direction == "down") ? (j + _local3) : (j));
if (direction == "across") {
var nei0 = this.crossword_grid[_local1 - 1][_local2];
var nei1 = this.crossword_grid[_local1 + 1][_local2];
var end = this.crossword_grid[_local1][_local2 + 1];
} else {
var nei0 = this.crossword_grid[_local1][_local2 - 1];
var nei1 = this.crossword_grid[_local1][_local2 + 1];
var end = this.crossword_grid[_local1 + 1][_local2];
}
var word_letter = word_obj.word.charAt(_local3);
var grid_letter = this.crossword_grid[_local1][_local2].letter;
if ((word_letter != grid_letter) && (grid_letter != "")) {
return(false);
}
var nei0_empty = (nei0.letter == "");
var nei1_empty = (nei1.letter == "");
var nei0_undef = (nei0.letter == undefined);
var nei1_undef = (nei1.letter == undefined);
if (((grid_letter == "") && (((!nei0_empty) && (!nei0_undef)) || ((!nei1_empty) && (!nei1_undef)))) || ((_local3 == (word_obj.word.length - 1)) && (end.letter != ""))) {
return(false);
}
_local3++;
}
return(true);
};
CrosswordGame.prototype.render_crossword_grid = function () {
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local1 = 0;
while (_local1 < this.num_columns) {
var _local2 = this.crossword_grid[_local3][_local1];
if (_local2.letter != "") {
this.render_crossword_cell(_local2, _local3, _local1);
}
_local1++;
}
_local3++;
}
};
CrosswordGame.prototype.render_crossword_cell = function (cell, j, k) {
var _local1 = this;
var _local3 = _local1.attachMovie("cell_shadow", "shadow" + _local1.depth, _local1.depth++);
var _local2 = _local1.attachMovie("board_cell", "cell" + _local1.depth, _local1.depth++);
_local1.crossword_grid[j][k]._mc = _local2;
_local2._x = _local1.board_mc._x + (k * _local1.cell_width);
_local2._y = _local1.board_mc._y + (j * _local1.cell_height);
_local2._width = _local1.cell_width;
_local2._height = _local1.cell_height;
if (_local1.game_type == "Regular") {
_local2.index.text = cell.index;
}
_local2.j = j;
_local2.k = k;
_local3._x = _local2._x + _local1.shadow_offset_x;
_local3._y = _local2._y + _local1.shadow_offset_y;
_local3._alpha = _local1.shadow_alpha;
_local3._width = _local2._width;
_local3._height = _local2._height;
_local2.onPress = function () {
var _local1 = this;
_local1._parent.find_closest_word(_local1.j, _local1.k);
};
};
CrosswordGame.prototype.find_closest_word = function (j, k) {
var _local3 = this;
var cell = _local3.crossword_grid[j][k];
if (cell.through_directions.hasElement("across")) {
var direction = "across";
} else {
var direction = "down";
}
var _local2 = cell.k;
var _local1 = cell.j;
while ((_local3.crossword_grid[_local1][_local2].letter != "") && (_local3.crossword_grid[_local1][_local2] != undefined)) {
if (direction == "across") {
_local2--;
} else {
_local1--;
}
}
if (direction == "across") {
_local2++;
} else {
_local1++;
}
if ((j == _local3.cursor_y) && (k == _local3.cursor_x)) {
_local3.shift_selection();
} else {
_local3.cursor_x = k;
_local3.cursor_y = j;
_local3.set_selection(_local1, _local2, direction);
}
};
CrosswordGame.prototype.get_empty_crossword_grid = function () {
var grid = new Array();
var j = 0;
while (j < this.num_rows) {
grid[j] = [];
var k = 0;
while (k < this.num_columns) {
grid[j][k] = {letter:"", display_letter:"", index:"", first_letter:false, word_directions:[], through_directions:[], words_using_letter:[], j:j, k:k};
k++;
}
j++;
}
return(grid);
};
CrosswordGame.prototype.filter_words_exact_length = function (words, length) {
var _local2 = words;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
if ((_local2[_local1].word.length == length) && (!_local2[_local1].used)) {
_local3.push(_local2[_local1]);
}
_local1++;
}
return(_local3);
};
CrosswordGame.prototype.filter_words_lesser_length = function (words, length) {
var _local2 = words;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
if ((_local2[_local1].word.length <= length) && (!_local2[_local1].used)) {
_local3.push(_local2[_local1]);
}
_local1++;
}
return(_local3);
};
CrosswordGame.prototype.filter_words_greater_length = function (words, length) {
var _local2 = words;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
if ((_local2[_local1].word.length >= length) && (!_local2[_local1].used)) {
_local3.push(_local2[_local1]);
}
_local1++;
}
return(_local3);
};
CrosswordGame.prototype.filter_words_lesser_greater_length = function (words, low, high) {
var _local2 = words;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
if (((_local2[_local1].word.length >= low) && (_local2[_local1].word.length <= high)) && (!_local2[_local1].used)) {
_local3.push(_local2[_local1]);
}
_local1++;
}
return(_local3);
};
CrosswordGame.prototype.filter_words_containing_letter_before_pivot = function (words, letter, pivot) {
var _local3 = words;
var list = new Array();
var _local2 = 0;
while (_local2 < _local3.length) {
var _local1 = 0;
while (_local1 <= pivot) {
if ((_local3[_local2].word.charAt(_local1) == letter) && (!_local3[_local2].used)) {
list.push(_local3[_local2]);
}
_local1++;
}
_local2++;
}
return(list);
};
CrosswordGame.prototype.filter_words_containing_letter_at = function (words, letter, pivot) {
var _local2 = words;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
if ((_local2[_local1].word.indexOf(letter) == pivot) && (!_local2[_local1].used)) {
_local3.push(_local2[_local1]);
}
_local1++;
}
return(_local3);
};
CrosswordGame.prototype.get_longest_word_of = function (list) {
var _local2 = list;
var _local3 = 0;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local3].word.length <= _local2[_local1].word.length) {
_local3 = _local1;
}
_local1++;
}
return(_local2[_local3]);
};
CrosswordGame.prototype.move_cursor = function (incx, incy) {
var _local1 = this;
var next_cell = _local1.crossword_grid[_local1.cursor_y + incy][_local1.cursor_x + incx];
if ((next_cell.letter != "") && (next_cell != undefined)) {
_local1.prev_cursor_x = _local1.cursor_x;
_local1.prev_cursor_y = _local1.cursor_y;
_local1.cursor_x = _local1.cursor_x + incx;
_local1.cursor_y = _local1.cursor_y + incy;
var cell = _local1.crossword_grid[_local1.cursor_y][_local1.cursor_x];
if (Math.abs(_local1.prev_cursor_x - _local1.cursor_x) == 0) {
var direction = "down";
} else {
var direction = "across";
}
var _local3 = cell.k;
var _local2 = cell.j;
while ((_local1.crossword_grid[_local2][_local3].letter != "") && (_local1.crossword_grid[_local2][_local3] != undefined)) {
if (direction == "across") {
_local3--;
} else {
_local2--;
}
}
if (direction == "across") {
_local3++;
} else {
_local2++;
}
_local1.set_selection(_local2, _local3, direction);
_local1.render_selection();
}
};
CrosswordGame.prototype.set_selection = function (j, k, direction) {
var _local3 = this;
var _local2 = 0;
while (_local2 < _local3.num_rows) {
var _local1 = 0;
while (_local1 < _local3.num_columns) {
_local3.crossword_grid[_local2][_local1].selected = false;
_local1++;
}
_local2++;
}
_local3.crossword_grid[j][k].selected = true;
_local3.crossword_grid[j][k].selected_direction = direction;
_local3.selected_x = k;
_local3.selected_y = j;
_local3.render_selection();
};
CrosswordGame.prototype.shift_selection = function () {
var _local1 = this;
var cell = _local1.crossword_grid[_local1.cursor_y][_local1.cursor_x];
if (Math.abs(_local1.prev_cursor_x - _local1.cursor_x) == 0) {
var direction = "down";
} else {
var direction = "across";
}
if ((_local1.cursor_x == _local1.prev_cursor_x) && (_local1.cursor_y == _local1.prev_cursor_y)) {
var direction = ((_local1.prev_direction == "down") ? "across" : "down");
}
_local1.prev_direction = direction;
if (direction == "down") {
_local1.prev_cursor_x = ((_local1.cursor_x + (_local1.cursor_x == 0)) ? 1 : (((_local1.cursor_x == (_local1.num_columns - 1)) ? -1 : 1)));
_local1.prev_cursor_y = _local1.cursor_y;
} else {
_local1.prev_cursor_x = _local1.cursor_x;
_local1.prev_cursor_y = ((_local1.cursor_y + (_local1.cursor_y == 0)) ? 1 : (((_local1.cursor_y == (_local1.num_rows - 1)) ? -1 : 1)));
}
var _local3 = cell.k;
var _local2 = cell.j;
while ((_local1.crossword_grid[_local2][_local3].letter != "") && (_local1.crossword_grid[_local2][_local3] != undefined)) {
if (direction == "across") {
_local3--;
} else {
_local2--;
}
}
if (direction == "across") {
_local3++;
} else {
_local2++;
}
var old_dir = _local1.crossword_grid[_local2][_local3].selected_direction;
var new_dir = ((old_dir == "across") ? "down" : "across");
var adjacents = _local1.get_list_cardinal_adjacent_cells(_local1.cursor_y, _local1.cursor_x);
if ((adjacents.length >= 3) || (((adjacents.length == 2) && (Math.abs(adjacents[0].j - adjacents[1].j) == 1)) && (Math.abs(adjacents[0].k - adjacents[1].k)))) {
_local3 = cell.k;
_local2 = cell.j;
while ((_local1.crossword_grid[_local2][_local3].letter != "") && (_local1.crossword_grid[_local2][_local3] != undefined)) {
if (new_dir == "across") {
_local3--;
} else {
_local2--;
}
}
if (new_dir == "across") {
_local3++;
} else {
_local2++;
}
_local1.set_selection(_local2, _local3, new_dir);
}
_local1.render_selection();
};
CrosswordGame.prototype.key_letter = function (keystroke_direction) {
var _local1 = this;
var char = String.fromCharCode(Key.getAscii()).toUpperCase();
var cell = _local1.crossword_grid[_local1.cursor_y][_local1.cursor_x];
_local1.crossword_grid[_local1.cursor_y][_local1.cursor_x].display_letter = char;
if (Math.abs(_local1.prev_cursor_x - _local1.cursor_x) == 0) {
var direction = "down";
} else {
var direction = "across";
}
if ((_local1.cursor_x == _local1.prev_cursor_x) && (_local1.cursor_y == _local1.prev_cursor_y)) {
var direction = ((_local1.prev_direction == "down") ? "across" : "down");
}
var _local3 = cell.k;
var _local2 = cell.j;
while ((_local1.crossword_grid[_local2][_local3].letter != "") && (_local1.crossword_grid[_local2][_local3] != undefined)) {
if (direction == "across") {
_local3--;
} else {
_local2--;
}
}
if (direction == "across") {
_local3++;
} else {
_local2++;
}
var first_cell = _local1.crossword_grid[_local2][_local3];
if (first_cell.selected_direction == "across") {
_local1.move_cursor(keystroke_direction, 0);
} else {
_local1.move_cursor(0, keystroke_direction);
}
_local1.render_selection();
_local1.play_sounds();
_local1.check_game_over();
};
CrosswordGame.prototype.check_game_over = function () {
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
var _local1 = this.crossword_grid[_local3][_local2];
if (_local1._mc._visible && (_local1.letter != _local1.display_letter)) {
return;
}
_local2++;
}
_local3++;
}
this._parent.gotoAndStop("Win");
};
CrosswordGame.prototype.solve_puzzle = function () {
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local1 = 0;
while (_local1 < this.num_columns) {
var _local2 = this.crossword_grid[_local3][_local1];
_local2.display_letter = _local2.letter;
_local1++;
}
_local3++;
}
this.render_selection();
};
CrosswordGame.prototype.play_sounds = function () {
var _local1 = this;
_local1.old_num_correct_words = _local1.num_correct_words;
_local1.num_correct_words = _local1.calculate_num_correct_words();
if (_local1.old_num_correct_words > _local1.num_correct_words) {
_local1.play_sound(_local1.incorrect_sounds.rande());
}
if (_local1.old_num_correct_words < _local1.num_correct_words) {
_local1.play_sound(_local1.correct_sounds.rande());
}
};
CrosswordGame.prototype.play_sound = function (linkage) {
var _local1 = new Sound();
_local1.attachSound(linkage);
_local1.start(0, 1);
};
CrosswordGame.prototype.calculate_num_correct_words = function () {
var _local1 = this;
var num = 0;
var j = 0;
while (j < Math.max(_local1.across_cells.length, _local1.down_cells.length)) {
var _local3 = _local1.across_cells[j];
var _local2 = _local1.down_cells[j];
var aselected_word = "";
var abuilt_word = "";
var aword_cells = [];
var dselected_word = "";
var dbuilt_word = "";
var dword_cells = [];
var n = 0;
while ((_local1.crossword_grid[_local3.j][_local3.k + n].letter != "") && (_local1.crossword_grid[_local3.j][_local3.k + n] != undefined)) {
aselected_word = aselected_word + _local1.crossword_grid[_local3.j][_local3.k + n].letter;
abuilt_word = abuilt_word + _local1.crossword_grid[_local3.j][_local3.k + n].display_letter;
aword_cells.push(_local1.crossword_grid[_local3.j][_local3.k + n]);
n++;
}
if (aselected_word == abuilt_word) {
num++;
}
var n = 0;
while ((_local1.crossword_grid[_local2.j + n][_local2.k].letter != "") && (_local1.crossword_grid[_local2.j + n][_local2.k] != undefined)) {
dselected_word = dselected_word + _local1.crossword_grid[_local2.j + n][_local2.k].letter;
dbuilt_word = dbuilt_word + _local1.crossword_grid[_local2.j + n][_local2.k].display_letter;
dword_cells.push(_local1.crossword_grid[_local2.j + n][_local2.k]);
n++;
}
if (dselected_word == dbuilt_word) {
num++;
}
j++;
}
return(num);
};
#endinitclip
Instance of Symbol 86 MovieClip in Symbol 107 MovieClip [CrosswordGameSymbol] Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (mouseDown) {
this._parent.mouse_down();
}
onClipEvent (keyDown) {
if (Key.isDown(38)) {
this._parent.move_cursor(0, -1);
} else if (Key.isDown(40)) {
this._parent.move_cursor(0, 1);
} else if (Key.isDown(39)) {
this._parent.move_cursor(1, 0);
} else if (Key.isDown(37)) {
this._parent.move_cursor(-1, 0);
} else if (Key.isDown(16)) {
this._parent.shift_selection();
} else if ((((Key.getAscii() >= 97) && (Key.getAscii() <= 122)) || ((Key.getAscii() >= 65) && (Key.getAscii() <= 90))) || (Key.isDown(32))) {
this._parent.key_letter(1);
} else if (Key.isDown(8)) {
this._parent.key_letter(-1);
}
}
Instance of Symbol 83 MovieClip [ScrollbarComponentES] "across_vertical" in Symbol 107 MovieClip [CrosswordGameSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
text = "";
use_html = "True";
scroll_target = "content";
content_type = "Textfield";
orientation = "Vertical";
mask_type = "Automatic";
mask_width = 200;
mask_height = 200;
scrollbar_style = "Track and Buttons";
skins = "Custom";
scroll_up_skin = "scroll_up";
scroll_down_skin = "scroll_down";
track_skin = "track";
drag_skin = "drag";
use_hand_cursor = "False";
continuous_scroll_delay = 500;
easing_factor = 3;
easing_factor_val = 1;
continuous_scroll_delay_val = 500;
use_hand_cursor_val = false;
drag_skin_val = "drag";
track_skin_val = "track";
scroll_down_skin_val = "scroll_down";
scroll_up_skin_val = "scroll_up";
scrollbar_style_val = "Track and Buttons";
skins_val = "Green";
mask_height_val = 175;
mask_width_val = 156.9;
orientation_val = "Vertical";
mask_type_val = "Automatic";
content_type_val = "MovieClip";
scroll_target_val = "across_list";
use_html_val = true;
}
Instance of Symbol 83 MovieClip [ScrollbarComponentES] "down_vertical" in Symbol 107 MovieClip [CrosswordGameSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
text = "";
use_html = "True";
scroll_target = "content";
content_type = "Textfield";
orientation = "Vertical";
mask_type = "Automatic";
mask_width = 200;
mask_height = 200;
scrollbar_style = "Track and Buttons";
skins = "Custom";
scroll_up_skin = "scroll_up";
scroll_down_skin = "scroll_down";
track_skin = "track";
drag_skin = "drag";
use_hand_cursor = "False";
continuous_scroll_delay = 500;
easing_factor = 3;
easing_factor_val = 1;
continuous_scroll_delay_val = 500;
use_hand_cursor_val = false;
drag_skin_val = "drag";
track_skin_val = "track";
scroll_down_skin_val = "scroll_down";
scroll_up_skin_val = "scroll_up";
scrollbar_style_val = "Track and Buttons";
skins_val = "Green";
mask_height_val = 175;
mask_width_val = 156.9;
orientation_val = "Vertical";
mask_type_val = "Automatic";
content_type_val = "MovieClip";
scroll_target_val = "down_list";
use_html_val = true;
}
Instance of Symbol 83 MovieClip [ScrollbarComponentES] "across_horizontal" in Symbol 107 MovieClip [CrosswordGameSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
text = "";
use_html = "True";
scroll_target = "content";
content_type = "Textfield";
orientation = "Vertical";
mask_type = "Automatic";
mask_width = 200;
mask_height = 200;
scrollbar_style = "Track and Buttons";
skins = "Custom";
scroll_up_skin = "scroll_up";
scroll_down_skin = "scroll_down";
track_skin = "track";
drag_skin = "drag";
use_hand_cursor = "False";
continuous_scroll_delay = 500;
easing_factor = 3;
easing_factor_val = 1;
continuous_scroll_delay_val = 500;
use_hand_cursor_val = false;
drag_skin_val = "drag";
track_skin_val = "track";
scroll_down_skin_val = "scroll_down";
scroll_up_skin_val = "scroll_up";
scrollbar_style_val = "Track and Buttons";
skins_val = "Green";
mask_height_val = 175;
mask_width_val = 156.9;
orientation_val = "Horizontal";
mask_type_val = "Automatic";
content_type_val = "MovieClip";
scroll_target_val = "across_list";
use_html_val = true;
}
onClipEvent (load) {
this._visible = this._parent.horizontal_scrolling;
}
Instance of Symbol 83 MovieClip [ScrollbarComponentES] "down_horizontal" in Symbol 107 MovieClip [CrosswordGameSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
text = "";
use_html = "True";
scroll_target = "content";
content_type = "Textfield";
orientation = "Vertical";
mask_type = "Automatic";
mask_width = 200;
mask_height = 200;
scrollbar_style = "Track and Buttons";
skins = "Custom";
scroll_up_skin = "scroll_up";
scroll_down_skin = "scroll_down";
track_skin = "track";
drag_skin = "drag";
use_hand_cursor = "False";
continuous_scroll_delay = 500;
easing_factor = 3;
easing_factor_val = 1;
continuous_scroll_delay_val = 500;
use_hand_cursor_val = false;
drag_skin_val = "drag";
track_skin_val = "track";
scroll_down_skin_val = "scroll_down";
scroll_up_skin_val = "scroll_up";
scrollbar_style_val = "Track and Buttons";
skins_val = "Green";
mask_height_val = 175;
mask_width_val = 156.9;
orientation_val = "Horizontal";
mask_type_val = "Automatic";
content_type_val = "MovieClip";
scroll_target_val = "down_list";
use_html_val = true;
}
onClipEvent (load) {
this._visible = this._parent.horizontal_scrolling;
}
Symbol 122 MovieClip Frame 1
stop();
Instance of Symbol 121 MovieClip "swfloader" in Symbol 122 MovieClip Frame 1
onClipEvent (load) {
function strip_spaces(str) {
var _local2 = str;
var _local3 = new String("");
var _local1 = 0;
while (_local1 < _local2.length) {
if ((_local2.charAt(_local1) != " ") && (_local2.charAt(_local1) != ";")) {
_local3 = _local3 + _local2.charAt(_local1);
}
_local1++;
}
return(_local3);
}
function simple_script(action, timeline) {
action = strip_spaces(action);
if ((action.length > 0) && ((action.indexOf(")") != -1) && (action.indexOf("(") != -1))) {
var _local3 = action.split(".");
var timeline_action = _local3.pop();
var first_paren = timeline_action.indexOf("(");
var second_paren = timeline_action.indexOf(")");
var timeline_function = timeline_action.substr(0, first_paren);
var function_parameter = timeline_action.substr(first_paren + 1, second_paren - (first_paren + 1));
var _local2 = timeline;
var _local1 = 0;
while (_local1 < _local3.length) {
_local2 = _local2[_local3[_local1]];
_local1++;
}
if (function_parameter.indexOf("\"") != -1) {
function_parameter = function_parameter.substr(1, function_parameter.length - 2);
}
_local2[timeline_function](function_parameter);
}
}
function execute_action() {
var _local1 = _parent;
unloaded = true;
_local1._visible = false;
simple_script(_local1.play_action_val, _local1);
}
_parent.anim.gotoAndStop(1);
simple_script(_parent.init_action_val, _parent);
var done = false;
var unloaded = false;
var orig_x = _parent._x;
var orig_y = _parent._y;
var dist_x = (_parent._x + ((_parent._width * 2) / 3));
var dist_y = (_parent._y + ((_parent._height * 2) / 3));
var orig_a = _parent._alpha;
var accel_jump = 0.75;
var slow_factor = _parent.slow_factor_val;
var speed_factor = (1 + (slow_factor / (1 - slow_factor)));
var ready = false;
var perc_fadeout = 0;
_parent.perc._x = _parent.anim._x - (_parent.perc._width / 2);
_parent.perc._y = _parent.anim._y - (_parent.perc._height / 2);
if (slow_factor < 1) {
switch (_parent.xin_motion_val) {
case "Up" :
_parent._y = orig_y + (dist_y * 2);
break;
case "Down" :
_parent._y = orig_y - (dist_y * 2);
break;
case "Left" :
_parent._x = orig_x + (dist_x * 2);
break;
case "Right" :
_parent._x = orig_x - (dist_x * 2);
break;
case "Toward" :
_parent._xscale = (_parent._yscale = 1);
break;
case "None" :
_parent._alpha = 0;
}
} else {
ready = true;
}
}
onClipEvent (enterFrame) {
if (unloaded) {
return(undefined);
}
if (!ready) {
switch (_parent.xin_motion_val) {
case "Toward" :
_parent._xscale = _parent._xscale + ((100 - _parent._xscale) * slow_factor);
_parent._yscale = _parent._xscale;
if (_parent.xin_alphatype_val == "Yes") {
_parent._alpha = Math.round((orig_a / 100) * Math.max(0, Math.min(_parent._xscale, 100)));
}
if (Math.abs(100 - _parent._xscale) < 0.5) {
_parent._xscale = (_parent._yscale = 100);
_parent._alpha = orig_a;
ready = true;
}
break;
default :
_parent._x = _parent._x + ((orig_x - _parent._x) * slow_factor);
_parent._y = _parent._y + ((orig_y - _parent._y) * slow_factor);
if (_parent.xin_alphatype_val == "Yes") {
if (_parent.xin_motion_val == "None") {
_parent._alpha = _parent._alpha + ((orig_a - _parent._alpha) * slow_factor);
} else if (Math.abs(orig_x - _parent._x) > Math.abs(orig_y - _parent._y)) {
_parent._alpha = 100 - Math.round(((orig_a / 100) * (Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x)) * 100);
} else {
_parent._alpha = 100 - Math.round(((orig_a / 100) * (Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y)) * 100);
}
}
if (!(((_parent.xin_motion_val == "None") && (Math.abs(_parent._alpha - orig_a) <= 1)) || (((_parent.xin_motion_val != "None") && (Math.abs(_parent._y - orig_y) < 0.5)) && (Math.abs(_parent._x - orig_x) < 0.5)))) {
break;
}
_parent._x = orig_x;
_parent._y = orig_y;
_parent._alpha = orig_a;
ready = true;
}
} else if (!done) {
var rl = _root.getBytesLoaded();
var rt = (_root.getBytesTotal() * (_parent.perc_req_val / 100));
if ((rl > 10) && (rt > 10)) {
rl = Math.min(rl, rt);
var new_frame = (_parent.anim._currentframe + Math.ceil(((_parent.anim._totalframes * (rl / rt)) - _parent.anim._currentframe) / 4));
new_frame = Math.max(1, new_frame);
if (_parent.show_perc_val == "Yes") {
_parent.perc.text = Math.round(((new_frame - 1) / (_parent.anim._totalframes - 1)) * 100) + " %";
}
if (new_frame != _parent.anim._currentframe) {
_parent.anim.gotoAndStop(new_frame);
}
if ((_parent.anim._totalframes == _parent.anim._currentframe) && (rl >= rt)) {
done = true;
}
}
} else if (slow_factor < 1) {
switch (_parent.xout_motion_val) {
case "Down" :
if (_parent._y <= orig_y) {
_parent._y = orig_y + accel_jump;
}
_parent._y = orig_y + (Math.abs(_parent._y - orig_y) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y) * 100);
if (_parent._y > (orig_y + (dist_y * 2))) {
execute_action();
}
break;
case "Up" :
if (_parent._y >= orig_y) {
_parent._y = orig_y - accel_jump;
}
_parent._y = orig_y - (Math.abs(_parent._y - orig_y) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y) * 100);
if (_parent._y < (orig_y - (dist_y * 2))) {
execute_action();
}
break;
case "Right" :
if (_parent._x <= orig_x) {
_parent._x = orig_x + accel_jump;
}
_parent._x = orig_x + (Math.abs(_parent._x - orig_x) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x) * 100);
if (_parent._x > (orig_x + (dist_x * 2))) {
execute_action();
}
break;
case "Left" :
if (_parent._x >= orig_x) {
_parent._x = orig_x - accel_jump;
}
_parent._x = orig_x - (Math.abs(_parent._x - orig_x) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x) * 100);
if (_parent._x < (orig_x - (dist_x * 2))) {
execute_action();
}
break;
case "Away" :
if ((_parent._xscale >= 100) || (_parent._yscale >= 100)) {
_parent._xscale = (_parent._yscale = 100 - accel_jump);
}
_parent._xscale = (_parent._yscale = Math.max(0.5, 100 - ((100 - _parent._yscale) * speed_factor)));
perc_fadeout = 100 - Math.round(Math.max(0, Math.min(_parent._xscale, 100)));
if (_parent._xscale < 1) {
execute_action();
}
break;
default :
perc_fadeout = perc_fadeout + ((100 - perc_fadeout) * slow_factor);
if (Math.abs(perc_fadeout - 100) > 1) {
break;
}
execute_action();
}
if (!(_parent.xout_alphatype_val === "Yes")) {
} else {
_parent._alpha = (orig_a / 100) * (100 - perc_fadeout);
}
} else {
execute_action();
}
}
Symbol 130 MovieClip Frame 1
_parent.stop();
Symbol 130 MovieClip Frame 65
stop();
_parent.play();
Symbol 140 Button
on (press) {
this.gotoAndStop("Game");
}
Symbol 147 Button
on (release) {
getURL ("http://www.urgames.com", "_self");
}
Symbol 151 Button
on (release) {
getURL ("http://www.gamesforyourwebsite.com", "_self");
}
Symbol 155 Button
on (release) {
getURL ("http://www.urgames.com/forums", "_self");
}
Symbol 159 Button
on (release) {
getURL ("http://www.urgames.com/cheats", "_self");
}
Symbol 171 Button
on (press) {
this.gotoAndStop("Starting Screen");
}