Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Aew galera, beleza?Eu gostaria de criar um movie clip e desenhar nele com move to e line to, e depois colocar métodos para poder move-lo, vou mandar parte do código pra ve se vcs entendem e acham onde está o meu erro...criaObjeto = function(){ pronto = false; this.createEmptyMovieClip( "objeto" + c, lay ); with( _root["objeto" + c] ) { lineStyle( 1, 0x000000, 100 ); _root["objeto" + c].xinicial = calculaPonto( _xmouse ); _root["objeto" + c].yinicial = calculaPonto( _ymouse ); xanterior = xinicial; yanterior = yinicial; moveTo( xinicial, yinicial ); }if( pronto ) { iniX = 0; iniY = 0; _root["objeto" + c].onMouseDown = function() // Verifica se o objeto foi pressionado { iniX = this._x; iniY = this._y; if( this.hitTest( _root._xmouse, _root._ymouse, true ) ) // Verifica se o mouse está sobre o objeto { this.startDrag(); // Faz o objeto acompanhar o mouse updateAfterEvent(); } } _root["objeto" + c].onPress = function() { _root.nome = this._name; } _root["objeto" + c].onMouseUp = function() // Verifica se o objeto foi "despressionado" { this.stopDrag(); // Faz o objeto parar de acompanhar o mouse if( this._x > 60 && this._x < 120 ) { this._x = 90; } if( this._x > 90 && this._x < 150 ) { this._x = 120; } if( this._x > 120 && this._x < 180 ) { this._x = 150; } if( this._x > 150 && this._x < 210 ) { this._x = 180; } if( this._x > 180 && this._x < 240 ) { this._x = 210; } if( this._x > 210 && this._x < 270 ) { this._x = 240; } if( this._x > 240 && this._x < 300 ) { this._x = 270; } if( this._x > 270 && this._x < 330 ) { this._x = 300; } if( this._x > 300 && this._x < 360 ) { this._x = 330; } if( this._y > 60 && this._y < 120 ) { this._y = 90; } if( this._y > 90 && this._y < 150 ) { this._y = 120; } if( this._y > 120 && this._y < 180 ) { this._y = 150; } if( this._y > 150 && this._y < 210 ) { this._y = 180; } if( this._y > 180 && this._y < 240 ) { this._y = 210; } if( this._y > 210 && this._y < 270 ) { this._y = 240; } if( this._x < 60 ) { this._x = 60; } if( this._x > 360 ) { this._x = 360; } if( this._y < 60 ) { this._y = 60; } if( this._y > 270 ) { this._y = 270; } } }}criaLinha = function(){ with( _root["objeto" + c] ) { x = calculaPonto( _xmouse ); y = calculaPonto( _ymouse ); lineTo( x, y ); xanterior = x; yanterior = y; if( x == xinicial and y == yinicial ) { _root["objeto" + c].beginFill( 0xCCC100 ); myColor = new Color( _root["objeto" + c] ); _root.myColor.setRGB( 0xFFA ); criado = 2; _global.mover = 4; vCor = '5'; _root["objeto" + c].endFill(); lay++; c++; setaLapis._visible = false; Mouse.show(); pronto = true; } }}
Carregando comentários...