⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asflippage.as

📁 很方便实用的一个相册源码
💻 AS
📖 第 1 页 / 共 5 页
字号:
                moveTo(_parent.point_xy_arry[0].x, _parent.point_xy_arry[0].y);
                lineTo(_parent.point_xy_arry[1].x, _parent.point_xy_arry[1].y);
                lineTo(_parent.point_xy_arry[2].x, _parent.point_xy_arry[2].y);
                lineTo(_parent.point_xy_arry[3].x, _parent.point_xy_arry[3].y);
                lineTo(_parent.point_xy_arry[0].x, _parent.point_xy_arry[0].y);
                endFill();
            }
            flip_mc.setMask(triangle);
        }
        function drawMask2_fun() {
            this.createEmptyMovieClip("next_triangle", 201);
            with (next_triangle) {
                beginFill(16777215, 100);
                moveTo(_parent.point_xy_arry[1].x, _parent.point_xy_arry[1].y);
                if ((_parent.drag_area == 1) or (_parent.drag_area == 3)) {
                    lineTo(_parent.pfx, _parent.pfy);
                    lineTo(_parent.pex, _parent.pey);
                } else if ((_parent.drag_area == 2) or (_parent.drag_area == 4)) {
                    lineTo(_parent.pbx, _parent.pby);
                    lineTo(_parent.pax, _parent.pay);
                }
                lineTo(_parent.point_xy_arry[2].x, _parent.point_xy_arry[2].y);
                lineTo(_parent.point_xy_arry[1].x, _parent.point_xy_arry[1].y);
                endFill();
            }
            next_mc.setMask(next_triangle);
        }
        function drawMask3_fun() {
            this.createEmptyMovieClip("on_triangle", 101);
            with (on_triangle) {
                beginFill(16777215, 100);
                if ((!_parent.flip_end) or _parent.CueHitArea_ing) {
                    moveTo(_parent.point_xy_arry[1].x, _parent.point_xy_arry[1].y);
                    if (_parent.drag_area == 1) {
                        lineTo(_parent.pbx, _parent.pby);
                        lineTo(_parent.pax, _parent.pay);
                        if (_parent.point_xy_arry[2].y > _parent.pcy) {
                            lineTo(_parent.pex, _parent.pey);
                            lineTo(_parent.point_xy_arry[2].x, _parent.point_xy_arry[2].y);
                        } else {
                            lineTo(_parent.point_xy_arry[2].x, _parent.point_xy_arry[2].y);
                         }
                    } else if (_parent.drag_area == 3) {
                        if (_parent.point_xy_arry[1].y < _parent.pdy) {
                            lineTo(_parent.pfx, _parent.pfy);
                        }
                        lineTo(_parent.pbx, _parent.pby);
                        lineTo(_parent.pax, _parent.pay);
                        lineTo(_parent.point_xy_arry[2].x, _parent.point_xy_arry[2].y);
                    } else if (_parent.drag_area == 2) {
                        lineTo(_parent.pfx, _parent.pfy);
                        lineTo(_parent.pex, _parent.pey);
                        if (_parent.point_xy_arry[2].y > _parent.pcy) {
                            lineTo(_parent.pax, _parent.pay);
                            lineTo(_parent.point_xy_arry[2].x, _parent.point_xy_arry[2].y);
                        } else {
                            lineTo(_parent.point_xy_arry[2].x, _parent.point_xy_arry[2].y);
                         }
                    } else if (_parent.drag_area == 4) {
                        if (_parent.point_xy_arry[1].y < _parent.pdy) {
                            lineTo(_parent.pbx, _parent.pby);
                        }
                        lineTo(_parent.pfx, _parent.pfy);
                        lineTo(_parent.pex, _parent.pey);
                        lineTo(_parent.point_xy_arry[2].x, _parent.point_xy_arry[2].y);
                    }
                    lineTo(_parent.point_xy_arry[1].x, _parent.point_xy_arry[1].y);
                    endFill();
                } else {
                    moveTo(_parent.pax, _parent.pay);
                    lineTo(_parent.pex, _parent.pey);
                    lineTo(_parent.pfx, _parent.pfy);
                    lineTo(_parent.pbx, _parent.pby);
                    lineTo(_parent.pax, _parent.pay);
                    endFill();
                 }
            }
            on_mc.setMask(on_triangle);
            if (CueHitArea_ing) {
                return (undefined);
            }
        }
        function set_flip_mc_fun() {
            var _local4 = getAngle(point_xy_arry[0].x, point_xy_arry[0].y, point_xy_arry[3].x, point_xy_arry[3].y);
            flip_mc._rotation = _local4 + 90;
            var _local2 = getDist(pbx, pby, pcx, pcy);
            if (drag_area == 1) {
                var _local3 = getAngle(pbx, pby, pcx, pcy);
                flip_mc._x = point_xy_arry[0].x + (Math.cos(((flip_mc._rotation + _local3) * Math.PI) / 180) * _local2);
                flip_mc._y = point_xy_arry[0].y + (Math.sin(((flip_mc._rotation + _local3) * Math.PI) / 180) * _local2);
            } else if (drag_area == 2) {
                var _local3 = getAngle(pfx, pfy, pcx, pcy);
                flip_mc._x = point_xy_arry[0].x + (Math.cos(((flip_mc._rotation + _local3) * Math.PI) / 180) * _local2);
                flip_mc._y = point_xy_arry[0].y + (Math.sin(((flip_mc._rotation + _local3) * Math.PI) / 180) * _local2);
            } else if (drag_area == 3) {
                flip_mc._x = point_xy_arry[3].x + ((Math.cos((flip_mc._rotation * Math.PI) / 180) * stage_w) / 2);
                flip_mc._y = point_xy_arry[3].y + ((Math.sin((flip_mc._rotation * Math.PI) / 180) * stage_w) / 2);
            } else if (drag_area == 4) {
                flip_mc._x = point_xy_arry[3].x - ((Math.cos((flip_mc._rotation * Math.PI) / 180) * stage_w) / 2);
                flip_mc._y = point_xy_arry[3].y - ((Math.sin((flip_mc._rotation * Math.PI) / 180) * stage_w) / 2);
            }
        }
        function onMouseDown() {
            Stage.showMenu = true;
            if ((!flip_ing) and flip_end) {
                if (if_out_page_area_fun()) {
                    var _local3;
                    var _local4;
                    var _local2;
                    if ((_xmouse > (pfx - hit_area_object.RightBottomWidth)) and (_ymouse > (pfy - hit_area_object.RightBottomHigh))) {
                        _local2 = 1;
                        _local3 = pfx;
                        _local4 = pfy;
                    } else if ((_xmouse < (pbx + hit_area_object.LiftBottomWidth)) and (_ymouse > (pby - hit_area_object.LiftBottomHigh))) {
                        _local2 = 2;
                        _local3 = pbx;
                        _local4 = pby;
                    } else if ((_xmouse > (pex - hit_area_object.RightTopWidth)) and (_ymouse < (pey + hit_area_object.RightTopHigh))) {
                        _local2 = 3;
                        _local3 = pex;
                        _local4 = pey;
                    } else if ((_xmouse < (pax + hit_area_object.LiftTopWidth)) and (_ymouse < (pay + hit_area_object.LiftTopHigh))) {
                        _local2 = 4;
                        _local3 = pax;
                        _local4 = pay;
                    } else {
                        _local2 = 0;
                     }
                    if ((((_local2 == 1) or (_local2 == 3)) and (on_page_v < all_page_v)) or (((_local2 == 2) or (_local2 == 4)) and (on_page_v > 1))) {
                        drag_area = _local2;
                        OnStartFlip();
                        clearInterval(stop_time_si);
                        if (FlipOnRelease_b) {
                            press_xmouse = _xmouse;
                            press_ymouse = _ymouse;
                        }
                        if (CueHitArea) {
                            point_xy_arry[0].x = (tem_array[0].x = _xmouse);
                            point_xy_arry[0].y = (tem_array[0].y = _ymouse);
                        } else {
                            point_xy_arry[0].x = (tem_array[0].x = _local3);
                            point_xy_arry[0].y = (tem_array[0].y = _local4);
                         }
                        if (CueHitArea_ing) {
                            CueHitArea_ing = false;
                            OnFinishCueHitAreaing();
                        }
                        flip_ing = true;
                        flip_end = false;
                        on_mc._visible = true;
                        this.attachMovie(book_mc, "flip_mc", 300);
                        this.attachMovie(book_mc, "next_mc", 200);
                        next_mc._x = pcx;
                        next_mc._y = pcy;
                        if ((drag_area == 1) or (drag_area == 3)) {
                            next_mc.gotoAndStop(on_page_v + 1);
                            flip_mc.gotoAndStop(on_page_v + 1);
                        } else if ((drag_area == 2) or (drag_area == 4)) {
                            next_mc.gotoAndStop(on_page_v - 1);
                            flip_mc.gotoAndStop(on_page_v - 1);
                        }
                        onEnterFrame = onMouseMove_filp_fun;
                        onMouseMove_filp_fun();
                    }
                }
            }
        }
        function press_filp_fun() {
            if (FlipOnRelease_b) {
                var _local2 = 8;
                if (Math.sqrt(Math.pow(press_xmouse - _xmouse, 2) + Math.pow(press_ymouse - _ymouse, 2)) <= _local2) {
                    return (true);
                } else {
                    return (false);
                 }
            } else {
                return (false);
             }
        }
        function onMouseUp() {
            if (flip_ing) {
                flip_ing = false;
                flip_end = false;
                if (drag_area == 1) {
                    if ((point_xy_arry[0].x < pcx) or press_filp_fun()) {
                        flip_win = true;
                        aim_x = pbx;
                        aim_y = pby;
                        filp_sound_fun();
                        onEnterFrame = function () {
                            this.point_xy_arry[0].x = this.point_xy_arry[0].x + ((this.aim_x - this.point_xy_arry[0].x) / (1 + this.flip_speed));
                            this.point_xy_arry[0].y = this.point_xy_arry[0].y + ((this.aim_y - this.point_xy_arry[0].y) / (1 + this.flip_speed));
                            this.flip_ing_fun();
                            if (Math.sqrt(Math.pow(this.point_xy_arry[0].x - this.aim_x, 2) + Math.pow(this.point_xy_arry[0].y - this.aim_y, 2)) <= this.end_filp_distance_v) {
                                this.show_next_page_fun();
                            }
                        };
                    } else {
                        flip_win = false;
                        aim_x = pfx;
                        aim_y = pfy;
                        filp_sound_fun();
                        onEnterFrame = function () {
                            this.point_xy_arry[0].x = this.point_xy_arry[0].x + ((this.aim_x - this.point_xy_arry[0].x) / (1 + this.flip_speed));
                            this.point_xy_arry[0].y = this.point_xy_arry[0].y + ((this.aim_y - this.point_xy_arry[0].y) / (1 + this.flip_speed));
                            this.flip_ing_fun();
                            if (Math.sqrt(Math.pow(this.point_xy_arry[0].x - this.aim_x, 2) + Math.pow(this.point_xy_arry[0].y - this.aim_y, 2)) <= this.end_filp_distance_v) {
                                this.no_flip_page_fun();
                            }
                        };
                     }
                } else if (drag_area == 3) {
                    if ((point_xy_arry[3].x < pcx) or press_filp_fun()) {
                        flip_win = true;
                        aim_x = pax;
                        aim_y = pay;
                        filp_sound_fun();
                        onEnterFrame = function () {
                            this.tem_array[0].x = this.tem_array[0].x + ((this.aim_x - this.tem_array[0].x) / (1 + this.flip_speed));
                            this.tem_array[0].y = this.tem_array[0].y + ((this.aim_y - this.tem_array[0].y) / (1 + this.flip_speed));
                            this.flip_ing_fun();
                            if (Math.sqrt(Math.pow(this.point_xy_arry[3].x - this.aim_x, 2) + Math.pow(this.point_xy_arry[3].y - this.aim_y, 2)) <= this.end_filp_distance_v) {
                                this.show_next_page_fun();
                            }
                        };
                    } else {
                        flip_win = false;
                        aim_x = pex;
                        aim_y = pey;
                        filp_sound_fun();
                        onEnterFrame = function () {
                            this.tem_array[0].x = this.tem_array[0].x + ((this.aim_x - this.tem_array[0].x) / (1 + this.flip_speed));
                            this.tem_array[0].y = this.tem_array[0].y + ((this.aim_y - this.tem_array[0].y) / (1 + this.flip_speed));
                            this.flip_ing_fun();
                            if (Math.sqrt(Math.pow(this.point_xy_arry[3].x - this.aim_x, 2) + Math.pow(this.point_xy_arry[3].y - this.aim_y, 2)) <= this.end_filp_distance_v) {
                                this.no_flip_page_fun();
                            }
                        };
                     }
                } else if (drag_area == 2) {
                    if ((point_xy_arry[0].x > pcx) or press_filp_fun()) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -