спасибо всем за ответы.
Я вообще-то во флэше не профи, можно поподробнее об этих
методах? Или ссылку на исходник, тогда сам разберусь.
ЗЫ: вот какое мне предложили решение для МХ:
<BLOCKQUOTE><font size="1" face="Verdana, Tahoma, sans-serif">code:</font><HR><pre>
//. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Copyright © Willyam Bradberry 2002
// [flash - master] mailto:willyam@newmail.ru
//
wb@3wgraphics.net // 24.04.2002 12:10
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
stop();
i = 1;
_toRGB = 0xFFFFFF;
on_off=1;
//*** ARRAYS INITIALIZATION ********
_mcArray = [];
_rgb=["_red","_green","_blue", "test"];
_color=[0xFF0000,0x00FF00,0x0000FF,0x667788];
_c =["FF","FF","FF"];
_ct=[];
//****
_prMC = MovieClip.prototype;
//****DRAW RECTANGLE FUNCTIOON***
//****
_prMC.createRect=function(x,y,w,h,_color,_fill)
{
this._x =x;
this._y =y;
this.beginFill(_fill, 100);
this.lineStyle(.1, _color, 100);
this.lineTo(w, 0);
this.lineTo(w, h);
this.lineTo(0, h);
this.endFill();
}
//********** END FUNCTION ********
//**
//****DRAW RECTANGLE & gradient fill ***
_prMC.createGradRect=function(x,y,w,h,_color,_fill1,_fill2){
with ( this )
{
_x =x;
_y =y;
colors = [_fill1,_fill2];
alphas = [ 100, 100 ];
ratios = [ 0, 0xFF ];
matrix = ;
beginGradientFill( "linear", colors, alphas, ratios, matrix );
lineStyle(.1, _color, 100);
lineto(w,0);
lineto(w,h);
lineto(0,h);
lineto(0,0);
endFill();
}
}
//********** END FUNCTION ********
//***
// *******************************
//*** HIGHLIGHT-BUTTON FUNCTION ****
highlight = function()
{
this.onRollOver=function()
{
this.old_alpha=this._alpha;
this._alpha = 100;
}
this.onRollOut = function()
{
this._alpha =this.old_alpha;
}
this.onDragOut = function()
{
this._alpha = this.old_alpha;
}
// this.onPress = function()
// {
// this._alpha = 50;
// }
}
//********** END FUNCTION ***********
//***
// **********************************
//********** FILL FUNCTION ***********
//***
_prMC.shapeFill = function()
{
if(!_root.on_off)
{
// this._xmArr.shift();
// this._ymArr.shift();
L = this._xmArr.length;
this.clear();
this.beginFill(_root._toRGB);
for(s=0;s<L;s++)
{
//trace(s);
this.lineTo(this._xmArr[s],this._ymArr[s])
}
this.endFill();
// trace("L:"+L);
// trace("this._xmArr:"+this._xmArr);
}
}
//*** CREATING GRAPHICS INTERFACE ***
//*** background ***
_root.createEmptyMovieClip("mc", 1);
_mc = _root.mc;
_mc.createRect(0,0,400,350,0xFFFFFF,0x223344)
_mc.createTextField("txt",1,0,175,400,20);
_mc.createTextField("txt2",2,0,100,400,100);
_mc.txt.selectable=0;
_mc.txt2.selectable=0;
_mc.txt.text = "'© Willyam Bradberry 2002 [: flash MX - master :]'";
_mc.txt2.text = "Drawing Tool";
txtForm = new TextFormat();
txtForm.font = "Verdana";
txtForm.size = 14;
txtForm.color=0x556677;
txtForm.align="center";
txtForm.selectable=false;
_mc.txt.setTextFormat(txtForm);
txtForm2 = new TextFormat();
txtForm2.font = "Verdana";
txtForm2.size = 52;
txtForm2.color=0x334455;
txtForm2.bold=1;
txtForm2.align="center";
txtForm2.selectable=false;
_mc.txt2.setTextFormat(txtForm2);
// *******************************
//*** color bars ***
for (var i=0;i<3;i++){
_root.createEmptyMovieClip(_rgb[i],(1000+i));
//****
_mc = _root[_rgb[i]];
//****
y = i*14+352;
_mc.createGradRect(0,y,256,10,0x557799,0x000000,_root._color[i])
_mc.createEmptyMovieClip("mc",1);
_mc.mc._x = _mc._width-1;
_mc.mc.lineStyle(.1,0xFFFFFF,100)
_mc.mc.lineTo(0,10)
}
//****
//*** color Testing rectangle ***
i=3
_root.createEmptyMovieClip(_rgb[i],(1000+i));
_mc = _root[_rgb[i]];
_mc.createRect(258,352,38,38,0xDDEEFF,0x445566)
//***
//****
//*** color Testing rectangle 2 ***
_root.createEmptyMovieClip("test2",(1010));
_mc = _root.test2;
_mc.createRect(260,354,34,34,0x000000,0x000000);
_mc._visible=_root.on_off;
//***
//*** button undo ***
_root.createEmptyMovieClip("undo",(1005));
_mc = _root.undo;
_mc._alpha = 50;
_mc.onRelease=function()
{
_root.undoLine();
}
_mc.createRect((299+40),352,38,18,0xDDEEFF,0x445566)
highlight.apply(_mc);
_mc.createTextField("txt",1,0,0,38,18);
_mc.txt.selectable=0;
_mc.txt.text = "undo";
txtForm = new TextFormat();
txtForm.font = "Verdana";
txtForm.size = 12;
txtForm.color=0xCCDDEE;
txtForm.align="center";
txtForm.selectable=false;
_mc.txt.setTextFormat(txtForm);
//***
//*** button clear ***
_root.createEmptyMovieClip("clear",(1006));
_mc = _root.clear;
_mc._alpha = 50;
_mc.onRelease=function()
{
_root.clearAll();
}
_mc.createRect((299+40),372,38,18,0xDDEEFF,0x445566)
highlight.apply(_mc);
_mc.createTextField("txt",1,0,0,38,18);
_mc.txt.selectable=0;
_mc.txt.text = "clear";
_mc.txt.setTextFormat(txtForm);
//***//***
//*** button FILL_on_off***
_root.createEmptyMovieClip("fill_on_off",(1007));
_mc = _root.fill_on_off;
_mc._alpha = 50;
_mc.onRelease=function()
{
_root.on_off=1-_root.on_off;
_root.test2._visible =_root.on_off;
// trace("_root.on_off:"+_root.on_off);
}
_mc.createRect((339-40),352,38,38,0xDDEEFF,0x445566)
highlight.apply(_mc);
_mc.createTextField("txt",1,0,10,38,18);
_mc.txt.selectable=0;
_mc.txt.text = "fill";
_mc.txt.setTextFormat(txtForm);
//***
//*** END OF CREATING ************
_mc = _root.mc;
// *******************************
_mc.onMouseDown = function() {
if (_ym>0 && _ym<350) {
if(i<1000){
this.md = 1;
i++;
_root.createEmptyMovieClip("m"+i, i);
_newmc = _root["m"+i];
_newmc._xmArr = [];
_newmc._ymArr = [];
_newmc._x = _xmouse;
_newmc._y = _ymouse;
_newmc.lineStyle(.1, _root._toRGB, 100);
_mcArray.push(_newmc);
}
}
};
// *******************************
_mc.onMouseUp = function() {
this.md = 0;
_root._newmc.shapeFill();
};
// *******************************
_mc.onMouseMove = function() {
// :::::::::::
_xm = _root._xmouse;
_ym = _root._ymouse;
// :::::::::::
if (_ym>0 && _ym<350) {
xm = Math.floor(_newmc._xmouse);
ym = Math.floor(_newmc._ymouse);
if (this.md) {
_newmc.i++;
_newmc._xmArr[_newmc.i]= xm;
_newmc._ymArr[_newmc.i]= ym;
_newmc.lineTo(xm, ym);
}
}
};
// *******************************
clearAll = function () ;
// ****************
undoLine = function () ;
// *******************************
myKey = new Object();
// ****************
myKey.onKeyDown = function() {
if (Key.isDown(Key.SPACE)) {
clearAll();
}
if (Key.isDown(Key.SHIFT)) {
undoLine();
}
};
myKey.onKeyUp = function() {
};
// ****************
Key.addListener(myKey);
// *******************************
//*** colorized ***
_path = _root[_rgb[3]]
_mycolor = new Color(_path);
_mycolor.setRGB(_toRGB);
//***
changeColor = function(n)
{
_ct[n] = _root[_rgb[n]].mc._x
_c[n] = _ct[n].toString(16);
_ct[n] < 16 ? _c[n]="0"+_c[n] : _c[n]
_toRGB = "0x"+_c[0]+_c[1]+_c[2];
_mycolor.setRGB(_toRGB);
}
// *******************************
for (var i=0;i<3;i++){
_root[_rgb[i]].num = i;
_root[_rgb[i]].onPress=function()
{
this.md=1;
}
_root[_rgb[i]].onMouseUp=function()
{
this.md=0;
}
_root[_rgb[i]].onEnterFrame=function()
{
_xm=_root._xmouse;
_ym=_root._ymouse;
if(this.hitTest(_xm,_ym,1))
{
if(this.md)
{
this.mc._x = _xm;
_root.changeColor(this.num);
}
}
}
}
// *******************************
</pre><HR></BLOCKQUOTE>