Solved

Passing Flash Variable to JavaScript Function

Posted on 2004-09-01
5
255 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
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 how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

789 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