Como podria adaptar esto:
Código :
<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. No necesito la funcion, solo llamarla. La función es esta:
Código js:
Código :
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);
tambien necesito cargar esta otra instruccion desde un boton en flash:
Código :
1. <a href="#" onclick="javascript:document.getElementById('page-loader').style.display='none' ; document.getElementById('page-loader2').style.display='block';">nosotros.html</a>
Gracias.