Jump to content
Search Community

Pass Variables in Loop - eventCallback

dazzafact test
Moderator Tag

Go to solution Solved by dazzafact,

Recommended Posts

  • Solution

 

How can i pass variables from a Loop
i expect to access Values param1,param2,param3,etc
But it always gives the last key param13

 

for (i in $slideTextArr){
let y=i;
slideAni.eventCallback("onStart", function(t){
                console.log(t) // always last key "param13"
            }, ["param"+y]);

}

UPDATE Solution:

 

for (i in $slideTextArr){
  let y=i;
  slideAni.to(textMesh[i],{
		onStart:function(t){
			console.log(t)
		},
		onStartParams: ["param"+y]
	})
}

 

Link to comment
Share on other sites

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...