/** * @(#) $RCSfile: MouseEngineLookup.as,v $ $Revision: 1.5 $ $Date: 2003/03/19 14:43:28 $ * * Copyright 2003 Orgdot AS. All Rights Reserved. * http://dev.swfit.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * This script computes the total offset from _level0 to the clip we're in. * It looks for the variable mouse_x in level0 (see MouseEngineLoop.as). * It is (arbitrarily) set to stop searching at 20 levels so as not to run into * an infinite loop in case the movie is wrongly configured and there is no * mouse_x in level0. * * @author Olaf Havnes * @version $Revision: 1.5 $ $Date: 2003/03/19 14:43:28 $ * @since SWFIT1.0 */ /** * Roll up the offset up to _level0. */ parent_str = "../"; offset_x = 0; offset_y = 0; depth = 0; while (depth++ <20) { offset_x += getProperty ( parent_str, _x); offset_y += getProperty ( parent_str, _y); parent_str = parent_str add "../"; if (eval (parent_str add ":mouse_x") ne "") break; } /** * Output all the corrected mouse data that resides in _level0. This is * really superfluous, and just meant to be included as an example. */ mouse_x = /:mouse_x - offset_x; mouse_int_x = /:mouse_int_x - offset_x; delay_mouse_x = /:delay_mouse_x - offset_x; delay_mouse_int_x = /:delay_mouse_int_x - offset_x; clip_mouse_x = /:clip_mouse_x - offset_x; clip_mouse_int_x = /:clip_mouse_int_x - offset_x; delay_clip_mouse_x = /:delay_clip_mouse_x - offset_x; delay_clip_mouse_int_x = /:delay_clip_mouse_int_x - offset_x; rubber_mouse_x = /:rubber_mouse_x - offset_x; rubber_mouse_int_x = /:rubber_mouse_int_x - offset_x; mouse_y = /:mouse_y - offset_y; mouse_int_y = /:mouse_int_y - offset_y; delay_mouse_y = /:delay_mouse_y - offset_y; delay_mouse_int_y = /:delay_mouse_int_y - offset_y; clip_mouse_y = /:clip_mouse_y - offset_y; clip_mouse_int_y = /:clip_mouse_int_y - offset_y; delay_clip_mouse_y = /:delay_clip_mouse_y - offset_y; delay_clip_mouse_int_y = /:delay_clip_mouse_int_y - offset_y; rubber_mouse_y = /:rubber_mouse_y - offset_y; rubber_mouse_int_y = /:rubber_mouse_int_y - offset_y;