-
How to display object value in a textbox?
I make in the stage to input textfiled, with instance name x and y.
After that a dynamic textfield to display the gpc(greatest common factor) of the a and b numbers.
In a class, named gpc,I have the public function whice calculate the gpc of two numbers, and a function get Gpc to return the Gpc.
On Timeline , on Actions, I call the function:
var a=Number(x.text);
var b=Number(y.text);
var gpc= new Gpc(a,b);
trace(gpc.getGpc());
It's working.
But I want to display the gpc value as string in the dynamic textfield(instance name: d).
How?
I try d.text=gpc.getGpc();...not working.
Please help.
Last edited by glyd; 12-18-2015 at 04:03 PM.
-
Client Software Programmer
-
it working with trace, but how can change dynamic textfield value, d.text, with the value of the gpc?
-
Client Software Programmer
-
.
HI,
You should attach files sometimes or at least give the whole code of all files used, makes things easier.
I am surprised you wree not getting any such errors like.
A conflict exists with inherited definition flash.display : DisplayObject.x in namespace public.
When using x and y for your textfield names.
CS6
Last edited by fruitbeard; 12-19-2015 at 11:05 AM.
-
Originally Posted by fruitbeard
HI,
You should attach files sometimes or at least give the whole code of all files used, makes things easier.
I am surprised you wree not getting any such errors like.
A conflict exists with inherited definition flash.display : DisplayObject.x in namespace public.
When using x and y for your textfield names.
CS6
Indeed, it was a conflict between a variable name and an instance name.
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|