What's wrong in that script???
if (interface == VLASTNOSTI) {
if (button == 5) {
gVlastnosti.Visible == false ;
}
}
EDIT: Actually, I see the error. Instead of
gVlastnosti.Visible == false ;
it should be
gVlastnosti.Visible = false ;
the == says "is it equal to?" while = says "make it equal to"
And btw, the interface_click function is obsolete now.
The way to do it now is to name the button using the "Script name" field in its properties window, set "Left click" to "RunScript", then double-click its "Click" property. This will create/take you to the function.
Or you could do what I do...just double click the button and it will create/take you to the function. :P
EDIT: No need to quote the entire previous post.
True, but you still have to name the button and set "Left click" to "RunScript" first. :P
I suppose that's true in the 3.0 betas. I was thinking of AGS 2.72.
'Left click' is the default action in 2.72, so while it DOES need to be set to that, YOU (the AGSer) don't have to do it. Unless you've set it to one of the others previously. You DO have to name the Button, though.
But that's beside the point. Mirek, if you're using 2.7 or later, you shouldn't be using interface_click. It works, but it's not good practice. If you're using an earlier version, then carry on. (Once you've made the correction VK Dan gave you.)
Also, in future, make your posts a little more descriptive - why do you think there's something wrong, what is/isn't it doing. is there an error message, etc. Not necessary here, as the problem was so obvious (and I'd guess it was a 'parse error at ... ' error message), but keep it in mind.
O.K. so if I don't have to use interface_click where do I have to place my script?
Did you try this:
Quote from: KhrisMUC on Fri 26/10/2007 15:52:55The way to do it now is to name the button using the "Script name" field in its properties window, set "Left click" to "RunScript", then double-click its "Click" property. This will create/take you to the function.
?
Following these steps will create a function called ButtonName_Click(...).
In there is where your code goes.
Button_click is great idea! :o :o :o It´s really easy to use it!
Actually you could change VLAwhatevery to the number of that GUI.