Make a button to control the effect of the picture buffering switch (with Blur filter)

Source: Internet
Author: User
Tags filter
Button | control | Filter a buffer image with the effect of switching, button control, add a blur filter, improve the sense of speed. The source file is attached. Here is the code:

Stop ();
Also name-_-,///////time of day November 18, 2006
var sz = 127;
var sd = 3;
var temp = 1;
tempt = temp;
T1 = "Button control buffering: Picture switching with buffering effect. ";
McX = mc._x;
Xfmc._visible = false;
if (temp = 1) {
Mcname = "luggage compartment";
}
Filter/////////////////////
Import flash.filters.*;
var mh:blurfilter = new Blurfilter (0, 0, 3);
Blur filter to increase the speed of the MC in order to make the buffer movement more sense.
a.onpress = function () {
LK ();
};
A.onrollover = function () {
Xfmchs ();
Xfmc.xftext = "Prev";
};
A.onrollout = function () {
Xfmc._visible = false;
};
b.onpress = function () {
RK ();
};
B.onrollover = function () {
Xfmchs ();
Xfmc.xftext = "Next";
};
B.onrollout = function () {
Xfmc._visible = false;
};
Ka.onrollover = function () {
Xfmchs ();
Xfmc.xftext = "the first one";
};
Ka.onrollout = function () {
Xfmc._visible = false;
};
Kb.onrollover = function () {
Xfmchs ();
Xfmc.xftext = "last One";
};
Kb.onrollout = function () {
Xfmc._visible = false;
};
Function lk () {
if (temp>1) {
McX + + sz;
temp--;
Oen ();
}
}
function rk () {
if (temp<7) {
McX-= SZ;
temp++;
Oen ();
}
}
ka.onpress = function () {
Kak ();
};
Function Kak () {
McX = 374.5;
temp = 1;
Oen ();
}
kb.onpress = function () {
KBK ();
};
function Kbk () {
McX =-387.3;
temp = 7;
Oen ();
}
function Xfmchs () {
Xfmc._visible = true;
Xfmc.onenterframe = function () {
Xfmc._x + = ((_xmouse+90)-xfmc._x)/sd;
Xfmc._y + = ((_ymouse+50)-xfmc._y)/sd;
};
}
function Oen () {
Mc.onenterframe = function () {
if (temp = 1) {
Mcname = "luggage compartment";
}
if (temp = 2) {
Mcname = "gear";
}
if (temp = 3) {
Mcname = "PDA";
}
if (temp = 4) {
Mcname = "Books/pens and CDs";
}
if (temp = 5) {
Mcname = "Calculator";
}
if (temp = 6) {
Mcname = "Compressed package";
}
if (temp = 7) {
Mcname = "treasure box";
}
tempt = temp;
Mc._x + = (mcx-mc._x)/sd;
DX = mcx-mc._x;
Mh.blurx = Math.Abs (DX/SD);
This.filters = [MH];
if (tempt = temp) {
Fs.gotoandstop (tempt);
}
};
}
Key_a = 37;
Key_b = 39;
Key_c = 188;
Key_d = 190;
This.onenterframe = function () {
if (Key.isdown (key_a) &&! Key_pr_a) {
LK ();
}
Key_pr_a = Key.isdown (key_a);
if (Key.isdown (key_b) &&! Key_pr_b) {
RK ();
}
Key_pr_b = Key.isdown (key_b);
if (Key.isdown (Key_c) &&! Key_pr_c) {
Kak ();
}
Key_pr_c = Key.isdown (Key_c);
if (Key.isdown (key_d) &&! Key_pr_d) {
KBK ();
}
Key_pr_d = Key.isdown (key_d);
};

Modified the next, open the movie clip with the name "MC" in the Library and delete the diagram inside. Then add the A1MC----A7MC movie clips in the library to the A1------A7. Open the movie clip with the name "MC" again and add the code in the first frame:
For (i=0 i<10; i++) {
NEWMC = Attachmovie ("A" +i, "NA" +i, i);
newmc._x = 127*i-127;
Instead of manually arranging the diagram, the program is arranged.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.