Click to See Complete Forum and Search --> : Form to load another page in another frame


Brianstein
07-27-2003, 10:31 PM
Ok im stuck because im doin 101 stupid ways to die and i have 101 .swf files and i want the user to put a number (1-101) in a text field then click subit and it loads the correct file in another frame. all the .swf files are name 1.swf, 2 .swf, 3 .swf, etc.

here is what i have so far but it is VERY buggy:

<html>
<head>
<title>101 Stupid Ways to Die</title>
<script>
<!------------

function loadSwf(helloFoo) {

document.writeln('<a href=' + '"' + helloFoo + '.html' + '"' + '>Click Here to see the way</a>');
}
------------------>
</script>
</head>
<body>
<form name="pickForm" onSubmit="loadSwf(parent.document.pickForm.numberToLoad)">
<input type="text" name="numberToLoad" value="1" onChange="loadSwf(this);">
<input type="button" value="Load the Stupid Way to Die" onClick="loadSwf(this);">
<input type="submit" value="Submit">
</form>
</body>
</html>

webHeretic
07-28-2003, 01:37 AM
If you know Flash, I think it would be easier to create an empty movie clip as a target and loadMovie the .swf's into it.

If you don't know Flash, try this:

function loadSwf(helloFoo) {
self.frames["your_frame_name_here"].location=helloFoo+".html";
}