/    Sign up×
Community /Pin to ProfileBookmark

accessing variable delays

I am using Captivate to create a quiz. The output of the score is sent via email. I have a javascript function that intercepts this email, strips out the score and then forwards the result to another application in this case another flash object.

The problem I have is that when I submit the score the function returns undefined, but when I click the submit button a second time the function returns the score.

It is almost as if there is a delay in getting the value from the captivate generated flash object into the javascript function

My question: Can I introduce a delay of some sort in the function or some kind of ‘watch’ that checks for a value before it passes this information on.

Thanks in advance.

T.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayMay 17.2006 — Off the top of my head maybe a simple try block with setTimeout:
[code=php]
function chk4Var(){
try {
var tempVar = yourVar; //if undefined should drop to the catch block
contFunc();// the function containing the code to be executed
}
catch (e) {
setTimeout("chk4Var()",10000);
}
}[/code]
×

Success!

Help @triaz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...