Use Variable in "Jump to URL/File" trigger
Nov 09, 2012
Hi everyone,
I'm trying to let people share their quiz results on Facebook.
For that, I'm would like to use the "Jump to URL/File" trigger, and uses the Facebook sharer URL.
So far so good.
To make it more interesting, I'm trying to add the user's score in the Facebook post. Something like: "I just got 65% on the quiz. Can you beat my score" type of thing.
To get it going, I've started by a really simple test:
- one blank slide, with a button "share"
- I've also defined a variable called "test". The default value is 5
- the button has a trigger "jump to URL"
- the trigger is set to redirect to http://www.ourdomain.com?id=%test%
When publishing the page for web, in flash, and clicking the button, I am directed to http://www.ourdomain.com?id=%test% instead of http://www.ourdomain.com?id=7
Is that normal or am I doing anything wrong ?
Cheers
Greg
6 Replies
Hi Admin,
I think variable subsitution only works when displaying it as a reference in a textbox.
What you can do, is use JAVA script to do what you want.
You can send variables to JAVA using
var player = GetPlayer();
var email=player.GetVar("MyVariable");
Of course you'll need to add the bits & pieces to upload it onto Facebook...
Cheers
Geert
Thanks Geert
I feared that might be the case..
Unfortunately, that code doesn't work in the flash output, it only works in the HTML 5 output, which we can't use as some of the interactions we want don't work too well..
The JavaScript works great in the Flash output. You'll have trouble seeing it locally unless you setup your Flash security settings manager to clear the folder or use the Publish to CD option. But it should work consistently from a Web server.
The JavaScript used to work exclusively within Flash before the first update. JS won't work in the Articulate Mobile Player at the moment. But should work flawlessly in HTML5 and Flash based outputs.
Hi,
yep, got it to work when it's uploaded on our server. It doesn't work "locally" though, which is odd.
Thanks for the tips, all working perfectly now. Happy to post the code if anyone is interested.
Cheers
Greg
It's a Flash security "feature" They don't let the plug-in execute external calls locally unless the folder has been cleared.
HI,
sorry for bumping up this old thread.
Has anyone an idea how to accomplish this with the ipad app?
Would be great!
Thanks
Johanna
This discussion is closed. You can start a new discussion or contact Articulate Support.