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
27
S
18
G
8
Posts: 327
Reputation: 6,154

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
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

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
27
S
18
G
8
Posts: 327
Reputation: 6,154


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests