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?
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)
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.
Dealman Posted January 7, 2014 Posted January 7, 2014 Not entirely sure if you can do that. Why not just write it like demonstrated?
bandi94 Posted January 7, 2014 Posted January 7, 2014 As far as i know , you can't do that. You must make outside function.
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