Swf Javascript contrôle ne fonctionne pas dans IE

  • somnuk
  • Born
  • Born
  • No Avatar
  • Inscription: Jan 11, 2008
  • Messages: 1
  • Loc: San Francisco
  • Status: Offline

Message Janvier 11th, 2008, 4:24 pm

Nous vous remercions par avance pour toute personne qui peut m'aider avec le problème suivant.

Mon objectif: J'essaie d'avoir les boutons suivants html sauter et jouer à des labels spécifiques dans mon swf. Le swf que je commande est appelée dans un pare pas swf.

Mon problème: Le code que j'utilise fonctionne dans Firefox, Safari, mais pas IE 6 ou 7

C'est le script que j'utilise:
Code: [ Select ]
<SCRIPT LANGUAGE="JavaScript">
<!-- 
var movieName = "mymovie";

function thisMovie(movieName) {
 // IE and Netscape refer to the movie object differently.
 // This function returns the appropriate syntax depending on the browser.
 if (navigator.appName.indexOf ("Microsoft") !=-1) {
  return window[movieName]
 }    else {
  return document[movieName]
 }
}

// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
 if (typeof(theMovie) != "undefined") {
  return theMovie.PercentLoaded() == 100;
 } else {
  return false;
 }
}

function About() {
 if (movieIsLoaded(thisMovie(movieName))) {
  thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","aboutRise");
    thisMovie(movieName).TPlay("_level0/holder/topnavHome/","aboutRise");

 }
}

function Services() {
 if (movieIsLoaded(thisMovie(movieName))) {
  thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","servicesRise");
  thisMovie(movieName).TPlay("_level0/holder/topnavHome/","servicesRise");
 }
}

function Work() {
 if (movieIsLoaded(thisMovie(movieName))) {
  thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","workRise");
    thisMovie(movieName).TPlay("_level0/holder/topnavHome/","workRise");

 }
}

function Clients() {
 if (movieIsLoaded(thisMovie(movieName))) {
  thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","clientsRise");
    thisMovie(movieName).TPlay("_level0/holder/topnavHome/","clientsRise");

 }
}

function News() {
 if (movieIsLoaded(thisMovie(movieName))) {
  thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","newsRise");
    thisMovie(movieName).TPlay("_level0/holder/topnavHome/","newsRise");

 }
}


//-->
</SCRIPT>
  1. <SCRIPT LANGUAGE="JavaScript">
  2. <!-- 
  3. var movieName = "mymovie";
  4. function thisMovie(movieName) {
  5.  // IE and Netscape refer to the movie object differently.
  6.  // This function returns the appropriate syntax depending on the browser.
  7.  if (navigator.appName.indexOf ("Microsoft") !=-1) {
  8.   return window[movieName]
  9.  }    else {
  10.   return document[movieName]
  11.  }
  12. }
  13. // Checks if movie is completely loaded.
  14. // Returns true if yes, false if no.
  15. function movieIsLoaded (theMovie) {
  16.  if (typeof(theMovie) != "undefined") {
  17.   return theMovie.PercentLoaded() == 100;
  18.  } else {
  19.   return false;
  20.  }
  21. }
  22. function About() {
  23.  if (movieIsLoaded(thisMovie(movieName))) {
  24.   thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","aboutRise");
  25.     thisMovie(movieName).TPlay("_level0/holder/topnavHome/","aboutRise");
  26.  }
  27. }
  28. function Services() {
  29.  if (movieIsLoaded(thisMovie(movieName))) {
  30.   thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","servicesRise");
  31.   thisMovie(movieName).TPlay("_level0/holder/topnavHome/","servicesRise");
  32.  }
  33. }
  34. function Work() {
  35.  if (movieIsLoaded(thisMovie(movieName))) {
  36.   thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","workRise");
  37.     thisMovie(movieName).TPlay("_level0/holder/topnavHome/","workRise");
  38.  }
  39. }
  40. function Clients() {
  41.  if (movieIsLoaded(thisMovie(movieName))) {
  42.   thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","clientsRise");
  43.     thisMovie(movieName).TPlay("_level0/holder/topnavHome/","clientsRise");
  44.  }
  45. }
  46. function News() {
  47.  if (movieIsLoaded(thisMovie(movieName))) {
  48.   thisMovie(movieName).TGotoLabel("_level0/holder/topnavHome/","newsRise");
  49.     thisMovie(movieName).TPlay("_level0/holder/topnavHome/","newsRise");
  50.  }
  51. }
  52. //-->
  53. </SCRIPT>


