Closed
Bug 361645
Opened 19 years ago
Closed 17 years ago
Flash (*.swf) functions are not called in JavaScript, but works fine with IE and Opera
Categories
(Core Graveyard :: Plug-ins, defect)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: didpub1, Unassigned)
Details
(Whiteboard: closeme 2009-04-20)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1) Gecko/20061010 Firefox/2.0
1. Using Macromedia Flash 8, I have created a calendar object "calendrier_flash" to choose a date.
2. A text input field displays the date chosen in french format.
3. A function named "fct_date_fr()" returns the text from the input field.
The function "fct_date_fr()" is exported by the function "ExternalInterface.addCallback(nom_fct1, instance, fct1)" (with: var instance:Object = null; var nom_fct1:String = "fct_date_fr"; var fct1:Function = fct_date_fr;) to be called from a JavaScript by the code line "var date_choix = document.calendrier_flash.fct_date_fr();" from a JavaScript function named "fct1()" in a web page created with Dreamweaver.
4. The code line causes the error "document.calendrier_flash.fct_date_fr" is not a function.
5. This problem don't exist using IE 7 or Opera 9 or [Mozilla 2 + IE engine]. It means that no Flash function can be called using Javascript !
Reproducible: Always
Steps to Reproduce:
1. Use Mozilla 2 with Gecko engine.
2. Go to my website http://mapage.noos.fr/didweb1/ .
3. Choose the server Didier (http://212.198.187.96:80).
4. Go to the section "Didier".
5. Go to the page "Programmation" (http://212.198.187.96/did_prog.asp).
6. Use the Calendar Flash object.
7. Use the button "Afficher la date d'aujourd'hui" (in english: "Display the current date") or the button "Afficher la date choisie" (in english: "Display the date chosen"): no message box is displayed.
8. Repeat the steps 2 to 7 using IE 7 or Opera 9 or [Mozilla 2 + IE engine] to see that it works now.
Actual Results:
Using Mozilla 2 with Gecko engine, no message box is displayed because there is the error "... is not a function".
Expected Results:
Using Mozilla 2 with Gecko engine, a message box is displayed without error like using IE 7 or Opera 9 or [Mozilla 2 + IE engine].
Comment 1•19 years ago
|
||
did_prog.asp: "The connection has timed out"
Could you please upload the test-case so one could check the code?
But I tend to believe there is something in your code that causes the problem, as this is something that is being used very often. Also I have the JS->Flash calls working in a test-case for another bug (#382378) here: http://bugs.sounds4u.net/Minefield/ExternalInterface/
My site has changed.
1. Go to my website http://mapage.noos.fr/didweb1/ .
2. Update your Flash version.
3. Choose the server Didier and accept the certificate for encryption.
4. Use the professionnal account with the login "Pro" and the password "didpro1" (having number '1' at the end).
5. Go to the section "Professionnels" (= "Professionals" in english).
6. Go to the page "Programmation".
7. Use the Calendar Flash object "web_calendrier.swf" with IE 7, Opera 9, Mozilla 2 with Gecko engine.
-------------------------------------------------------------------
Here is some code from the Macromedia Flash file web_calendrier.fla for the Calendar Flash object:
import flash.external.*;
var etat_appel_fct1:Boolean = ExternalInterface.addCallback("fct_date_fr", null, fct_date_fr);
var etat_appel_fct2:Boolean = ExternalInterface.addCallback("fct_ini_date_jour", null, fct_ini_date_jour);
var an_mini:Number = 1900;
var an_maxi:Number = 2200;
var sep_date:String = "/";
var titre_composant:String = "Calendrier";
var version_composant:String = "2.0";
var date_calendrier = new Date();
var ecouteur_calendrier:Object = new Object();
var ecouteur_an:Object = new Object();
ecouteur_calendrier.scroll = function(objet:Object){
gerer_calendrier_mois();
};
ecouteur_calendrier.change = function(objet:Object){
gerer_calendrier_choix();
};
ecouteur_an.change = function(objet:Object){
gerer_an_choix();
};
initialiser();
function initialiser_ecouteur(){
calendrier.addEventListener("scroll", ecouteur_calendrier);
calendrier.addEventListener("change", ecouteur_calendrier);
an_choix.addEventListener("change", ecouteur_an);
}
function initialiser_calendrier(){
// calendrier.selectableRange ={rangeStart: new Date(2006, 0, 1)};
}
function initialiser_an_choix(){
an_choix.stepSize = 1;
an_choix.minimum = an_mini;
an_choix.maximum = an_maxi;
}
function initialiser_date_calendrier(){
date_calendrier = calendrier.selectedDate;
if(date_calendrier == undefined)
date_calendrier = new Date();
}
function initialiser_choix(){
initialiser_calendrier();
initialiser_an_choix();
gerer_date_maintenant();
}
function initialiser_composant(){
initialiser_ecouteur();
initialiser_aspect_composant();
initialiser_fenetre_auteur();
initialiser_choix();
}
function controler_calendrier_choix(){
calendrier.displayedYear = an_choix.value;
}
function controler_an_choix(){
an_choix.value = calendrier.displayedYear;
}
function controler_date_choix(){
date_choix.text = String(date_calendrier.getDate()) + sep_date + String(date_calendrier.getMonth() + 1) + sep_date + String(date_calendrier.getFullYear());
}
function gerer_date_maintenant(){
date_calendrier = new Date();
calendrier.selectedDate = date_calendrier;
controler_an_choix();
controler_date_choix();
}
function gerer_an_choix(){
controler_calendrier_choix();
initialiser_date_calendrier();
controler_date_choix();
}
function gerer_calendrier_choix(){
initialiser_date_calendrier();
controler_an_choix();
controler_date_choix();
}
function gerer_calendrier_mois(){
controler_an_choix();
}
function initialiser(){
initialiser_composant();
gerer_calendrier_choix();
}
function fct_ini_date_jour(){
gerer_date_maintenant();
}
function fct_date_fr():String{
return date_choix.text;
}
-------------------------------------------------------------------
Here is some code from the Macromedia Dreamweaver 8 ASP page "pro_prog.asp" for the Calendar Flash object:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Programmation</title>
<script type="text/JavaScript">
<!--
function afficher_date_jour_flash()
{
document.calendrier_flash.fct_ini_date_jour();
}
function afficher_date_choix_flash()
{
var date_choix = document.calendrier_flash.fct_date_fr();
var message = "Flash non supporté actuellement par votre navigateur. Veuillez consulter l'aide.";
if (date_choix != "undefined")
message = "Vous avez choisi la date " + date_choix;
alert(message);
}
//-->
</script>
</head>
<body>
<table border="1">
<tr bgcolor="#99FF00">
<td><div align="center">ActiveX</div></td>
<td><div align="center">Flash</div></td>
</tr>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" name="calendrier_flash" width="240" height="280" id="calendrier_flash" title="Calendrier Flash">
<param name="movie" value="web_calendrier.swf" />
<param name="quality" value="high" />
<embed src="web_calendrier.swf" width="240" height="280" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="calendrier_flash"></embed>
</object>
<tr>
<td><div align="center">
<input name="bouton_date_jour_flash" type="submit" id="bouton_date_jour_flash" onclick="afficher_date_jour_flash()" value="Afficher la date d'aujourd'hui"/>
</div></td>
</tr>
<td><div align="center">
<input name="bouton_date_choix_flash" type="submit" id="bouton_date_choix_flash" onclick="afficher_date_choix_flash()" value="Afficher la date choisie"/>
</div></td>
</tr>
</table>
</body>
Comment 3•19 years ago
|
||
you make the calls on OBJECT-element
Comment 4•19 years ago
|
||
No offense, but you should first inspect working code and compare it with yours.
Flash in FF (the way you wrote the markup) is created by the EMBED-element., not by OBJECT-element which you make the calls on...
I have done some other tests.
Opera 9 uses also the EMBED-element, but it works fine with this navigator.
Why has only Firefox this problem and not Opera ?
Do you have a solution ?
Comment 6•19 years ago
|
||
> why has only Firefox this problem
FF does not have a problem. The problem is in your script and I've already told you where I believe the pitfall is.
I don't care much about Opera.
I have done a lot of other tests:
* document.ObjectName is working using IE and Opera.
* document.getElementById("myObjectId") is working using IE.
* document.embeds[myObjectNumber] is working using Firefox and Opera.
Using different cases above, i have found the solution, except for Netscape 7.
It should better if all tests above are ok using all navigators !
Thanks for your help.
Best regards, Didier
Comment 8•18 years ago
|
||
Duplicate of bug 315968 ?
Updated•18 years ago
|
Severity: major → normal
Component: Extension Compatibility → Plug-ins
Product: Firefox → Core
QA Contact: extension.compatibility → plugins
Comment 9•17 years ago
|
||
do you see this problem if you use flash version 10, and FF 3.x beta http://www.mozilla.com/en-US/firefox/all-beta.html
If not, please close with resolution set to worksforme.
Whiteboard: closeme 2009-04-20
Comment 10•17 years ago
|
||
Please reopen this bug if it appears with a recent version of firefox 3 in a new profile. http://support.mozilla.com/kb/Profiles
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → INCOMPLETE
Updated•4 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•