AS3 Interface externe

  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Juil 06, 2010
  • Messages: 280
  • Status: Offline

Message Juillet 24th, 2012, 1:43 pm

Bonjour à nouveau tous ses depuis un certain temps j'ai eu un problème je ne pouvais pas figure out donc je retour. La question Im ayant actuellement semble comme il devrait être simple. Mais IE veut être une pépite de poo. Avant du dénigrer mon utilisation d'IE savent que je suis tenu de faire ce travail dans IE, et j'adore Firefox. Donc pour vous donner un peu de fond sur ce que Im faire. Je fais un AS3 lecteur vidéo qui possède certaines caractéristiques impressionnants et il est en voie d'achèvement est une caractéristique des vidéos de qualité différente, et lorsque l'utilisateur sélectionne la qualité il sera relatif à la taille de la scène pour s'adapter à la vidéo, c'est là l'Interface externe entre en jeu. Je l'ai fait avant en AS2 avec aucun problème du tout. Im en utilisant le même code de AS2 AS3 pour compléter la tâche et il travaille à tout, sauf I frickin E. (IE oh comment je déteste vous).

Voici donc le code que j'utilise
ACTIONSCRIPT Code: [ Select ]
// Setup the function to be made and called in a string format
function_text =
   " function() { "+
      "document.getElementById('launcher_object').style.position = 'relative'; "+
      "document.getElementById('launcher_embed').style.position = 'relative'; "+
      "document.getElementById('launcher_object').width = '"+ video_width +"'; "+
      "document.getElementById('launcher_object').height = '"+ (video_height + controls_height) +"'; "+
      "document.getElementById('launcher_embed').width = '"+ video_width +"'; "+
      "document.getElementById('launcher_embed').height = '"+ (video_height + controls_height) +"'; "+
   "}";
 
// Make the call
ExternalInterface.call(function_text);
 
  1. // Setup the function to be made and called in a string format
  2. function_text =
  3.    " function() { "+
  4.       "document.getElementById('launcher_object').style.position = 'relative'; "+
  5.       "document.getElementById('launcher_embed').style.position = 'relative'; "+
  6.       "document.getElementById('launcher_object').width = '"+ video_width +"'; "+
  7.       "document.getElementById('launcher_object').height = '"+ (video_height + controls_height) +"'; "+
  8.       "document.getElementById('launcher_embed').width = '"+ video_width +"'; "+
  9.       "document.getElementById('launcher_embed').height = '"+ (video_height + controls_height) +"'; "+
  10.    "}";
  11.  
  12. // Make the call
  13. ExternalInterface.call(function_text);
  14.  


Si Im en utilisant le code HTML pages Javascript pour faire le travail pour moi. Non, je ne peux pas faire une fonction d'appel flash Javascript fonction doit être faite à la volée.
Si vous avez besoin de connaître plus d'info veuillez me le faire savoir je vais encore travailler avec cela une volonté post une solution si je venir à travers un. Si vous avez une autre option ou une autre façon de faire la même fonctionnalité de redimensionnement étape veuillez me connaître aussi bien.
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Juillet 24th, 2012, 1:43 pm

  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Juil 06, 2010
  • Messages: 280
  • Status: Offline

Message Juillet 25th, 2012, 8:28 am

OK donc j'ai pensé elle et Voici ce que la question a été. Utiliser le script pour construire l'objet flash pour la page HTML est la même sur IE et Firefox mais la manière dont IE décide de rendre ou de traiter la question si la question. Soit l'objet embed est retiré les deux navigateurs et Firefox ne tient pas compte de l'incorporer manquant et continue de s'exécuter le Javascript ou IE supprime il et erreurs sur en raison de l'incorporer manquant.

Lorsque le Javascript appelé document.getElementById("loader_embed"). JavaScript arrêter parce qu'il n'a pas existe dans (pour sûr) IE donc ma solution était ce

