AS3 Interface externe
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 280
- Status: Offline
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
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.
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);
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);
- // 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);
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


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Juillet 24th, 2012, 1:43 pm
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 280
- Status: Offline
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
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';"+
"} "+
"}";
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';"+
"} "+
"}";
- // 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';"+
- "} "+
- "}";
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 280
- Status: Offline
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 280
- Status: Offline
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


- Inscription: Avr 15, 2011
- Messages: 1201
- Loc: Sydney
- Status: Offline
- ScottG
- Proficient


- Inscription: Juil 06, 2010
- Messages: 280
- Status: Offline
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
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);
}
// 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);
}
- 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);
- }
Page 1 sur 1
Pour répondre à ce sujet, vous devez vous connecter ou vous enregistrer. Il est gratuit.
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
