Buttons | navigation
Let's see this cool navigation button.
Click to browse the file
Here is a relatively simple tutorial I wrote, I hope to help you.
1. First create an MC, in which put a dynamic text box, named Zjs, in the MC drag 8 to put in the scene named Zjs1-zjs8 (note that the different horizontal axis of the MC, so that you can start playing the movie with a cooler effect).
2. Put a dynamic text in the scene and set its variable to Zjs_name to show which button you selected.
3. Write the Stop () in the first frame of the scene;
4. Create a layer in the ground scene named as to write action scripts.
myname = ["Flash forum", "Flash bar source", "Flash tutorial," Flash bar animation "," Flash Game "," Flash bar Sound "," Flash Gallery ", Flash bar Font"]//in each MC (ZJS1-ZJS8) dynamic text to display the content zjs_y = [];//is 0, Assign values later
for (var i = 0; i<myname.length; i++) {
Zjs_y[i] = (i+1) *30+20;
_root["Zjs" + (i+1)]._y = Zjs_y[i];
}
Assign the ordinate value to each MC (ZJS1-ZJS8)
for (var i = 0; i<myname.length; i++) {
this["Zjs" + (i+1)].zjs = Myname[i];
}
Write the contents of the text within each MC
MovieClip.prototype.move = function (click, speed, start_x, start_y, end_x, end_y) {//speed as buffering factor
if (click) {
This._x + = (end_x-this._x)/speed;
This._y + = (end_y-this._y)/speed;
Buffering effect
if (-this._x+end_x<1) {
this.enabled = 1;
} else {
this.enabled = 0;
}
Button failure during motion
Zjs_name = This.zjs;
} else {
This._x + = (start_x-this._x)/speed;
This._y + = (start_y-this._y)/speed;
if (this._x-start_x<1) {
this.enabled = 1;
} else {
this.enabled = 0;
}
}
};
MovieClip.prototype.myclick = function (n) {
for (var i = 1; i<=myname.length; i++) {
if (i = = N) {
_root["click" +i] = true;
} else {
_root["click" +i] = false;
}
}
};
Onenterframe = function () {
for (var i = 0; i<myname.length; i++) {
this["Zjs" + (i+1)].move (eval ("click" + (I+1)), 4, Zjs_y[i], 275, 200);
}
};
Zjs1.onrollover = function ();
Zjs2.onrollover = function ();
Zjs3.onrollover = function ();
Zjs4.onrollover = function ();
Zjs5.onrollover = function ();
Zjs6.onrollover = function ();
Zjs7.onrollover = function ();
Zjs8.onrollover = function ();
for (var i = 1; i<=myname.length; i++) {
this["Zjs" +i].onrelease = function () {
GetURL (" http://www.flash8.net");
};
}
Click to browse the file
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.