Copy link to clipboard
Copied
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 + ".");
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.
Copy link to clipboard
Copied
This looks like it might just never reach a point where b=0, so it recurses forever.
Copy link to clipboard
Copied
When I run it get :
Le PGCD de 27 et de 18 est 9.
traced in the output
Copy link to clipboard
Copied
Tks Ned.
Copy link to clipboard
Copied
So why i can see nothing on the screen ?
The screen is blank.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Tks Ned.
Copy link to clipboard
Copied
You're welcome
Copy link to clipboard
Copied
I got the same thing as Ned. Are you looking for output from "Test Movie" or when running a published movie?
Copy link to clipboard
Copied
When running a published movie, yes.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now