xScatta Posted January 7, 2014 Posted January 7, 2014 Hey Guyz. I have a question look at the code. addEventHandler(EventName5,ElementAttached8,function () ... ) and i want to do something like this removeEventHandler(EventName5,ElementAttached8,PROBLEM) in PROBLEM how can i specify the function if i don't do another function outside event handler? It's fine to celebrate success but it is more important to heed the lessons of failure.
Dealman Posted January 7, 2014 Posted January 7, 2014 Not entirely sure what you're asking. But I'm assuming you want to be able to add and/or remove an event handler from a function. Simply write it like this; function exampleCode() if(Something == SomethingElse) then removeEventHandler("SomeEvent", getRootElement(), exampleCode) end end addEventHandler("SomeEvent", getRootElement(), exampleCode) If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
xScatta Posted January 7, 2014 Author Posted January 7, 2014 But i mean to remove event handler from function "builded" in event handler not outside. just like that Correct addEventHandler(...,...,function () ... end) - - - - - - - - - Bad addEventHandler(...,...,FunctionName) And i want to remove event handler from the Correct version. It's fine to celebrate success but it is more important to heed the lessons of failure.
Dealman Posted January 7, 2014 Posted January 7, 2014 Not entirely sure if you can do that. Why not just write it like demonstrated? If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
bandi94 Posted January 7, 2014 Posted January 7, 2014 As far as i know , you can't do that. You must make outside function. Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now