Passing Flash Variable to JavaScript Function

Hey,

I have the following code in Flash attached to a button...

var address = _root.BENCB.Main.BEN_MAIN.Options.EmailPage.text;
getURL("javascript:GoEmail('"+address+"')");

which leads to...

function GoEmail(address) {
window.document.getElementById("WorldLayer").style.left = "151.3";
window.document.getElementById("WorldLayer").style.top = "162.3";
window.document.getElementById("WorldFrame").src = address;
window.document.getElementById("WorldLayer").style.visibility = "visible";
}

and when run in the html i get an error complaining that an "object expected."

any thoughts as to why it isn't liking this procedure?

thanks.
AlexSilvermanAsked:
Who is Participating?
 
muso120999Connect With a Mentor Commented:
If you put:

alert("Address: ["+address+"]");

in GoEmail, what does it say?
0
 
AlexSilvermanAuthor Commented:
in the javascript, or in the flash call to GoEmail?
0
 
muso120999Commented:
After "function GoEmail(address) {" in the JavaScript

I just want to see what kind of value is being passed to it
0
 
AlexSilvermanAuthor Commented:
ugh, and now it is suddenly not giving me the object error... no idea what changed in terms of getting passed in there, but now it is happy.

novice javascripter obviously, thank you for the alert tip.
0
 
muso120999Commented:
Okay, well at least it's working!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.