2
Can anyone tell me what kind of object allows me to make a value matrix and a function similar to the code below and script 3 action? If it were in Java you could do something like this:
My Interface:
package test;
public interface MyInterface {
public void alert();
}
And my class with the use of Interface:
package test;
import java.util.HashMap;
import java.util.Map;
public class MyClass {
public static void main(String[] args) {
Map<Integer, MyInterface> map = new HashMap<>();
map.put(1, new MyInterface() {
@Override
public void alert() {
System.out.println("valor 1");
}
});
map.put(2, new MyInterface() {
@Override
public void alert() {
System.out.println("valor 2");
}
});
}
}
I don’t understand. The function already exists in that class?
– bfavaretto
There is. I wanted to pass any function with argument from my matrix understood? can be something like that too.. map.put(value, Alert("test"));
– Vinícius Carneiro de Brito
I removed my answer because the question is now another. I had not realized that it was from the Java Map that you were talking about. I’ll leave it to someone who knows more Java answer...
– bfavaretto
No cara se Voce conhecer algum objeto que eu possa usar ou outra forma, ajuda ae @bfavaretto
– Vinícius Carneiro de Brito
Dude, my Java is not the best, and my AS3 is pretty rusty, I haven’t used it in years. But I tried a new answer, see if it works.
– bfavaretto