Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-11-2004, 08:00 PM   #1
kharris
Registered User
 
Join Date: Nov 2004
Posts: 1
Default I need a bit of javascript help

I have a flash movie that when you reach the end of it is launches a pop-up window based on the results of the information you were submitting. The flash file uses a seperate .as file to store the functions for the movie.

What I am wanting to know is how I can modify this page so that it goes to a new page instead of opening up a pop-up window.

Here is the code.

<code>

function checkProfile()
{

if(final[0] == "")
return "Error: Name is required.";

if(final[5] == "")
return "Error: Email Address is required.";


resultAs = emailCheck(final[5]);

if(!resultAs)
return resultAs;

return true;
}


function emailCheck(emailAddress)
{
if((emailAddress.indexOf("@") == -1 ) || (emailAddress.indexOf(".") == -1 ))
return "Error: Please Enter a Valid Email";
return true;
}


function sendData()
{

// RESET OUTPUT
output = "";

output += "'" + final[0] + "',"; // NAME
output += "'',"; // ADDRESS
output += "'',"; // CITY
output += "'',"; // STATE
output += "'',"; // ZIP
output += "'" + final[5] + "',"; // EMAIL
output += "'',"; // HANDICAP
output += "'',"; // UPDATES
output += "'" + final[8] + "',"; // SHAFTTYPE

// CONTROL/DISTANCE
if(final[9] <= 100 && final[9] >= 34)
weightNum = 1;
else if(final[9] <= 35 && final[9] >= -34)
weightNum = 2;
else if(final[9] <= -35 && final[9] >= -100)
weightNum = 3;

output += "'" + weightNum + "',";

// BALL FLIGHT (1,2,3)
output += "'" + final[10] + "',";

// DETERMINE FLEX (1,2,3,4,5)
speed = int(75 + ((200-final[11])/400) * (40))

// HERE IS THE SWING SPEED RANGE FOR WOODS
//////////////////////////////////////////
if (speed < 76){
output += "'" + 1 + "'";
}
else if (speed < 86){
output += "'" + 2 + "'";
}
else if (speed < 96){
output += "'" + 3 + "'";
}
else if (speed < 106){
output += "'" + 4 + "'";
}
else if (speed < 116){
output += "'" + 5 + "'";
}
else {
output += "'" + 3 + "'";
}



me ="javascript:ustResultWindow(" + output + ")";
getURL(me);

</code>

The line that confuses me most is this one: me="javascript:ustResultWindow("+output+")";

More specifically the - javascript:ustResultWindow - line
kharris is offline   Reply With Quote
Old 11-11-2004, 09:18 PM   #2
Ruben
Me
 
Ruben's Avatar
 
Join Date: Jul 2002
Location: Netherlands, Europe
Posts: 3,510
Send a message via MSN to Ruben Send a message via Skype™ to Ruben
Default

well probably there's a javascript-function writting in the html-file in which the swf is embedded, it would look somewhat like this (wild guess ):
Code:
function ustResultWindow(zzz){
  window.open(zzz);
}
ignore the "zzz", it varies...anyways, getURL("javascript:ustResultWindow('blabla');"); calls a javascript-function, getURL() is usually used to go to different webpages, but you can also use it to call javascript-functions with...

window.open() is the javascript-code for opening a new window (hey, I guess you kinda figured that one out yourself )...so if you want to open the webpage in the same window you gotta modify the function like this:
Code:
function ustResultWindow(zzz){
  window.document.href = zzz;
}
- Ruben
__________________
.
Originally Posted by MichaelxxOA
"He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit."
Ruben is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:29 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.