Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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.
Reply With Quote
  #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
Reply With Quote
  #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)
Reply With Quote
  #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??
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:59 PM.


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