Aquí tienes un ejemplo bastante ilustrativo: http://www.dopelogik.com/documents/why_use_delegate.html
[Buti] -----Mensaje original----- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Raúl Muñoz Enviado el: martes, 19 de julio de 2005 12:50 Para: [email protected] Asunto: Re: [ASNativos] salu2 ( Clase 'Delegate' ) Yo también, fijo que lo tenemos todo bien configurado, lo que pasa es que yo estoy intentando hacer un ejemplo que pusieron en un mensaje de ayer "clase y onEnterFrame" y debo estar haciendolo mal por eso no me funciona el Delegate. Alguien puede colgar un ejemplo en algún sitio? :) Miguel Angel Sánchez wrote: > Cierto, acabo de mirar y también está ahí la clase Delegate. Yo creía > que la buscaba en la otra ruta :-P > > C:\Documents and Settings\usuario\Configuración local\Datos de > programa\Macromedia\Flash MX 2004\es\Configuration\Classes\mx\utils > > Un saludo > > jose alonso escribió: > >> >> flash busca aqui : >> >> C:\Documents and Settings\usuario\Configuración local\Datos de >> programa\Macromedia\Flash MX 2004\es\Configuration\Classes >> >> salu2 >> >> buho29 >> >From: Raúl Muñoz <[EMAIL PROTECTED]> >> >Reply-To: [email protected] >> >To: [email protected] >> >Subject: Re: [ASNativos] salu2 ( Clase 'Delegate' ) >> >Date: Tue, 19 Jul 2005 12:08:46 +0200 >> > >> >Que raro, lo tengo todo igual que tú, la única diferencia es que uso >> >D: en lugar de C: pero eso está bien porque ahí está instalado >> >Flash, no se >> > >> > >> >Miguel Angel Sánchez wrote: >> > >> >>En preferencias, actionscript, configuración de actionscript 2.0, >> >>yo tengo esta línea, que es la que venía por defecto: >> >>$(LocalData)/Classes >> >> >> >>Para importarla solo hay que hacer esto: >> >>import mx.utils.Delegate >> >> >> >>Con eso debería funcionar. Aseguraos de que la habéis copiado a la >> >>ruta que os decía antes: >> >>C:\Archivos de programa\Macromedia\Flash MX 2004\es\First >> >>Run\Classes\mx\utils\Delegate.as >> >> >> >>El "...\es\..." es porque supongo que lo tenéis en español claro... >> >> >> >>[EMAIL PROTECTED] escribió: >> >> >> >>>joder (perdon), pues a mi me estaba pasando lo mismo..... >> >>> >> >>> >> >>>----- Original Message ----- From: "Raúl Muñoz" <[EMAIL PROTECTED]> >> >>>To: <[email protected]> >> >>>Sent: Tuesday, July 19, 2005 10:59 AM >> >>>Subject: Re: [ASNativos] salu2 ( Clase 'Delegate' ) >> >>> >> >>> >> >>>Yo la tengo pero no consigo utilizarla haciendo el import >> >>>correspondiente y en la ayuda tampoco me sale, será cosa del >> >>>classpath? >> >>>[EMAIL PROTECTED] wrote: >> >>> >> >>>>ok, muchas gracias por la clase...... >> >>>> >> >>>> >> >>>>----- Original Message ----- From: "Miguel Angel Sánchez" >> >>>><[EMAIL PROTECTED]> >> >>>>To: <[email protected]> >> >>>>Sent: Tuesday, July 19, 2005 10:05 AM >> >>>>Subject: Re: [ASNativos] salu2 ( Clase 'Delegate' ) >> >>>> >> >>>> >> >>>>Viene con la actualización de Flash 7.2 >> >>>> >> >>>>De todas formas es esto: >> >>>>C:\Archivos de programa\Macromedia\Flash MX 2004\es\First >> >>>>Run\Classes\mx\utils\Delegate.as >> >>>><code> >> >>>>//**************************************************************** >> ************ >> >>>> >> >>>>//Copyright (C) 2003-2004 Macromedia, Inc. All Rights Reserved. >> >>>>//The following is Sample Code and is subject to all restrictions >> >>>>on >> >>>>//such code as contained in the End User License Agreement >> >>>>accompanying >> >>>>//this product. >> >>>>//**************************************************************** >> ************ >> >>>> >> >>>> >> >>>>/** >> >>>>The Delegate class creates a function wrapper to let you run a >> >>>>function >> >>>>in the context >> >>>>of the original object, rather than in the context of the second >> >>>>object, >> >>>>when you pass a >> >>>>function from one object to another. >> >>>>*/ >> >>>> >> >>>>class mx.utils.Delegate extends Object >> >>>>{ >> >>>> /** >> >>>> Creates a functions wrapper for the original function so that >> >>>>it runs >> >>>> in the provided context. >> >>>> @parameter obj Context in which to run the function. >> >>>> @paramater func Function to run. >> >>>> */ >> >>>> static function create(obj:Object, func:Function):Function >> >>>> { >> >>>> var f = function() >> >>>> { >> >>>> var target = arguments.callee.target; >> >>>> var func = arguments.callee.func; >> >>>> >> >>>> return func.apply(target, arguments); >> >>>> }; >> >>>> >> >>>> f.target = obj; >> >>>> f.func = func; >> >>>> >> >>>> return f; >> >>>> } >> >>>> >> >>>> function Delegate(f:Function) >> >>>> { >> >>>> func = f; >> >>>> } >> >>>> >> >>>> private var func:Function; >> >>>> >> >>>> function createDelegate(obj:Object):Function >> >>>> { >> >>>> return create(obj, func); >> >>>> } >> >>>>} >> >>>></code> >> >>>> >> >>>>Un saludo >> >>>>[EMAIL PROTECTED] escribió: >> >>>> >> >>>>>q tal compañeros?? iba a echarle un vistazo a la clase Delegate >> >>>>>de la q habeis hablado en algunos mensajes, y me he dado cuenta >> >>>>>de q yo no la tengo en el equipo, sabeis pq puede ser?? la >> >>>>>version de flash, quizas???---------------------------------- >> >>>>>Lista ASNativos:[email protected] >> >>>>>http://www.5dms.com/listas >> >>>>>---------------------------------- >> >>>>> >> >>>>> >> >>>>> >> >>>>---------------------------------- >> >>>>Lista ASNativos:[email protected] >> >>>>http://www.5dms.com/listas >> >>>>---------------------------------- >> >>>> >> >>>> >> >>>>---------------------------------- >> >>>>Lista ASNativos:[email protected] >> >>>>http://www.5dms.com/listas >> >>>>---------------------------------- >> >>>> >> >>>> >> >>> >> >>>---------------------------------- >> >>>Lista ASNativos:[email protected] >> >>>http://www.5dms.com/listas >> >>>---------------------------------- >> >>> >> >>> >> >>>---------------------------------- >> >>>Lista ASNativos:[email protected] >> >>>http://www.5dms.com/listas >> >>>---------------------------------- >> >>> >> >>---------------------------------- >> >>Lista ASNativos:[email protected] >> >>http://www.5dms.com/listas >> >>---------------------------------- >> >> >> >> >> > >> >---------------------------------- >> >Lista ASNativos:[email protected] >> >http://www.5dms.com/listas >> >---------------------------------- >> ---------------------------------- >> Lista ASNativos:[email protected] >> http://www.5dms.com/listas >> ---------------------------------- >> > ---------------------------------- > Lista ASNativos:[email protected] > http://www.5dms.com/listas > ---------------------------------- > > ---------------------------------- Lista ASNativos:[email protected] http://www.5dms.com/listas ---------------------------------- ---------------------------------- Lista ASNativos:[email protected] http://www.5dms.com/listas ----------------------------------

