Solved

Passing Flash Variable to JavaScript Function

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

Technology Partners: 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

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
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…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

749 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