Регистрация: Feb 2004
Адрес: на колокольне Любит: плеваться
Сообщений: 1,769
|
только средствами ActionScript:
 Код:
butCounter = 1;
function newButton(x, y, txt, ur) {
function over() {
bc = this._name.slice(6, 7);
with (_root['button'+bc]) {
lineStyle(2, 0xDDCC33, 100);
colors = [0xFF9933, 0xFFCC99];
alphas = [100, 100];
ratios = [0, 0xFF];
matrix = {a:60, b:0, c:0, d:0, e:20, f:0, g:60, h:60, i:1};
beginGradientFill("linear", colors, alphas, ratios, matrix);
for (i=0; i<points.length; i++) {
lineTo(points[i].x, points[i].y);
}
endFill();
tf.setTextFormat(mtf2);
}
}
function out() {
bc = this._name.slice(6, 7);
with (_root['button'+bc]) {
lineStyle(2, 0xDDCC33, 100);
colors = [0xFFCC99, 0xFF9933];
alphas = [100, 100];
ratios = [0, 0xFF];
matrix = {a:60, b:0, c:0, d:0, e:20, f:0, g:60, h:60, i:1};
beginGradientFill("linear", colors, alphas, ratios, matrix);
for (i=0; i<points.length; i++) {
lineTo(points[i].x, points[i].y);
}
endFill();
tf.setTextFormat(mtf1);
}
}
function url() {
bc = this._name.slice(6, 7);
getURL(_root['button'+bc].ur);
}
this.butCounter = _root.butCounter;
points = [{x:10, y:10}, {x:120, y:10}, {x:120, y:40}, {x:10, y:40}, {x:10, y:10}];
_root.createEmptyMovieClip('button'+butCounter, butCounter);
_root['button'+butCounter].createTextField('tf', 4, 65, 10, null, null);
with (_root['button'+butCounter]) {
lineStyle(2, 0xDDCC33, 100);
colors = [0xFFCC99, 0xFF9933];
alphas = [100, 100];
ratios = [0, 0xFF];
matrix = {a:60, b:0, c:0, d:0, e:20, f:0, g:60, h:60, i:1};
beginGradientFill("linear", colors, alphas, ratios, matrix);
for (i=0; i<points.length; i++) {
lineTo(points[i].x, points[i].y);
}
endFill();
mtf1 = new TextFormat('Tahoma', 18, 0x663344, true);
mtf2 = new TextFormat('Tahoma', 18, 0x33CC88, true);
tf.autoSize = 'center';
tf.text = txt;
tf.setTextFormat(mtf1);
_root['button'+butCounter].ur = ur;
_root['button'+butCounter]._x = x;
_root['button'+butCounter]._y = y;
}
_root['button'+butCounter].onRollOver = over;
_root['button'+butCounter].onRollOut = out;
_root['button'+butCounter].onPress = url;
_root.butCounter++;
}
lineStyle(2, 0xDDCC33, 100);
moveTo(1, 0);
lineTo(1, 300);
newButton(0, 0, 'кнопка1', 'http://mail.ru');
newButton(0, 40, 'кнопка2', 'http://www.flasher.ru');
newButton(0, 80, 'кнопка3', 'http://yandex.ru');
newButton(0, 120, 'кнопка4', 'http://rambler.ru');
newButton(0, 160, 'кнопка5', 'http://www.punto.ru');
newButton(0, 200, 'кнопка6', 'http://google.com');
newButton(0, 240, 'кнопка7', 'http://yandex.ru');
newButton(0, 280, 'кнопка8', 'http://rambler.ru');
__________________
судью - на мыло, из игроков - вить веревки.
|