Falai gente boa quem tiver vendo esse tópico preciso de uma ajuda meio rápido, trabalho pra entregar em aula, hahahahahahaha.
é um carrinho de compras simples, que eu vou arrastar esse produto no carrinho de compras e vai somar um valor no campo dinamico e tal, só que meu problema, ele não vai acumulando os preços do meu carrinho, ele só vai trocando olha ai o que eu tenho.
Vou poder entregar amanhã
| ActionScript |
//somar no campo dinamico os valores de cada produto var sProduto1:Number = 199; var sProduto2:Number = 600; var sProduto3:Number = 1200; var sProduto4:Number = 199; var sProduto5:Number = 300; var sProduto6:Number = 350; //---------------------------------------------------------------------------------------------- //arrastar e soltar Produto 1 produto1_mc.onPress = function() { this.startDrag(); if (this.hitTest(carrinho_mc)) { total_txt.text = sProduto1; } }; produto1_mc.onRelease = function() { produto1_mc.stopDrag(); }; //arrastar e soltar Produto 2 produto2_mc.onPress = function() { this.startDrag(); if (this.hitTest(carrinho_mc)) { total_txt.text = sProduto2; } }; produto2_mc.onRelease = function() { produto2_mc.stopDrag(); }; //arrastar e soltar Produto 3 produto3_mc.onPress = function() { this.startDrag(); if (this.hitTest(carrinho_mc)) { total_txt.text = sProduto3; } }; produto3_mc.onRelease = function() { produto3_mc.stopDrag(); }; //arrastar e soltar Produto 4 produto4_mc.onPress = function() { this.startDrag(); if (this.hitTest(carrinho_mc)) { total_txt.text = sProduto4; } }; produto4_mc.onRelease = function() { produto4_mc.stopDrag(); }; //arrastar e soltar Produto 5 produto5_mc.onPress = function() { this.startDrag(); if (this.hitTest(carrinho_mc)) { total_txt.text = sProduto5; } }; produto5_mc.onRelease = function() { produto5_mc.stopDrag(); }; //arrastar e soltar Produto 6 produto6_mc.onPress = function() { this.startDrag(); if (this.hitTest(carrinho_mc)) { total_txt.text = sProduto6; } }; produto6_mc.onRelease = function() { produto6_mc.stopDrag(); }; // |