capture gesture in Javascript

49 views
Skip to first unread message

Mohamad Zain Aziz

unread,
May 26, 2012, 6:19:12 AM5/26/12
to comman...@googlegroups.com
Hi,

I followed MouseCoords example downloaded from Github and it worked.

Then I created a page with a pan gesture and inserted the script below
in the Script property so that I can read the x and y values in
Javascript.

CF.getJoin("s1", function(j,v,t){ console.log("Token at join:" + j
+ " value:" + v + " token:" + t["[x]"] );});

The other property values are:
Assign join value = True
Join Type = Serial
Join Number = 1
Assign Token = False
Value = [x],[y]

But it didn't work. The result I get when I drag my finger across the screen is:

"Token at join:s1 value:null token:undefined"

Appreciate any assistance.

Thank you.

Zain

Jarrod Bell

unread,
May 26, 2012, 6:40:00 AM5/26/12
to comman...@googlegroups.com
Do you have an object with serial join 1 in your GUI?

Jarrod

Mohamad Zain Aziz

unread,
May 26, 2012, 7:14:11 AM5/26/12
to comman...@googlegroups.com
I created a serial text object with join 1 and that solved it.

In the MouseCoord example, I see the parameters gesture.x and
gesture.y. However I do not see any other reference to these names in
the program. Can you elaborate on this?

Thank you

Zain
> --
> You received this message because you are subscribed to the Google Groups
> "CommandFusion Software" group.
> To post to this group, send email to comman...@googlegroups.com.
> To unsubscribe from this group, send email to
> commandfusio...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/commandfusion?hl=en.
>

Jarrod Bell

unread,
May 28, 2012, 10:55:33 AM5/28/12
to comman...@googlegroups.com
The gesture object is automatically created for you when calling
JavaScript from a gesture.
See here for the docs that explain it in detail:
http://www.commandfusion.com/docs/scripting/startup.html#gesture_action_Javascript

Jarrod
Reply all
Reply to author
Forward
0 new messages