Solved

Passing Flash Variable to JavaScript Function

Posted on 2004-09-01
5
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

710 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