Accessing Private variables from Python?

For questions about using Classic.

Post » Sat Mar 26, 2011 2:21 pm

Is it possible to access private variables from Python?

I've been trying to get expressions like
[code:3vrx0x9k]Sprite.Value( 'privateValueName' )[/code:3vrx0x9k]
to work in python, but so far it seems like I only get back some kind of null value.
B
26
S
17
G
8
Posts: 323
Reputation: 6,019

Post » Sat Mar 26, 2011 5:17 pm

[quote:2mya6rua]Is it possible to access private variables from Python?[/quote:2mya6rua]
Yep, exactly the way you posted. If the variable name you use does not match any of the Sprite's private variables NULL will be returned.
B
91
S
31
G
99
Posts: 5,199
Reputation: 65,684

Post » Sat Mar 26, 2011 11:49 pm

Okay awesome, I just built another test cap to try it out in a simpler environment and it works.

What worried me is that I had tried a simple test earlier and gotten back nothing, so I must have just done something wrong without noticing.

Thanks. :)
B
26
S
17
G
8
Posts: 323
Reputation: 6,019


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests