Python to construct variable help

For questions about using Classic.

Post » Tue Jan 25, 2011 7:19 pm

Okay, so say I wanna transfer a variable from python. What am I doing wrong here?

First I make a pyscript

[code:3ar1qtbu]Word=1[/code:3ar1qtbu]

Then I make an even that says at the start of layout set text to [code:3ar1qtbu]python("Word")[/code:3ar1qtbu] and I keep on getting a message saying Word isn't a recognizable variable.
B
5
S
2
G
3
Posts: 36
Reputation: 1,622

Post » Tue Jan 25, 2011 10:12 pm

Unless you put the python script as a sub event of "Start of Layout" it will be run on the first frame. Everything under "Start of layout" will be run before the first frame. So "Word" doesn't have a value at the start of the layout, hence the error.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Wed Jan 26, 2011 1:10 pm

Didn't even realize that till now, thanks.
B
5
S
2
G
3
Posts: 36
Reputation: 1,622


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests