dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: How to display object value in a textbox?

  1. #1
    Junior Member
    Join Date
    Dec 2015
    Posts
    11

    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.

  2. #2
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,040
    Adobe racey me

  3. #3
    Junior Member
    Join Date
    Dec 2015
    Posts
    11
    it working with trace, but how can change dynamic textfield value, d.text, with the value of the gpc?

  4. #4
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,040
    Did u embed ur font
    Adobe racey me

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    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.

  6. #6
    Junior Member
    Join Date
    Dec 2015
    Posts
    11
    Quote Originally Posted by fruitbeard View Post
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center