Yo tengo el siguiente codigo el cual crea lineas y ubica su origen y su finalizacion con respecto a la ubicacion de 6 puntos.Aqui el codigo:
Código ActionScript :
_root.cota1.restrict = "0-9"
_root.apart.restrict = "0-9"
_root.late.restrict = "0-9"
generar.onPress = function (){
if (_root.cota1.text >= 51 or _root.apart.text >= 51 or _root.late.text >= 51){
_root.errores.text = "Los cota, apartamento y/o lateral no pueden superar los 50"
}else{
_root.errores.text = ""
if (_root.cota1.text == ""){
_root.cota1.text = 0
}
if (_root.apart.text == ""){
_root.cota1.text = 0
}
if (_root.late.text == ""){
_root.cota1.text = 0
}
_root.punto._x = _root.cota._x
_root.punto._y = _root.cota._y + _root.cota._height/2 - _root.cota1.text * 3
_root.punto2._x = _root.apartamiento._x - _root.apartamiento._width / 2 + _root.apart.text * 2.598
_root.punto2._y = _root.apartamiento._y - _root.apartamiento._height /2 + _root.apart.text * 1.5
_root.punto3._x = _root.lateral._x + _root.lateral._width / 2 - _root.late.text * 2.598
_root.punto3._y = _root.lateral._y - _root.lateral._height /2+ _root.late.text * 1.5
_root.punto4._y = _root.punto3._y - _root.cota1.text * 3
_root.punto4._x = _root.punto3._x
_root.punto5._x = _root.punto2._x
_root.punto5._y = _root.punto2._y - _root.cota1.text * 3
_root.punto6._x = _root.punto._x
_root.punto6._y = _root.cota._y + _root.cota._height/2
_root.punto7._x = _root.punto3._x + _root.apart.text * 2.598
_root.punto7._y = _root.punto3._y + _root.apart.text * 1.5
_root.punto8._x = _root.punto7._x
_root.punto8._y = _root.punto7._y - _root.cota1.text * 3
this.createEmptyMovieClip("linea1",1)
with ("linea1"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto._x,_root.punto._y)
lineTo (_root.punto4._x,_root.punto4._y)
}
this.createEmptyMovieClip("linea2",1)
with ("linea2"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto._x,_root.punto._y)
lineTo (_root.punto5._x,_root.punto5._y)
}
this.createEmptyMovieClip("linea3",1)
with ("linea3"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto4._x,_root.punto4._y)
lineTo (_root.punto3._x,_root.punto3._y)
}
this.createEmptyMovieClip("linea4",1)
with ("linea4"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto3._x,_root.punto3._y)
lineTo (_root.punto7._x,_root.punto7._y)
}
this.createEmptyMovieClip("linea5",1)
with ("linea5"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto7._x,_root.punto7._y)
lineTo (_root.punto8._x,_root.punto8._y)
}
this.createEmptyMovieClip("linea6",1)
with ("linea6"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto8._x,_root.punto8._y)
lineTo (_root.punto4._x,_root.punto4._y)
}
this.createEmptyMovieClip("linea7",1)
with ("linea7"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto8._x,_root.punto8._y)
lineTo (_root.punto5._x,_root.punto5._y)
}
this.createEmptyMovieClip("linea8",1)
with ("linea8"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto5._x,_root.punto5._y)
lineTo (_root.punto2._x,_root.punto2._y)
}
this.createEmptyMovieClip("linea9",1)
with ("linea9"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto2._x,_root.punto2._y)
lineTo (_root.punto7._x,_root.punto7._y)
}
this.createEmptyMovieClip("linea10",1)
with ("linea10"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto6._x,_root.punto6._y)
lineTo (_root.punto3._x,_root.punto3._y)
}
this.createEmptyMovieClip("linea11",1)
with ("linea11"){
lineStyle(2, 0x00FF00, 50, true, 1)
moveTo (_root.punto6._x,_root.punto6._y)
lineTo (_root.punto2._x,_root.punto2._y)
}
}
}
_root.borrar.onPress = function (){
linea1.removeMovieClip ()
linea2.removeMovieClip ()
linea3.removeMovieClip ()
linea4.removeMovieClip ()
linea5.removeMovieClip ()
linea6.removeMovieClip ()
linea7.removeMovieClip ()
linea8.removeMovieClip ()
linea9.removeMovieClip ()
linea10.removeMovieClip ()
linea11.removeMovieClip ()
}El Problema es que cuando toco el boton llamado "borrar" las lineas siguen ahi y he intentado miles de formas y no hay manera!
Por favor alguien me podria dar una mano?
