Foros del Web » Creando para Internet » Flash y Actionscript »

Rompecabezas en flash, problema al reacomodar las partes

Estas en el tema de Rompecabezas en flash, problema al reacomodar las partes en el foro de Flash y Actionscript en Foros del Web. Muchachos tengo un problema, nos pidieron hacer un rompe cabezas con validación el cual ya esta todo resuelto, pero como ultima consigna nos dieron la ...
  #1 (permalink)  
Antiguo 29/06/2010, 13:00
 
Fecha de Ingreso: junio-2010
Mensajes: 7
Antigüedad: 13 años, 10 meses
Puntos: 0
Exclamación Rompecabezas en flash, problema al reacomodar las partes

Muchachos tengo un problema, nos pidieron hacer un rompe cabezas con validación el cual ya esta todo resuelto, pero como ultima consigna nos dieron la actividad de tener un boton DESARMAR el cual coloque las piesas de manera random por la pantalla, realmente no se como hacer me eh estado volviendo loco si alguno tiene una solucion se lo voy a agrader. Lo unico que pude lograr fue hacer que se vuelan a habilitar en caso de estar de manera incorrecta.

Cada parte de la imagen es un clip de pelicula y dentro del clip es un boton con el siguiente codigo, esto se da en las 4 partes

Code

on (press) {
startDrag(_root.p1, false)
}

on (release, releaseOutside) {
stopDrag()
if (_root.p1.hitTest(_root.iman1)) {
_root.p1._x = _root.iman1._x
_root.p1._y = _root.iman1._y
}
}


Aqui el codigo general para el funcionamiento del puzzle

Code

recibe_xml = new XML()
recibe_xml.ignoreWhite = true
recibe_xml.load("xml.xml")

recibe_xml.onLoad = function() {
titulo12.text = recibe_xml.childNodes[11].childNodes[0].childNodes
}

import mx.transitions.Tween;
import mx.transitions.easing.*;

new Tween(juegos_tit, "_yscale", Elastic.easeOut, 0, 62, 2, true);
new Tween(juegos_tit, "_xscale", Elastic.easeOut, 0, 62, 2, true);
new Tween(titulo12, "_x", Elastic.easeOut, 0, 40, 2, true);
new Tween(pun1, "_x", Elastic.easeOut, 0, 25, 2, true);


botonmenu.onPress = function() {
gotoAndPlay("Escena 2", 1)
}

boton_mute.onPress = function (){
if (estado == 0){

song_mundial.start(pausa/1000);

estado = 1;

boton_mute.gotoAndStop;
} else {

pausa = misonido.position;

song_mundial.stop();

estado = 0;

boton_mute.gotoAndStop;
}
}

carla.onPress = function () {
if (_root.p1.hitTest(_root.iman1) and _root.p2.hitTest(_root.iman2) and _root.p3.hitTest(_root.iman3) and _root.p4.hitTest(_root.iman4)){
cunclunfu.text = "Bien!"
} else {
cunclunfu.text = "Mal!"
}

_root.p1.btn.enabled = false
_root.p2.btn.enabled = false
_root.p3.btn.enabled = false
_root.p4.btn.enabled = false
}

ESTE SERIA EL BOTON A PRESIONAR Y HACER QUE LAS PIESAS SE ACOMODEN DE MANERA RANDOM

bototeta.onPress = function() {
_root.p1.btn.enabled = true
_root.p2.btn.enabled = true
_root.p3.btn.enabled = true
_root.p4.btn.enabled = true
}

ESTE SERIA EL BOTON A PRESIONAR Y HACER QUE LAS PIESAS SE ACOMODEN DE MANERA RANDOM

stop()

Etiquetas: flash, partes, rompecabezas
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:15.