Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
| Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 31st, 2006, 08:15 AM
Friend of Wrox
Points: 1,075, Level: 12
Points: 1,075, Level: 12 Points: 1,075, Level: 12 Points: 1,075, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: , , United Kingdom.
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default Flash and Javascript (VERY URGENT)

Hi all,
How can I make javascript write out on the same html page flash text variables. the text fields in flash are called var1 and var2 and here is the code im using,


This is the javascript code which calls the variables out of the flash movie which is embeded beneath
<SCRIPT LANGUAGE='JavaScript'>
<!--
function gogogo(){
    var forward1 = Mars Lander.var1
    document.write(forward1);
}
-->
</SCRIPT>



This would be the button which activates the javascript code
<INPUT type="button" name="text" onChange="gogogo()" ><br>

Below is the embedded flash movie
<object name="mars" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="Mars Lander" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Mars Lander.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="Mars Lander.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="Mars Lander" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Please help quickly!

Thanks very much!
__________________
Apocolypse2005, I'm a programmer - of sorts.
  #2 (permalink)  
Old June 30th, 2006, 09:05 AM
Friend of Wrox
Points: 1,075, Level: 12
Points: 1,075, Level: 12 Points: 1,075, Level: 12 Points: 1,075, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: , , United Kingdom.
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

var forward1 = Mars Lander.var1.value
var left1 = Mars Lander.var2.value
  #3 (permalink)  
Old June 30th, 2006, 09:40 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You cannot have an id with spaces in it such as Mars Lander, change it to MarsLander.
You can not write to a loaded page with document.write, you need to set the innerHTML of an element such as a div:
Code:
<div id="divVariables"></div>

//code
document.getElementById("divVariables").innerHTML = <values here>;
--

Joe (Microsoft MVP - XML)
  #4 (permalink)  
Old July 2nd, 2006, 02:12 PM
Friend of Wrox
Points: 1,075, Level: 12
Points: 1,075, Level: 12 Points: 1,075, Level: 12 Points: 1,075, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: , , United Kingdom.
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

So how could incorporate that within my code??


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling Flash w/Javascript GreatRewards ASP.NET 2.0 Basics 5 May 21st, 2008 06:39 PM
javascript started killing flash nairaby HTML Code Clinic 1 August 28th, 2007 11:47 PM
javascript control over flash catchrohith Classic ASP Basics 0 November 8th, 2006 05:54 AM
JavaScript & Flash lmod Javascript 2 September 6th, 2005 10:18 AM
calling javascript from flash Adam H-W Flash (all versions) 2 March 17th, 2004 11:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.