CS3 - AS2
I got ahead of myself yesterday. I thought I had things working, and they are, BUT only in IE8 - Compatibility on. In Firefox, Safari, Opera, Chrome, and IE8 Compatibility - off. Using the code Nathan99 (very helpful) was kind enough to provide me I still have a hiccup and need a bit more advice.
I am sending a URL to a javascript function from AS2 using the code below in the SWF:
function fileStr() {
var today=new Date()
return today.getMonth()+1+''+today.getDate()+''+today.getFullYear()+''+today.getHours()+''+today.getMinutes()+''+today.getSeconds()
}
var movieName:String = "vm" + fileStr();
import flash.external.*;
// The name of a JavaScript function to call
var callJasFunction:String = "callJavascript";
//parameter
var msg:String = 'http://mymail.playourvideo.net/vmplayer.htm?ID=' + movieName + '.flv';
// The return value after calling JavaScript
var returnValue:String = ExternalInterface.call(callJasFunction, msg).toString();
I am trying to pass the URL and place it in a hidden form field so I can use the sting in a php routine that automatically generates and sends an eMail. Shown below is the Javascript in my HTML.
<script language="JavaScript" type="text/javascript">
var mailLink;
function callJavascript(str) {
mailLink = str;
updateField();
return 'GotIt';
}
function updateField() {
document.getElementById('dynamiclink').value = mailLink;
}
</script>
<br> <font color="#FF0000"> * * * * REQUIRES Internet Explorer * * * * If IE 8 or higher REQUIRES Compatibility Mode * * * *</font> <br>
<form name="mailIt" method="POST" action="xsendvm.php" enctype="multipart/form-data">
<p> User <label>ID:</label><!--webbot bot="Validation" b-value-required="TRUE" i-minimum-length="4" i-maximum-length="4" --><input type="text" name="acct" size="4" tabindex="1" maxlength="4">
<label> Sender:</label><input type="text" name="sname" size="30" tabindex="2"> <label>Recipient:</label><input type="text"name="rname" size="30" tabindex="4"></p>
<label> Email :</label><input type="text"name="semail" size="30" tabindex="3"><label> Email :</label><input type="text" name="remail" size="30" tabindex="5"><br>
<p> <label> Message:</label><textarea rows="4" name="message" cols="60" tabindex="6"></textarea></p>
<p>
<input type="hidden" name="dynamiclink" value="hidden">
<input type="submit" value="Send" name="B1" tabindex="7"> </p>
</form>
Using IE8 - Compatibility - on I get this result.
In all other cases I see something like this.
I’d really like to get this work on my project web site if any here can help.
Regards - Jim
ps: As an aside, I really don’t need to pass anything back for anyreason to AS2 but as I know little to nothing about AS2 I pretty much had to use the example code I found on Adobe’s web site.