Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/05/2009, 15:12
modatorrevieja
 
Fecha de Ingreso: abril-2009
Mensajes: 173
Antigüedad: 15 años, 1 mes
Puntos: 0
Añadir a la seleccion productos

Hola, me gustaria saber como puedo en flash cs3 hacer una cosa.
Quiero que al pinchar en un boton que se llama AÑADIR A LA SELECCION, me añada ese producto NOMBRE-REFERENCIA- , los datos son recogidos de una base de datos mediante un php que contiene una lista xml.
Aclarando cuando pinche en añadir seleccion pues si estoy viendo por ejemplo un boligrafo, con una descripcion por ejemplo es de color rojo fino, pues que me los muestre en otro frame
Nombre: boli
Descripcion: color rojo fino.
gracias
[email protected]
Mi codigo flash
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.events.MouseEvent;
import flash.display.Loader;
import flash.net.URLRequest;
var LoaderList:URLLoader =new URLLoader();
var loadImg:Loader=new Loader(); //variable para imagen principal
var loadImg2:Loader=new Loader(); //variable para imagen secundaria
var loadImg3:Loader=new Loader(); //variable para imagen novedad
var myXML:XML=new XML();
var cont:Number=0;
var tiempo:Timer = new Timer(6000, 0);
var idNum:Number=0
function CargaListaContenido() {
//AQUI EL PHP ES DE LAS NOVEDADES
LoaderList=new URLLoader(new URLRequest("http://80.36.206.105/smp/PHY/datosxmlCP.php"));
LoaderList.addEventListener(Event.COMPLETE, xmlLoaded);
tiempo.addEventListener(TimerEvent.TIMER, movimiento);
tiempo.start();
}
function movimiento(event:TimerEvent):void{
cont++;
if (cont > myXML.child("codigo").length()-1) {
cont=0;
}
MuestraArticulos(cont);
}
function MuestraArticulos(id:Number) {
loadImg=new Loader();
loadImg2=new Loader();
loadImg3=new Loader();
loadImg.load(new URLRequest(myXML.child("imagenprincipal")[id]));
loadImg2.load(new URLRequest(myXML.child("imagensecundaria")[id]));
loadImg3.load(new URLRequest(myXML.child("novedadimagen")[id]));
loadImg.contentLoaderInfo.addEventListener(Event.C OMPLETE, redimenciona);
loadImg2.contentLoaderInfo.addEventListener(Event. COMPLETE, redimenciona);
loadImg3.contentLoaderInfo.addEventListener(Event. COMPLETE, redimenciona);
contenedor.addChild(loadImg);
contenedor2.addChild(loadImg2);
contenedor3.addChild(loadImg3);
addChild(contenedor3);
addChild(contenedor2);
addChild(contenedor);
codigoproductos.text=myXML.child("codigo")[id];
nombreproductos.text=myXML.child("nombre")[id];
precioespecialproductos.text=myXML.child("precioes pecial")[id]+" €";
descrproductos.text=myXML.child("descripcion")[id];
observaproductos.text=myXML.child("observaciones")[id];
pvpproductos.text=myXML.child("pvp")[id]+" €";
fechaproductos.text=myXML.child("fecha")[id];
idNum =Number(myXML.child("num")[id])
cont=id;
if(cont > myXML.child("codigo").length()){ //vuelve a empezar
cont=0
}
}
function onClick(event:MouseEvent):void {
var request:URLRequest = new URLRequest("http://80.36.206.105/smp/PHY/creandopdf.php?num="+String(idNum))
navigateToURL(request,"_blank");

}
function xmlLoaded(event:Event):void {
myXML=XML(LoaderList.data);
MuestraArticulos(0)
boton_recibir.addEventListener(MouseEvent.MOUSE_DO WN,EventosDeBoton);
siguiente.addEventListener(MouseEvent.MOUSE_DOWN,E ventosDeBoton);
anterior.addEventListener(MouseEvent.MOUSE_DOWN,Ev entosDeBoton);
btnpdf.addEventListener(MouseEvent.CLICK, onClick);
}
function redimenciona(event:Event):void {
loadImg.x=10;
loadImg.y=50;
}
function EventosDeBoton(event:Event):void {
switch (event.currentTarget) {
case boton_recibir :
MuestraArticulos(0);
break;
case siguiente :
cont++;
if (cont > (myXML.child("codigo").length()-1)) {
cont=0;
}
MuestraArticulos(cont);
break;
case anterior :
cont-=1;
if (cont < 0) {
cont=myXML.child("codigo").length()-1;
}
MuestraArticulos(cont);
break;
}
}
CargaListaContenido();