This content has been marked as final. Show 7 replies
you can't nest named functions and expect the inner function to be defined. using an anonymous function for the inner function works.
but the inner functions are not called upon by anything else but one another. But your saying that if the inner functions (those that i am trying to nest in one generic function) are anonymous, then i will not have any problems?? So all my problems are caused by the inner functions having names?? This doesnt make sense to me. Why would the names of the inner functions effect the scope??
I think i must be misinterpreting what your saying. Further explanation would be greatly appreciated.
Thanks again for you help
if your nested function is only called by the outer function, you should be ok.
but that's terrible coding: you have 3 nested functions. unnest them unless absolutely necessary.
and why are you checking if i>12? when could it be anything other than 1?
and "this" in your onMotionFinished() function is probably referencing the tween. use the trace() function to check.
It does look a bit messy but its not my coding. I am editing a template to perform tasks i want it to do. All i want is for that code i posted there not to run on the entry of that frame. I want to be able to call it on an event. Can you suggest a better way of doing this??
Also it is checking if i>12 because it is only loading 12 items. And it can be a value greater then 1. See how it sets an interval to run the Gen function, not the effects function where you are seeing the "var i = 0".
And it is referencing the tween but why will that make a difference.
Thanks again for your help,
oh, i see. try:
YES!!! It finally worked.
Thanks for ya help kglad. Will no doubt be in touch with another problem soon lol