alexandrem 0 Denunciar post Postado Julho 18, 2005 Pessoal tenho um movieClip na cena que está linkado a classe "teste".Neste movieClip tenho a função blah()preciso acessar essa função blah(que está no movieClip da cena) de dentro da classeclass teste{ function teste() { setInterval( function(){ chamar função blah da cena; }, 1000 ); } }a minha intenção é que isso fosse um listener...um evento....quando entrasse no intervalo disparava um evento...alguém pode me dar uma luz ??vlw Compartilhar este post Link para o post Compartilhar em outros sites
Froskie 0 Denunciar post Postado Julho 18, 2005 Eu posto o código, entender fica por sua parte, ok? PHP [*]//////////////////////////// [*]//ISSO É A CLASSE// [*]//////////////////////////// [*]import mx.events.EventDispatcher; [*]import mx.utils.Delegate; [*]class teste { [*] // [*] var addEventListnener:Function; [*] var removeEventListener:Function; [*] var dispatchEvent:Function; [*] var timeInt:Number; [*] // [*] function teste() { [*] EventDispatcher.initialize(this); [*] timeInt = setInterval(Delegate.create(this, blah), 1000); [*] } [*] function blah() { [*] dispatchEvent({type:'evento', target:this, message:'Funcao Blah Aconteceu', time:getTimer()}); [*] clearInterval(timeInt); [*] } [*]} [*]//////////////////////////// [*]//ISSO VAI NO FRAME// [*]//////////////////////////// [*]import mx.utils.Delegate; [*]// [*]function oEvento(oResposta) { [*] trace(oResposta.target); [*] trace(oResposta.type); [*] trace(oResposta.message); [*] trace(oResposta.time); [*]} [*]var teste = new teste(); [*]teste.addEventListener('evento', Delegate.create(this, oEvento)); Compartilhar este post Link para o post Compartilhar em outros sites