Comunidad de diseño web y desarrollo en internet online

ayuda con intento de ventanas

Citar            
MensajeEscrito el 26 Mar 2006 12:04 pm
Hola a todos,estoy intentando crear ventanas para ello he creado el siguiente codigo:

Código :

function ventana(){
   _root.createEmptyMovieClip ("ventana",_root.getNextHighestDepth() );
   with(ventana){
      lineStyle(1,0x000000,100);
      //dibuja una linea grosor de linea,color,_alpha
      beginFill(0xCCCCCC,50);
      //metodo  para comenzar a realizar el trazado de un dibujo, parametros el color y el _alpha
      moveTo(200,200);
      lineTo(200,200);
      lineTo(400,200);
      lineTo(400,400);
      lineTo(200,400);
      lineStyle(0,0x000000,100);
      moveTo(200,230);
      lineTo(400,230);
      endFill();
         
   }
   loadMovie("foto.jpg",_root.ventana);//cargo una imagen en la ventana
   _root.ventana.onPress=function(){
           //funcion para poder arrastrar la ventana
      _root.ventana.startDrag(true,300,100,0,400);
   }
function destruirVentana(){
   _root.removeMovieClip(ventana);
   
}

La funcion ventana la uso en un boton crear ventana
bien pues aqui los fallos son:
1º que no me carga la imagen
2º no la puedo arrastrar
Y por ultimo tengo un boton destruir ventana que llama a la funcion destruirVentana que tampoco me elimina la ventana.
Gracias a todos por vuestro tiempo



:D

Por marvin

29 de clabLevel



 

firefox
Citar            
MensajeEscrito el 26 Mar 2006 01:46 pm

Código :

System.security.allowDomain("http://www.helpexamples.com");//solo para el ejemplo
ventana(50,50);
function ventana(iniX,iniY){
  var ventana=this.createEmptyMovieClip("ventana_mc",this.getNextHighestDepth());
  ventana._x=iniX;
  ventana._y=iniY;
  
  var fondo= ventana.createEmptyMovieClip("fondo_mc", ventana.getNextHighestDepth());
  var img_holder=ventana.createEmptyMovieClip("img_mc", ventana.getNextHighestDepth());
  var cerrar_btn=ventana.createEmptyMovieClip("cerrar_mc",ventana.getNextHighestDepth());
  
      fondo.beginFill(0x333333);
      fondo.moveTo(10, 10);
      fondo.lineTo(300, 10);
      fondo.lineTo(300, 250);
      fondo.lineTo(10, 250);
      fondo.lineTo(10, 10);
      fondo.endFill();
         
img_holder.loadMovie("http://www.helpexamples.com/flash/images/image1.jpg")  //aqui, pon el path a tu imagen       
}
 
ventana_mc.onPress=function(){
    startDrag(this);
}
ventana_mc.onRelease=function(){
   stopDrag();
}
cerrar_btn.onPress=function(){
ventana_mc.removeMovieClip();
}

Por goliatone

66 de clabLevel



 

firefox
Citar            
MensajeEscrito el 26 Mar 2006 01:58 pm
Ok goliatone entiendo tus soluciones voy a probar muchisimas gracias

Por marvin

29 de clabLevel



 

firefox
Citar            
MensajeEscrito el 26 Mar 2006 04:29 pm
enga, espero que te sirva de punto de inicio... :wink:

Por goliatone

66 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.