ACTIONSCRIPT Code: [ Select ]
// Setup the function to be made and called in a string format
function_text =
"function() { "+
   "var myWidth = 0, myHeight = 0; "+
   
   //Non-IE
   "if(typeof(window.innerWidth) == 'number') { "+
      "myWidth = window.innerWidth; "+
      "myHeight = window.innerHeight; "+
   
   //IE 6+ in 'standards compliant mode'
   "} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { "+
      "myWidth = document.documentElement.clientWidth; "+
      "myHeight = document.documentElement.clientHeight; "+
   
   //IE 4 compatible
   "} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) { "+
      "myWidth = document.body.clientWidth; "+
      "myHeight = document.body.clientHeight; "+
   "} "+
         
   "var object_element = document.getElementById('launcher_object'); "+
   "var embed_element = document.getElementById('launcher_embed'); "+
   
   "if(object_element) { "+
      "object_element.style.position = 'absolute'; "+
      "object_element.style.height = myHeight + 'px'; "+
      "object_element.style.width = myWidth + 'px'; "+
      "object_element.style.left = '0px'; "+
      "object_element.style.top = '0px'; "+
      "object_element.style.zIndex = '10000'; "+
   "} "+
   
   "if(embed_element) { "+
      "embed_element.style.position = 'absolute'; "+
      "embed_element.style.height = myHeight + 'px'; "+
      "embed_element.style.width = myWidth + 'px'; "+
      "embed_element.style.left = '0px'; "+
      "embed_element.style.top = '0px'; "+
      "embed_element.style.zIndex = '10000';"+
   "} "+
 
"}";
 
  1. // Setup the function to be made and called in a string format
  2. function_text =
  3. "function() { "+
  4.    "var myWidth = 0, myHeight = 0; "+
  5.    
  6.    //Non-IE
  7.    "if(typeof(window.innerWidth) == 'number') { "+
  8.       "myWidth = window.innerWidth; "+
  9.       "myHeight = window.innerHeight; "+
  10.    
  11.    //IE 6+ in 'standards compliant mode'
  12.    "} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { "+
  13.       "myWidth = document.documentElement.clientWidth; "+
  14.       "myHeight = document.documentElement.clientHeight; "+
  15.    
  16.    //IE 4 compatible
  17.    "} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) { "+
  18.       "myWidth = document.body.clientWidth; "+
  19.       "myHeight = document.body.clientHeight; "+
  20.    "} "+
  21.          
  22.    "var object_element = document.getElementById('launcher_object'); "+
  23.    "var embed_element = document.getElementById('launcher_embed'); "+
  24.    
  25.    "if(object_element) { "+
  26.       "object_element.style.position = 'absolute'; "+
  27.       "object_element.style.height = myHeight + 'px'; "+
  28.       "object_element.style.width = myWidth + 'px'; "+
  29.       "object_element.style.left = '0px'; "+
  30.       "object_element.style.top = '0px'; "+
  31.       "object_element.style.zIndex = '10000'; "+
  32.    "} "+
  33.    
  34.    "if(embed_element) { "+
  35.       "embed_element.style.position = 'absolute'; "+
  36.       "embed_element.style.height = myHeight + 'px'; "+
  37.       "embed_element.style.width = myWidth + 'px'; "+
  38.       "embed_element.style.left = '0px'; "+
  39.       "embed_element.style.top = '0px'; "+
  40.       "embed_element.style.zIndex = '10000';"+
  41.    "} "+
  42.  
  43. "}";
  44.  
  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Juil 06, 2010
  • Messages: 280
  • Status: Offline

Message Juillet 25th, 2012, 8:45 am

OK donc j'ai juste confirmé le c'est IE supprimant la balise Embed, lorsqu'il rend.
  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Juil 06, 2010
  • Messages: 280
  • Status: Offline

Message Juillet 31st, 2012, 8:00 am

