I want to print a variable auth in the flashplayer.
For example:
var auth = x1c0de;
mplayer("content").setup({
playlist: [{
sources: [{
file: 'http://dnswebsite.tld/appz?UserSign="I WANT MY auth VAR HERE"/playpath',
}]
}],
});
file: 'http://dnswebsite.tld/appz?UserSign="' + auth + '"/playpath'
Is this what you're looking for ?
I'm confused by the simplicity of this... I must have missed something.
EDIT:
This is the snippet you gave me in your comment:
$.ajax({
url: your_url,
type: 'GET',
success: function (res) {
var text = res.responseText;
var auth = text.match("BEGIN(.*)/END");
}
});
mplayer("content").setup({playlist: [{sources: [{file: 'http://dnswebsite.tld/appz?UserSign="I WANT MY auth VAR HERE"/playpath'}]}]});
Your problem is that your variable auth is stucked inside the scope of your success callback function. This should solve the problem:
var auth;
$.ajax({
url: your_url,
type: 'GET',
success: function (res) {
var text = res.responseText;
auth = text.match("BEGIN(.*)/END");
}
});
mplayer("content").setup({playlist: [{sources: [{file: 'http://dnswebsite.tld/appz?UserSign="' + auth + '"/playpath'}]}]});
x1c0desupposed to be a string? Search for "string concatenation".