Solved

Passing Flash Variable to JavaScript Function

Posted on 2004-09-01
5
250 Views
Last Modified: 2008-03-04
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.
0
Comment
Question by:AlexSilverman
  • 3
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
muso120999 earned 500 total points
ID: 11961385
If you put:

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

in GoEmail, what does it say?
0
 

Author Comment

by:AlexSilverman
ID: 11963598
in the javascript, or in the flash call to GoEmail?
0
 
LVL 10

Expert Comment

by:muso120999
ID: 11964315
After "function GoEmail(address) {" in the JavaScript

I just want to see what kind of value is being passed to it
0
 

Author Comment

by:AlexSilverman
ID: 11964582
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
 
LVL 10

Expert Comment

by:muso120999
ID: 11964608
Okay, well at least it's working!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question