OK donc j'ai couru dans une autre question en utilisant la même méthode GI vous ne savez pas à l'heure actuelle comment traiter mais pour une raison quelconque dans Safari. Il semble qu'il redémarre le flash lorsqu'il le CSS position absolue haut et gauche 0 et la largeur et la hauteur et la largeur de l'écran et la hauteur. Si je clique sur le bouton deux fois le film charge et fonctionne bien, mais si je clique seulement sur elle une fois qu'il donne une erreur quelque chose comme page de safari 5 annulé d'ouverture.
  • Zealous
  • Guru
  • Guru
  • Avatar de l’utilisateur
  • Inscription: Avr 15, 2011
  • Messages: 1201
  • Loc: Sydney
  • Status: Offline

Message Août 19th, 2012, 6:40 am

y a-t-il un journal développeur de console ou une erreur, vous pouvez vérifier dans le navigateur pour voir si vous pouvez trouver l'élément qui est à l'origine du problème.
  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Juil 06, 2010
  • Messages: 280
  • Status: Offline

Message Août 21st, 2012, 8:05 am

Oui, mais il ne lève pas une erreur ou un avertissement.

J'ai fait quelques écran de coups de feu pour montrer ce qui est en cours que je ne peux pas accorder l'accès au joueur réel puisque c'est sur un intranet.

Dès que vous chargez la page, vous obtenez ceci.
http://www.indefinitedesigns.com/saf-start.jpg

