Using Functions on Layers/Frames

Hi,

I’m still trying to get used to the code side of wick editor.

How can I utilize a function on a different frame or layer?

hello-world-func.wick (1.3 KB)

Many thanks

Hi Alfo :D

In wick, you can attach functions and variables to the actual project to be able to refer to it anywhere in the editor, like this:

project.my_Function = function (a) {
     alert(a);
}

// In a different object or frame or layer...
project.my_Function("Hello World");

Here’s your same file, but with this added in:
hello-world-func.wick (1.3 KB)

Let me know if this what you were looking for

Fabulous - Many thanks. I don’t know why but I thought that I had already tried that. I’m having one of those kinds of days, I think! :roll_eyes:

1 Like