Voici les boutons HTML:
Code: [ Select ]
  <div class="homeButtons">
 <a href="About()" title="About" class="aboutButton"><img src="clear.gif" width="89" height="21" border="0"/></a>
 <a href="Services()" title="Services" class="servicesButton" ><img src="clear.gif" width="87" height="21" border="0"/></a>
 <a href="Work()" title="Work" class="workButton" ><img src="clear.gif" width="49" height="21" border="0"/></a>
 <a href="Clients()" title="Clients" class="clientsButton" ><img src="clear.gif" width="67" height="21" border="0"/></a>
 <a href="News()" title="News" class="newsButton" ><img src="clear.gif" width="54" height="21" border="0"/></a></div>
  1.   <div class="homeButtons">
  2.  <a href="About()" title="About" class="aboutButton"><img src="clear.gif" width="89" height="21" border="0"/></a>
  3.  <a href="Services()" title="Services" class="servicesButton" ><img src="clear.gif" width="87" height="21" border="0"/></a>
  4.  <a href="Work()" title="Work" class="workButton" ><img src="clear.gif" width="49" height="21" border="0"/></a>
  5.  <a href="Clients()" title="Clients" class="clientsButton" ><img src="clear.gif" width="67" height="21" border="0"/></a>
  6.  <a href="News()" title="News" class="newsButton" ><img src="clear.gif" width="54" height="21" border="0"/></a></div>


C'est le swf embed:
Code: [ Select ]
<OBJECT
    CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
    WIDTH="1024"
    HEIGHT="768"
    ID="mymovie"
    align="middle">
    
   <param name="allowScriptAccess" value="sameDomain" />
   <PARAM NAME="MOVIE" VALUE="main.swf" />
   <PARAM NAME="QUALITY" VALUE="high" />
   <PARAM NAME="SCALE" VALUE="NOSCALE" />
   <PARAM NAME="wmode" VALUE="opaque" />     
   <param name="bgcolor" value="#000000" />
     
   <EMBED
        NAME="mymovie"
        SRC="main.swf"
        mce_src="main.swf"
        WMODE="opaque"
        QUALITY="high"
        BGCOLOR="#000000"
        WIDTH="1024"
        HEIGHT="768"
        align="middle"
        allowScriptAccess="sameDomain"
        SCALE="NOSCALE"
        swLiveConnect="true"
        type="application/x-shockwave-flash"
        PLUGINSPAGE="http://www.macromedia.com/go/flashplayer/">
  </OBJECT>
  1. <OBJECT
  2.     CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  3.     codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
  4.     WIDTH="1024"
  5.     HEIGHT="768"
  6.     ID="mymovie"
  7.     align="middle">
  8.     
  9.    <param name="allowScriptAccess" value="sameDomain" />
  10.    <PARAM NAME="MOVIE" VALUE="main.swf" />
  11.    <PARAM NAME="QUALITY" VALUE="high" />
  12.    <PARAM NAME="SCALE" VALUE="NOSCALE" />
  13.    <PARAM NAME="wmode" VALUE="opaque" />     
  14.    <param name="bgcolor" value="#000000" />
  15.      
  16.    <EMBED
  17.         NAME="mymovie"
  18.         SRC="main.swf"
  19.         mce_src="main.swf"
  20.         WMODE="opaque"
  21.         QUALITY="high"
  22.         BGCOLOR="#000000"
  23.         WIDTH="1024"
  24.         HEIGHT="768"
  25.         align="middle"
  26.         allowScriptAccess="sameDomain"
  27.         SCALE="NOSCALE"
  28.         swLiveConnect="true"
  29.         type="application/x-shockwave-flash"
  30.         PLUGINSPAGE="http://www.macromedia.com/go/flashplayer/">
  31.   </OBJECT>


Any Ideas? Encore une fois Merci beaucoup
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Janvier 11th, 2008, 4:24 pm

  • graphixboy
  • Control + Z
  • Mastermind
  • Avatar de l’utilisateur
  • Inscription: Juil 11, 2005
  • Messages: 1828
  • Loc: In the Great White North
  • Status: Offline

Message Janvier 13th, 2008, 1:31 pm

Je suppose le problème a à voir avec la façon youve placé votre swf dans le html. IE fonctionne un peu différemment et ne jouent pas toujours gentil avec l'objet balise embed. Cela dit vous devriez regarder dans une solution javascript de placer le code sur votre page. Jetez un oeil à Geoff Stearns très agréable SWFObject mai il fournir ce dont vous avez besoin.

Vous mai tiens également à jeter un oeil à Flashs externalInterface Class. Cela vous permet d'appeler une fonction à l'intérieur de la Flash directement à partir de Javascript ou d'une fonction Javascript directement à partir de Flash ce qui élimine le besoin pour le "thisMovie" la fonction.
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • montyt
  • Proficient
  • Proficient
  • Avatar de l’utilisateur
  • Inscription: Avr 27, 2007
  • Messages: 275
  • Status: Offline

Message Janvier 17th, 2008, 1:08 am

vous pouvez voir ces
http://www.permadi.com/tutorial/flashGetObject/
http://www.permadi.com/tutorial/flashGe ... index.html
  • graphixboy
  • Control + Z
  • Mastermind
  • Avatar de l’utilisateur
  • Inscription: Juil 11, 2005
  • Messages: 1828
  • Loc: In the Great White North
  • Status: Offline

Message Janvier 18th, 2008, 1:01 am

embed objet n'est pas sémantiquement correcte. Je vous conseille d'utiliser une solution de placement javascript comme je SWFObject liée ci-dessus. Cela vous permettra d'utiliser document.getElementById (nom swf), d'interagir avec votre film
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com

Afficher de l'information

  • Total des messages de ce sujet: 4 messages
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 29 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC