Use 3rd party JS libraries (including JQuery), call Javascript functions, access object properties and methods. Implement game objects, and algorithms in Javasc...
I tried it out recently and overall it looks pretty useful. Awesome.
One thing I noticed is that return values do not work if the returning is delayed, in my case I had to load an image onto a canvas, process some stuff and then return it. In order to properly load the image I had to wait for image.onload, the plugin didn´t wait and always returned 0. I worked around it by loading the image in a previous function, but it would be great if there was a trigger event like "on function 'functionCall' value returned" to allow this sort of things.
Can you show me the code of the function that you're talking about? The one that returns 0?
Hmm I already changed it, but I actually think I know the issue. What I did was
function loadImage(img){
var image = new image();
image.onload = function() {
return "whatever";
}
image.src = img;
and if I´m not mistaken the "return" on that place will not return the value where I need it to be returned. My b!
Yes, you're right, that's the issue.
If you have a callback function like image.onload and want Construct to know when it happens, you can call a Construct function (Function plugin) right from javascript. Read here: scirra.com/manual/149/function («Javascript integration»)