Skip navigation
TwistedPixel23
Currently Being Moderated

Flash crashes when I run code more than once

Aug 8, 2012 2:59 AM

Hi guys, I have a problem with a piece of code which functions properly when first run it but when I run it the second time flash becomes unresponsive and crashes. I have tried the swf in flash player the code runs fine first few times but gets extremely slow thereafter.

 

[AS]

//======================BASE PRICE========================================

var baseprice:Number;

baseprice = 20;

priceOutput.text = String(baseprice)

//=========================BASE PRICE END=====================================

var updatedPrice:Number

var updatedPrice02:Number

//-------------------------------------------------------------------- -------

namesAndSize.addEventListener(MouseEvent.MOUSE_UP, captureQuantityPrice)

 

 

function captureQuantityPrice(e:MouseEvent):void{

 

 

          updatedPrice = Number(priceOutput.text)

}

 

 

//-------------------------------------------------------------------- --------

quantityMenu.updateForm.addEventListener(MouseEvent.MOUSE_UP, quantityMultiply)

 

 

function quantityMultiply(e:MouseEvent):void{

 

updatedPrice02 =  updatedPrice * Number(quantityMenu.XXXSinput.text)

 

 

 

 

priceOutput.text = updatedPrice02.toString();

 

}

[/AS]

 

the button "updateForm" also has another eventlistnener which functions is to create a loop of text boxs. Could this be the problem?

 
Replies
  • Currently Being Moderated
    Aug 8, 2012 4:50 AM   in reply to TwistedPixel23

    I don't see anything in the code you show that looks like a cause for the problem.  Usually things slowing down is the result of a loop constantly running and creating new objects that have to be processed continuously.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points