User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 330,112 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,113 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1326 | Replies: 3
Reply
Join Date: May 2006
Location: NJ
Posts: 37
Reputation: sandbox is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
sandbox's Avatar
sandbox sandbox is offline Offline
Light Poster

using javascript to communicate with flash

  #1  
Mar 10th, 2007
i've been doing some research on fs command, but i haven't found a true answer to my problem. What i would like to do is load an image into a flash file using the loadMovie("image.jpg") command. I want to do this so i could use the same flash container on each of my pages, but change the image that appears each time. Any ideas how i could do this?

I guess i was looking for something like this:

<script language = "JavaScript"><!--
function PassFlash(){
    window.document.movie.SetVariable("text", "hello");
}
//-->
</script>

But the only problem with this script is that i need to assign a button with this variable name and i need to click it to make the image load. This is also an old script (for an older version of Flash Player). All i want to do is have the image load when i start the page.

Thankyou in advance.
piratemon.day.be - My grass is always greener
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2006
Location: Deptford, London
Posts: 899
Reputation: MattEvans will become famous soon enough MattEvans will become famous soon enough 
Rep Power: 4
Solved Threads: 43
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Practically a Posting Shark

Re: using javascript to communicate with flash

  #2  
Mar 11th, 2007
You can pass query string data into flash movies. That is; if you put something like:

mymovie.swf?myar=hello&

Wherever you'd normally write the name of a movie (i.e. in the object tag value and/or embed tag src); then that variable "myvar" will be available from the _root object within flash (in this case; _root.myvar will be equal to "hello")

this page explains it in a bit more detail:
http://www.permadi.com/tutorial/flas...ng/index2.html

that's probably the cleanest way to do what you're trying to do. Let me know if it works; I've not used Flash versions past about 6... but, I don't see any reason why they'd remove this feature in a present version..
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,267
Reputation: vishesh is on a distinguished road 
Rep Power: 4
Solved Threads: 29
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: using javascript to communicate with flash

  #3  
Mar 13th, 2007
The thing you could do could be done as Matt said. Here's another thread, not exactly same but will give you a drift http://www.daniweb.com/techtalkforums/thread58249.html
Reply With Quote  
Join Date: Mar 2007
Posts: 83
Reputation: rgtaylor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
rgtaylor rgtaylor is offline Offline
Junior Poster in Training

Re: using javascript to communicate with flash

  #4  
Mar 23rd, 2007
Have the dynamic page, php, jsp or even javascript write the file name to the init parameters for the flash movie embed tag...then the flash move can load whatever file is indicated as it init parameters...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Marketplace (Sponsored Links)
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 1:14 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC