Foros del Web » Creando para Internet » Flash y Actionscript »

cargar una clase de js en un boton flash

Estas en el tema de cargar una clase de js en un boton flash en el foro de Flash y Actionscript en Foros del Web. Saludos. Como podria adaptar esto: Código HTML: <a href= "main.html" class= "loadMe" > home page </a> en un boton flash? Ahi lo importante es cargar ...
  #1 (permalink)  
Antiguo 22/04/2009, 10:48
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Exclamación cargar una clase de js en un boton flash

Saludos.

Como podria adaptar esto:
Código HTML:
<a href="main.html" class="loadMe">home page</a> 
en un boton flash? Ahi lo importante es cargar la clase "loadMe" que es un archivo js.

Código js:
Ver original
  1. var History = new Class({
  2.                              
  3.     getOptions: function(){
  4.         return {
  5.             links: '.loadMe'
  6.         };
  7.     },
  8.  
  9.     initialize: function(options){
  10.    
  11.         this.setOptions(this.getOptions(), options);
  12.        
  13.         this.url = window.location.href.toString();
  14.         this.checkURL.periodical(500,this);
  15.        
  16.         if(window.ie){
  17.             this.iframe = new Element('iframe').setProperties({id: 'HistoryIframe', src: this.url}).setStyles({display: 'none'}).injectInside(document.body);
  18.         }
  19.        
  20.         var url = this.formatHash(this.url);
  21.        
  22.         this.links = $$(this.options.links);
  23.         this.links.each(function(el,i){          
  24.             el.addEvent('click',function(e){
  25.                 if(e != undefined){
  26.                     new Event(e).stop();
  27.                 }
  28.                 this.set(el);
  29.             }.bind(this));
  30.            
  31.             if(url != ''){
  32.                 if(el.href == url){
  33.                     el.fireEvent('click','',50);
  34.                     this.set(el.href);
  35.                 }
  36.             }
  37.         }.bind(this));
  38.        
  39.     },
  40.    
  41.     formatHash: function(str){
  42.         str = str.toString();
  43.         var index = str.indexOf('#');
  44.         if(index > -1){
  45.             str = str.substr(index+1);
  46.         }
  47.         return str;    
  48.     },
  49.    
  50.     formatURL: function(str){
  51.         str = str.toString();
  52.         var index = str.indexOf('#');
  53.         if(index > -1){
  54.             str = str.substring(0, index);
  55.         }
  56.         return str;
  57.     },
  58.    
  59.     set: function(str){
  60.         var url = this.formatURL(this.url);
  61.         str = this.formatHash(str);
  62.         this.url = url+'#'+str;
  63.         window.location.href = this.url;
  64.         if(window.ie){
  65.             this.iframe.setProperty('src', str);
  66.         }
  67.     },
  68.    
  69.     checkURL: function(){
  70.        
  71.         if(window.ie){
  72.             var url = this.iframe.contentWindow.location.href;
  73.             if(url != this.formatHash(this.url)){
  74.                 this.url = this.formatURL(this.url)+'#'+url;
  75.                 window.location.href = this.url;
  76.                 this.iframe.setProperty('src', url);
  77.                 this.setContent();
  78.             }
  79.         }else{
  80.             var url = window.location.href.toString();
  81.             if(url != this.url){
  82.                 this.url = url;
  83.                 window.location.href = this.url;
  84.                 this.setContent();
  85.             }
  86.         }
  87.     },
  88.    
  89.     setContent: function(){
  90.         var url = this.formatHash(this.url)
  91.         this.links.each(function(el,i){
  92.             if(el.href == url){
  93.                 el.fireEvent('click','',50);
  94.             }
  95.         });
  96.     }
  97.  
  98. });
  99.  
  100. History.implement(new Events);
  101. History.implement(new Options);

al igual que esta instrucción:

Código html:
Ver original
  1. <a href="#" onclick="javascript:document.getElementById('page-loader').style.display='none' ; document.getElementById('page-loader2').style.display='block';">nosotros.html</a>

para un boton en un flash.
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr

Última edición por gVenom; 22/04/2009 a las 13:13
  #2 (permalink)  
Antiguo 23/04/2009, 08:15
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Respuesta: cargar una clase de js en un boton flash

Nadie sabe como? Aunque sea todo en AS, solo ocupo que haga la función.
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:48.