Comunidad de diseño web y desarrollo en internet online

Ejecutar JavaScript en AS3 para crear botono de favoritos?

Citar            
MensajeEscrito el 04 Nov 2010 05:15 pm
:) Hola Buenas. yo soy un diseñador Grafico Web, yo trabajo desarrollando sitios Flash normalemnte los creo con AS2 actualemnte estoy desarrollando un sitio con AS3.0. El problema es el siguiente los sitios que desarrollo llegan un boton de agregar a favoritos que funciona muy bien en AS2.0 estoy tratando de agregar el mismo boton de Favoritos en AS3 digamos este boton es una funcion javaScript q esta en el HTML y que llamo con AS2 Pero con As3 no se como hacerla funcionar :shock:
El codigo es este HTML

Código HTML :


<script>
function addBookmark(title,url) { 
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) { 
window.external.AddFavorite( url, title); 
} else if( window.opera && window.print ) { 
return true; 
} 
} 
</script>

<SCRIPT language="Javascript">
function agregar(){
   
thetitle="Crear Textilera";
theurl="http://www.uniformescrear.com";

if (window.sidebar && (navigator.appName.indexOf('Explorer') == -1)
   && (navigator.appName.indexOf('Opera') == -1)) {
 window.sidebar.addPanel(title,theurl,'');
} else if (window.opera && window.print) {
 var fav = document.createElement('a');
 fav.setAttribute('rel','sidebar');
 fav.setAttribute('href',theurl);
 fav.setAttribute('title',thetitle);
 fav.click();
} else if( document.all) {
 window.external.AddFavorite(theurl,thetitle);
}

} 
</SCRIPT>


y en AS2 el codigo es

Código ActionScript :

getURL("javascript:addBookmark('Plaza Los Colegios Centro Comercial','http://www.reatra.com')"); 


en As3.0 he estado probando este codigo q es con el q se llaman JavaScript pero sin resultados

Código ActionScript :

 function favoritos(Mouse:Event):void {
   ExternalInterface.call("javascript:agregar");
} 


Por aquello si tengo el codigo del boton q ejecuta esa funcion solo q no creo necesario ponerlo
Aclaro esto xq siempre hay alguien q dice no estas llamando a la funcion x eso no funciona y no solucionan nada.

Muchas gracias :wink:

Por CLAnonimo

Claber

600 de clabLevel

5 tutoriales
1 articulo

 

Este es un usuario anónimo genérico para las cuentas borradas o perdidas.

firefox
Citar            
MensajeEscrito el 04 Nov 2010 07:06 pm

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.