JS callback functions

Get help using Construct 2

Post » Sun Dec 29, 2013 10:15 am

How to execute a Construct 2 function from an external javascript function callback?? here's what i am trying to do...
I am trying to call a javascript function using CallJS plugin, after the javascript executes, i need to call (trigger) a function in construct 2 based on the value it receives from the JS function.
Any help would be highly appreciated?
Thanks guys.
ameer.
B
7
S
2
Posts: 18
Reputation: 573

Post » Sun Dec 29, 2013 10:31 am

This might be a bit of a workaround, but would it be possible to set a textbox object to the recieved value and call an on texbox changed event?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Dec 29, 2013 10:39 am

Thanks for the reply. I have already tried this and it works..but i am not looking for this...
basically i am looking to call a function or method in construct 2 from my external javascript, and a simple function returning a value will not do my job. any work around for this?
B
7
S
2
Posts: 18
Reputation: 573

Post » Sun Dec 29, 2013 10:45 am

I meant something like this:

on textbox changed - call function with parameters
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Dec 29, 2013 10:55 am

Hey LittleStain,
I guess looking at these two screenshot will make it very clear of what i am trying to achieve.

www.dropbox.com/s/0jqo4vmds636ez3/capx_events.jpg
www.dropbox.com/s/wzrj3qpmhnvyh1g/js_file_screenchot.jpg

please have a look at them. function myfunc() should be called once it goes under the function PublishtoUserWall and receives a response from it.


B
7
S
2
Posts: 18
Reputation: 573

Post » Sun Dec 29, 2013 11:08 am

The textbox object has the on textbox changed possibility. The text object doesn't.

I think it will work in the way I described above, but if I'm wrong don't sue me.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 42 guests