Jump to content

Another Question. Fast Answer Please.


xScatta

Recommended Posts

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?

Link to comment

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) 

Link to comment

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.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...