What, how to declare a variable or the logic you could use around one?
Just right click event sheet, add global variable.
It's then global to all event sheets, not just the one you create it on.
So with that in mind.. one way to make it work..
Curr level layout start - assign global variable to "Layout1"
On victory load "you win" layout
On "you win" layout, check the global variable (system>compare variable). If it is "layout1" then load "Layout2". If it is "Layout2" then load "Layout3" and so on.
If you are using numbered layouts as above, you can massively cut down on the events by storing level number, adding 1 to it, and concatenating your new name then use System>Load Layout by name.
1, My layouts are called "MyLevelX" where X = level number
2, I load level 2. My global "LevelNo"is set to 2. I beat level 2.
3, In my "victory" layout I load the next layout by name simply as "Mylevel" & LevelNo+1 (which makes a string "MyLevel3" in this case).