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

Get help using Construct 2

Post » Tue Jul 28, 2015 8:30 am

Can I have access to a textbox control by specifying its name and then set its text that way ?
Example:
getChildByName("txtName").text = "Banson";
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Tue Jul 28, 2015 10:24 am

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?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 28, 2015 4:15 pm

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.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Wed Jul 29, 2015 6:45 am

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 ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Wed Jul 29, 2015 7:46 am

You can create new instance variable to compare or pick UID when it's selected
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Wed Jul 29, 2015 8:01 am

Toddler wrote: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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jul 30, 2015 2:00 pm

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.
B
12
S
3
Posts: 288
Reputation: 1,694


Return to How do I....?

Who is online

Users browsing this forum: bluesun66 and 11 guests