Imitation Korean menu as2.0

xiaoxiao2021-03-06  41

I imitate the Korean menu, because its source code is written in FlashMX AS 1.0, and I use FlashMX2004 AS 2.0 production, so it is a bit improvement. The source code of the first menu

Put on Main Scene Frame

VAR DRAG = 0.1; // Vibration parameters

Var flex = 0.7; // Vibration parameters

Var Wordcharray = New Array ("Classroom Home", "Course Introduction", "Wonderful Class", "Video Appreciation", "Electronic Documents", "Troubleshooting Q & A", "Film Community");

Var WordenaRray = New Array ("INDEX", "INTRO", "Course", "Video", "Document", "FAQ", "Forum");

VAR Menucolor = New Array (0xffcc00, 0x3399cc, 0x96d302, 0xffc600, 0xff5400, 0x6699cc, 0x02d396); // Set color

Var URL = New Array ("INDEX.HTM", "#", "course / course.htm", "#", "/ e-learning.htm", "#", "#");

Var block = this.attachmovie ("Diamond_MC", "MB", 0); // Link Diamond_MC video

Block._x = -1000;

Block.step = 0;

Block.px = 0;

Block.goalx = -100;

Block.onterframe = function () {

THIS.STEP = this.step * flex (this.goalx - this.px) * DRAG;

THIS.PX = this.step;

THIS._X = this.px;

IF (this.sout && this._xscale <99.5) this._xscale = (100-this._xscale) / 8;

IF (this.sin && this._xscale> 0.1) this._xscale = -THIS._XSCALE / 4;

}

Var MbColor = New Color (Block);

For (VAR i: Number = 0; i <= wordcharray.length-1; i ) {

Var theitem = this.attachmovie ("Word_MC", "Word" i, i 10); // i 10 is depth, must

Theitem._x = i * 100;

THEITEM.WORDCH.HN.TEXT = Wordcharray [i];

Theitem.worden.eng.text = WordenArray [i];

Theitem.url = URL [I];

THEITEM.MCOLOR = Menucolor [i];

Theitem.onrollover = function () {

Block.goalx = this._x 50; block.sout = true;

Block.sin = false;

MbColor.setrGB (this.mcolor);

New color (this.wordch) .SETRGB (0xff9933);

New color (this.worden) .SETRGB (0xff9933);

THIS.WORDCH._X - = 5;

THIS.WORDCH._Y - = 5;

THIS.WORDEN._X - = 15;

THIS.FADEOUT = TRUE;

THIS.FADEIN = FALSE;

}

Theitem.onrollout = function () {

Block.Sout = false;

BLOCK.SIN = TRUE;

THIS.WORDCH._X = 5;

THIS.WORDCH._Y = 5;

THIS.WORDEN._X = 15;

New color (this.wordch) .SETRGB (0x499300);

New color (this.worden) .SETRGB (0x499300);

THIS.FADEOUT = FALSE;

THIS.FADEIN = True;

}

Theitem.onterframe = function () {

IF (this.fadeout) {

IF (this.Wordch._xscale <130) {this.wordch._xscale = 5; this.wordch._yscale = 5;}

}

IF (this.fadein) {

IF (this.wordch._xscale> 100) {this.wordch._xscale - = 5; this.wordch._yscale - = 5;}

}

}

Theitem.onrelease = function () {

GetURL (this.URL);

}

}

// Prohibit right-click menu

Fscommand ("ShowMenu", False;

Another menu source code is placed on the main scene frame on STOP ();

VAR M_TXT = [Chapter 1 "," Chapter 2 "," Chapter 3 "," Chapter 4 "," Chapter 5 "," Chapter V), "Chapter VI"];

VAR URL_TXT = ["PC45.JPG", "#", "#", "#", "#", "#", "pc45.jpg"];

VAR URLS = ["#", "#", "#", "#", "#", "#", "#"];

VAR TEMP_URL = [];

Var myb = false;

Var L = m_txt.length;

VAR TEMP_N = 0;

For (var i = 0; i

IF (i> 0) {

THIS [i "_ mc"] ._ x = this [(i-1) "_ mc"] ._ x this [(i-1) "_ mc"] ._ width-1.5;

}

THIS [i "_ mc"]. n = i;

THIS [i "_ mc"]. txt.text = m_txt [i]; this [i "_ mc"]. ul = url_txt [i];

THIS [i "_ mc"]. Onrollover = function () {

TEMP_N = this.n;

This.it.Loader.ContentPath = this.ul;

myb = true;

VAR J = 0;

this.onterframe = function () {

J = 20;

this.it._alpha = j;

}

}

THIS [i "_ mc"]. Onrelease = function () {

TEMP_URL = URLS [this.n];

VAR URL = TEMP_URL;

GetURL (URL);

}

THIS [i "_ mc"]. Onrollout = function () {

TEMP_N = this.n;

myb = false;

VAR J = 100;

this.onterframe = function () {

J = J-20;

this.it._alpha = j-1;

}

}

}

// buffer effect

Var speed = 0;

Function move_scale (x, obj) {

Speed ​​= (X-Obj._xscale) *. 1 speed * .20;

OBJ._XSCALE = Speed;

//obj._yscale = obj._xscale;

}

Function move_scale2 (x, obj) {

Obj._xscale - = speted;

}

this.onterframe = function () {

For (var i = 0; i

THIS [i "_ mc"] ._ x = this [(i-1) "_ mc"] ._ x this [(i-1) "_ mc"] ._ width-1.5;

THIS [i "_ mc"] ._ x = move_scale (100, this [i "_ mc"]);

}

IF (myb) {

VAR S = 100-10 / (l-temp_n 1);

Move_scale (200, this [temp_n "_ mc"]);

For (var i = temp_n-1; i> 0; I -) {

THIS [I "_ MC"] ._ x = move_scale (s, this [i "_ mc"]);

}

} else {

For (var i = temp_n 1; i

THIS [i "_ mc"] ._ x = move_scale2 (s, this [i "_ mc"]);

}

}

}

// Prohibit right-click menu

Fscommand ("ShowMenu", False;

转载请注明原文地址:https://www.9cbs.com/read-73139.html

New Post(0)