Lorsque vous cliquez sur le bouton HD avec le joueur chargé, jouer ou même un nouveau départ en safari vous obtenez ceci
http://www.indefinitedesigns.com/saf-c1.jpg
Notez que les contrôles de joueurs n'ont pas changé mais le joueur remplit l'espace visible dans la page. Le remplissage de l'espace visible, c'est ce qu'il est censé pour faire. À ce stade, la vidéo est suppose de jouer, mais tout ce qui est la miniature de vidéo. Si vous cliquez sur le bouton « play » il remonte à l'état de démarrage ( http://www.indefinitedesigns.com/saf-start.jpg ).

Si vous cliquez sur le bouton HD une deuxième fois dans cet État ( http://www.indefinitedesigns.com/saf-c1.jpg ) il fonctionne parfaitement comme il se doit
http://www.indefinitedesigns.com/saf-c2.jpg
Le bouton joueurs HD remplace le bouton SD et il commence à jouer.

/ / Le code Im utilisant pour remplir l'espace visible
ACTIONSCRIPT Code: [ Select ]
function set_stage_size():void {
   
   // Setup the function call
   var function_text:String;
   
   // See if it is the hq version
   if(quality_selected == 'hq') {
     
      // Setup the function to be made and called in a string format
      function_text =
      "function() { "+
         "var myWidth = 0, myHeight = 0; "+
         
         // Non-IE
         "if(typeof(window.innerWidth) == 'number') { "+
            "myWidth = window.innerWidth; "+
            "myHeight = window.innerHeight; "+
         
         // IE 6+ in 'standards compliant mode'
         "} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { "+
            "myWidth = document.documentElement.clientWidth; "+
            "myHeight = document.documentElement.clientHeight; "+
         
         // IE 4 compatible
         "} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) { "+
            "myWidth = document.body.clientWidth; "+
            "myHeight = document.body.clientHeight; "+
         "} "+
         
         "var object_element = document.getElementById('launcher_object'); "+
         "var embed_element = document.getElementById('launcher_embed'); "+
 
         "if(object_element) { "+
            "object_element.style.position = 'absolute'; "+
            "object_element.style.height = myHeight + 'px'; "+
            "object_element.style.width = myWidth + 'px'; "+
            "object_element.style.left = '0px'; "+
            "object_element.style.top = '0px'; "+
            "object_element.style.zIndex = '10000'; "+
         "} "+
         
         "if(embed_element) { "+
            "embed_element.style.position = 'absolute'; "+
            "embed_element.style.height = myHeight + 'px'; "+
            "embed_element.style.width = myWidth + 'px'; "+
            "embed_element.style.left = '0px'; "+
            "embed_element.style.top = '0px'; "+
            "embed_element.style.zIndex = '10000';"+
         "} "+
         
      "}";
     
   } else {
     
      // Setup the function to be made and called in a string format
      function_text =
      " function(){ "+
   
         "var object_element = document.getElementById('launcher_object'); "+
         "var embed_element = document.getElementById('launcher_embed'); "+
         
         "if(object_element) { "+
            "object_element.style.position = 'relative'; "+
            "object_element.style.width = '"+ object_info.width +"px'; "+
            "object_element.style.height = '"+ (object_info.height + skin_mc.box.center_bar.height) +"px'; "+
         "} "+
         
         "if(embed_element) { "+
            "embed_element.style.position = 'relative'; "+
            "embed_element.style.width = '"+ object_info.width +"px'; "+
            "embed_element.style.height = '"+ (object_info.height + skin_mc.box.center_bar.height) +"px'; "+
         "} "+
         
      "}";
     
   }
   
   // Make the call
   ExternalInterface.call(function_text);
   
}
 
  1. function set_stage_size():void {
  2.    
  3.    // Setup the function call
  4.    var function_text:String;
  5.    
  6.    // See if it is the hq version
  7.    if(quality_selected == 'hq') {
  8.      
  9.       // Setup the function to be made and called in a string format
  10.       function_text =
  11.       "function() { "+
  12.          "var myWidth = 0, myHeight = 0; "+
  13.          
  14.          // Non-IE
  15.          "if(typeof(window.innerWidth) == 'number') { "+
  16.             "myWidth = window.innerWidth; "+
  17.             "myHeight = window.innerHeight; "+
  18.          
  19.          // IE 6+ in 'standards compliant mode'
  20.          "} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { "+
  21.             "myWidth = document.documentElement.clientWidth; "+
  22.             "myHeight = document.documentElement.clientHeight; "+
  23.          
  24.          // IE 4 compatible
  25.          "} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) { "+
  26.             "myWidth = document.body.clientWidth; "+
  27.             "myHeight = document.body.clientHeight; "+
  28.          "} "+
  29.          
  30.          "var object_element = document.getElementById('launcher_object'); "+
  31.          "var embed_element = document.getElementById('launcher_embed'); "+
  32.  
  33.          "if(object_element) { "+
  34.             "object_element.style.position = 'absolute'; "+
  35.             "object_element.style.height = myHeight + 'px'; "+
  36.             "object_element.style.width = myWidth + 'px'; "+
  37.             "object_element.style.left = '0px'; "+
  38.             "object_element.style.top = '0px'; "+
  39.             "object_element.style.zIndex = '10000'; "+
  40.          "} "+
  41.          
  42.          "if(embed_element) { "+
  43.             "embed_element.style.position = 'absolute'; "+
  44.             "embed_element.style.height = myHeight + 'px'; "+
  45.             "embed_element.style.width = myWidth + 'px'; "+
  46.             "embed_element.style.left = '0px'; "+
  47.             "embed_element.style.top = '0px'; "+
  48.             "embed_element.style.zIndex = '10000';"+
  49.          "} "+
  50.          
  51.       "}";
  52.      
  53.    } else {
  54.      
  55.       // Setup the function to be made and called in a string format
  56.       function_text =
  57.       " function(){ "+
  58.    
  59.          "var object_element = document.getElementById('launcher_object'); "+
  60.          "var embed_element = document.getElementById('launcher_embed'); "+
  61.          
  62.          "if(object_element) { "+
  63.             "object_element.style.position = 'relative'; "+
  64.             "object_element.style.width = '"+ object_info.width +"px'; "+
  65.             "object_element.style.height = '"+ (object_info.height + skin_mc.box.center_bar.height) +"px'; "+
  66.          "} "+
  67.          
  68.          "if(embed_element) { "+
  69.             "embed_element.style.position = 'relative'; "+
  70.             "embed_element.style.width = '"+ object_info.width +"px'; "+
  71.             "embed_element.style.height = '"+ (object_info.height + skin_mc.box.center_bar.height) +"px'; "+
  72.          "} "+
  73.          
  74.       "}";
  75.      
  76.    }
  77.    
  78.    // Make the call
  79.    ExternalInterface.call(function_text);
  80.    
  81. }
  82.  

Afficher de l'information

  • Total des messages de ce sujet: 6 messages
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 25 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