turning off "pf_singleglobal"-flag causes issues

For developers using the Construct 2 Javascript SDK

Post » Mon Mar 26, 2012 2:40 pm

In a plugin project Im testing, I have a array which I store information in. I create a new instance of a simple function and store them in the array. So the array will have couple of those functions.
For this I have set the "pf_singleglobal" flag for the project, to avoid creating several instance/objects of my plugin.

But now I want to move away from the array-list, so instead of one array iteration, I want to have one instance/object instead. So to avoid problems I make it backward compatible, by saving the old functions and make them deprecated, and creating new ones. But when I remove the "pf_singleglobal" flag, the old version with the array-list stops working, while the new functions works as it should.

I dont get any error messages when starting the project in a browser, it just doesnt work, as if the actions are ignored.

The array was, and is created in the instanceProto.onCreate function.So it is not a global array. So the really only difference between the new version, which doesnt work, and the old version, is the "pf_singleglobal" flag is turned on/off.

Does this flag change anything more than "just" making it global inside a project?
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest