Problem with variables and edit box

For questions about using Classic.

Post » Sat Nov 27, 2010 11:29 am

Hi i have one problem with variables and editbox.
I need set variable in editbox and show variable from editbox to text. But it do not works. Please help me. I give here my cap file to check this file and help me.
Really please.

Cap file here:
http://www.ourupload.xf.cz/soubory/3873/problem.rar
B
24
S
4
G
2
Posts: 318
Reputation: 2,446

Post » Sat Nov 27, 2010 12:00 pm

Since you're doing this:

[code:qxf2qowr]+ System: Always (every tick)
-> Text: Set text to global('o')
-> System: Set global variable 'o' to global('o')
[/code:qxf2qowr]

it can't really work. You're setting the text to the global variable 'o' and you're setting the global to it's own value, which naturally doesn't change anything.

If you want to do what I assume, which is setting the global variable to the editbox text and then displaying that global variable with the text object, you need to set the global to Editbox.text. Also you should switch the order of the actions in that case. And if your global would be holding a string it's probably better to set its Type to TEXT instead of NUMBER.

You could also just do this of course:

[code:qxf2qowr]+ System: Always (every tick)
-> Text: Set text to EditBox.text
[/code:qxf2qowr]

I guess there was some point in using the global.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Nov 27, 2010 1:38 pm

Sorry my fail bad cap file :oops:
B
24
S
4
G
2
Posts: 318
Reputation: 2,446


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests