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

Hi there

New Here ,
May 21, 2014 May 21, 2014

This is my code, nothing happens at the output.

What did i do wrong.

No syntax error and no debug pb.

Tks a lot.

var n1:int;

var n2:int;

var reponse:int;

function pgcd(a:int,b:int):int

{

  if (b==0)

  {

  return a;

  }

  else

  {

  return pgcd(b, a % b);

  }

}

n1 = 27;

n2 = 18;

reponse = pgcd(n1,n2);

trace("Le PGCD de " + n1 + " et de " + n2 + " est " + reponse + ".");

TOPICS
ActionScript
343
Translate
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

correct answers 1 Correct answer

LEGEND , May 21, 2014 May 21, 2014

The trace output only displays in the Flash Output display panel when testing in Flash.  If you want something to appear in the Flash movie you need to make it that way.  Try adding a textfield and assign the intended result to that.

Translate
Guide ,
May 21, 2014 May 21, 2014

This looks like it might just never reach a point where b=0, so it recurses forever.

Translate
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
LEGEND ,
May 21, 2014 May 21, 2014

When I run it get :

Le PGCD de 27 et de 18 est 9.

traced in the output

Translate
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
New Here ,
May 21, 2014 May 21, 2014

Tks Ned.

Translate
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
New Here ,
May 21, 2014 May 21, 2014

So why i can see nothing on the screen ?

The screen is blank.

Translate
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
LEGEND ,
May 21, 2014 May 21, 2014

The trace output only displays in the Flash Output display panel when testing in Flash.  If you want something to appear in the Flash movie you need to make it that way.  Try adding a textfield and assign the intended result to that.

Translate
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
New Here ,
May 21, 2014 May 21, 2014

Tks Ned.

Translate
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
LEGEND ,
May 21, 2014 May 21, 2014
LATEST

You're welcome

Translate
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
LEGEND ,
May 21, 2014 May 21, 2014

I got the same thing as Ned. Are you looking for output from "Test Movie" or when running a published movie?

Translate
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
New Here ,
May 21, 2014 May 21, 2014

When running a published movie, yes.

Translate
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