How do I getchildbyname? Eg. GetChildByName("txt1").text="2"

0 favourites
  • 7 posts
  • Can I have access to a textbox control by specifying its name and then set its text that way ?

    Example:

    getChildByName("txtName").text = "Banson";

  • as far as I know getChildByName is not a construct2 event/expression..

    There are many other ways to pick the right textbox though, if you could explain what it is you want to do at what time?

  • You should be able to put exactly that in a "Browser: Execute JavaScript" event though.

    I use that same behavior to transfer information between my Java servlets on the backend and my C2 HTML/JS on the front.

  • Hello LittleStain, I realize that IID is the way to go now, now the question now is:

    Is there a way to retrieve an object based on its IID ?

  • You can create new instance variable to compare or pick UID when it's selected

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello LittleStain, I realize that IID is the way to go now, now the question now is:

    Is there a way to retrieve an object based on its IID ?

    I guess UID would be a possible way to go, you could ofcourse also use instance variables..

    If you could give an example of what you'd like to do it would be much easier to answer your question..

    I could tell you every objects has the condition "pick by unique ID", but it could very well be this is not the best solution in your specific case..

  • All of you have been very helpful, pick nth instance is the way to go for me here

    Thank you everyone, the solution for my particular case is pick nth instance.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)