• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Bug in Adobe Flash ? The code doesn't work if I add a symbol

Contributor ,
Nov 26, 2014 Nov 26, 2014

Copy link to clipboard

Copied

Hi,

Here's my code :

  import flash.text.TextField;

qtte_t1.addEventListener(Event.CHANGE,changeHandler);

qtte_t2.addEventListener(Event.CHANGE,changeHandler);

qtte_t3.addEventListener(Event.CHANGE,changeHandler);

qtte_t4.addEventListener(Event.CHANGE,changeHandler);

qtte_t5.addEventListener(Event.CHANGE,changeHandler);

qtte_t16.addEventListener(Event.CHANGE,changeHandler);

  function changeHandler(event:Event):void

  {

  calculatePayCheck();

  }

  function calculatePayCheck():void{

  var tome1:Number = 0;

  var tome2:Number = 0;

  var tome3:Number = 0;

  var tome4:Number = 0;

  var tome5:Number = 0;

  var tome16:Number = 0;

  var global:Number = 0;

  tome1 = Number(qtte_t1.text);

  tome2 = Number(qtte_t2.text);

  tome3 = Number(qtte_t3.text);

  tome4 = Number(qtte_t4.text);

  tome5 = Number(qtte_t5.text);

  tome16 = Number(qtte_t16.text);

  tome17 = Number(qtte_t17.text);

  tome18 = Number(qtte_t18.text);

  tome19 = Number(qtte_t19.text);

  tome20 = Number(qtte_t20.text);

  tome21 = Number(qtte_t21.text);

  tome22 = Number(qtte_t22.text);

  tome23 = Number(qtte_t23.text);

  tome24 = Number(qtte_t24.text);

  global = Number(prix_global.text);

  prix_t1.text = String(Math.round(tome1*1200));

  prix_t2.text = String(Math.round(tome2*1200));

  prix_t3.text = String(Math.round(tome3*1200));

  prix_t4.text = String(Math.round(tome4*1200));

  prix_t5.text = String(Math.round(tome5*1200));

  prix_t16.text = String(Math.round(tome16*1200));

  prix_global.text = String(Math.round((tome1+tome2+tome3+tome4+tome5+tome16)*1200));

  }

Everything is working great, but if I add a symbol on stage the calculs are completly buggy ! (no error message but I can't add the number I want and the calculs are wrong)

Do you know why ?

I can't add a form, a symbol, NOTHING. just bitmap. If I'm adding something, the sums are wrong.

Thank you,

steph

TOPICS
ActionScript

Views

311

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2014 Nov 26, 2014

Copy link to clipboard

Copied

you showed a lot of superfluous code and incomplete code, but that by itself wouldn't cause what you describe.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 26, 2014 Nov 26, 2014

Copy link to clipboard

Copied

It is not incomplete. It's ALL my code. (I've put it in an action class on stage).

And, of course, I've got on stage, qtte_t1...ect

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2014 Nov 26, 2014

Copy link to clipboard

Copied

then you should be seeing 1120 (undefined property) errors for tome17,..,tome24.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 26, 2014 Nov 26, 2014

Copy link to clipboard

Copied

You're right. I forgot to delete these lines in my post. Sorry for that.

But, it doesn't change this bug I have...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 27, 2014 Nov 27, 2014

Copy link to clipboard

Copied

LATEST

like i said, you showed a lot of superfluous code and incomplete code, but that by itself wouldn't cause what you describe.

so, something other than what you indicated is happening.  i don't know what that is but i suspect you are not doing what you think you are doing.

to debug, copy just the code you showed (or should have showed) to a new fla that contains only the needed textfields and mouse listeners and test.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines