[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Can ActionScript be used to pass info to JavaScript?

Posted on 2004-10-29
2
Medium Priority
?
200 Views
Last Modified: 2010-04-03
I need a way of getting an often-changing 256 character string of data
into a JavaScript. Ordinarily (of course), I'd just put the string into a
separate, external file and call it in using <script src="256characterstring.js">.

Problem is, I'm prohibited from using iframes, javascript includes, etc.
But I can use Flash.

So my question is this... can the 256 character string be embedded
somehow into a flash file in such a way that it can be read and acted
upon by Javascript?

Knowing absolutely ZIP about ActionScript, it would seem like you could
create something and give it a title of "1234567890...." and then
using DOM inside of JavaScript get the title of that object.

If that makes ANY sense at all.. I appreciate your comments, feedback.


0
Comment
Question by:sleepybear
2 Comments
 
LVL 1

Accepted Solution

by:
Tony_Goodman earned 1500 total points
ID: 12447507
There are a few different ways you could do this, here is a web site to look at for some examples:
http://www.macromedia.com/support/flash/ts/documents/java_script_comm.htm

One easy way to do it is to create a text box on your flash file somewhere and call that variable value in javascript.  Here is the javascript code:
parent.Stat.document.LFrame.SetVariable("_root.Qtr.text",document.SAS.Qtr.value);

Also, you can call a javascript function from flash
Ex: getURL("javascript:parent.Main.Receive();","Main");

If needed, you could pass values in the function call

Hope this helps,
-Tony
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

591 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