laserlaser Posted May 19, 2012 Share Posted May 19, 2012 (edited) Hi everyone, I'm scripting the animation class.But I have an problem at timer... It's the first code _G["animateComplete"] = function() -- animate complete content end _G["animateBack"] = function() -- animate back content end anim.animateComplete = animateComplete anim.animateBack = animateBack 2 Function works fine at class functions.EX: function Animation:Play() addEventHandler('onClientRender',getRootElement(),self.animateComplete) end It works.But I Have problem because 2 doesn't work at other functions: function addAnimBack(animfunc) -- outputChatBox(type(animfunc)) but it outputs "nil". addEventHandler("onClientRender",getRootElement(), animfunc)-- this isn't work because it's nil. end function Animation:animFinished() if isTimer(self.backTimer) then -- bla bla else removeEventHandler("onClientRender",getRootElement(), self.animateComplete) if (self.animateProperties.onFinishBack >= 50) then -- outputChatBox(type(self.animateBack)) == It outputs "function" self.backTimer = setTimer(addAnimBack,self.animateProperties.onFinishBack,1,self.animateBack) return end end -- blala blala end Where is the problem? Why timer sends nill ? Edited May 21, 2012 by Guest Link to comment
Jaysds1 Posted May 20, 2012 Share Posted May 20, 2012 Sorry that no one replied to this but, if you can, can you change those to tags please, next, what is this animation class? Link to comment
Kenix Posted May 20, 2012 Share Posted May 20, 2012 You not define this variable: animfunc Link to comment
laserlaser Posted May 21, 2012 Author Share Posted May 21, 2012 Sorry that no one replied to this but,if you can, can you change those to tags please, next, what is this animation class? It's for animate the GUI Elements. You not define this variable: animfunc Oh wrong copied.Still doesn't work. Link to comment
Jaysds1 Posted May 21, 2012 Share Posted May 21, 2012 Can you pm the whole code and I'll see what's wrong, cause I don't see anything wrong here except for that "animfunc". Link to comment
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