Gracias :) justo acababa de acabarlo y lo hice de otroa forma pero muchas
gracias por tu respuesta, jeje yo al final me cree un MC y lito xD
accediendo a sus valores :p
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 05, 2003 9:59 AM
Subject: Re: [ASNativos] Acceso a metodos externos y .... PLS AYUDA!! que
mecortan la cabeza :-(


> Te he modificado el objeto area, para que publique una variable global que
> apunte a si mismo, y por tanto al clip.
> Como el campo de texto es intertno de area, no considero que sea bueno que
> accedas directamente a �l desde fuera, aunque puedes, pero eso hace que
> cualquier modificaci�n en el Movieclip area y su objeto tenga que hacerse
> dentro del objetio item, para evitarlo he declarado una funci�n que
realiza
> esa acci�in, recibe el texto a mostrar, y lo incluye en el campo de texto.
>
> Eso si, no te olvides sustituir el nombre de instancia del campo de texto,
por
> el que tu tengas en tu MovieClip.
>
> <code>
> /* --------------------------------------------
> /*                LOCALIZADOR
> /* --------------------------------------------
> /* Clase que hereda de MC. Ser� el destino
> /* para los distintos items que se considere
> /* S�lo podr� tener un item activo
> /* Se ha definido como componente.
> /**********************************************/
>
> function localizador () {
>  // Propiedad definida en el panel de control
>  // localizador es un componente y tiene
>  // varios items asociados
>  ////this.localizadorFor = new Array()
>
>  this.addProperty ("actualItem", this.getActualItem,
this.setSetActualItem);
>
>  // Propiedad privada que contiene una
>  // referencia al item que est� posicionado
>  // en localizador
>  this.__actualItem__ = null;
>
>  this.init.call(this);
> }
>
> localizador.prototype = new MovieClip();
>
> localizador.prototype.init = function() {
>  // Creamos una nueva referencia a este localizador
>  // en todos los items que tiene asociados a trav�s
>  // del panel de propiedades
>  var i = int(this.localizadorFor.length);
>  while(i--) {
>   eval(this.localizadorFor[i]).localizador = this;
>  }
> }
>
> localizador.prototype.setActualItem = function(item) {
>  // Al item que estaba activo lo hacemos volver
>  // a su posici�n inicial
>  this.__actualItem__.volver.call(this.__actualItem__);
>
>  // seteamos el nuevo item activo
>  this.__actualItem__ = item;
>
>  // Al nuevo item activo lo reposicionamos
>  this.__actualItem__.mostrar.call(this.__actualItem__);
> }
>
> localizador.prototype.getActualItem = function() {
>  return this.__actualItem__;
> }
>
> /* --------------------------------------------
> /*                    AREA
> /* --------------------------------------------
> /* Clase que hereda de MC. Mostrara los datos
> /* de la zona seleccionada
> /**********************************************/
> function area() {
> // Declaramos como global una nueva variable que apunta a este objeto, sin
> saber su nombre de instancia
> // Seria preferible que usaras un singleton, o un servidor de nombres
interno,
> aunque eso ya lo desarrollas tu
> _global.areaIndex = this;
>  this.init(0);
>  this.init.call(this);
> }
>
> area.prototype = new MovieClip();
> area.prototype.setText = function (text) {
> // Sustituye aqu� el nombre de instancia que hayas puesto al campo de
> texto dentro del MC area
> // Este campo de texto ha de estar en el nivel 0 del MC, de manera que
> no puede estar dentro de
> // otro moviclip dentro de area.
> this.NombreCampoDeTexto.text = texto;
> }
> area.prototype.init = function(vista) {
>  this._visible = vista;
> }
>
> /* --------------------------------------------
> /*                  ITEM
> /* --------------------------------------------
> /* Clasee que hereda de MovieClip.
> /* Se encarga de saber d�nde se tiene que
> /* posicionar en todo momento
> /**********************************************/
> function item() {
>  // Almacenamos las coordenadas iniciales
>  this.initX = this._x;
>  this.initY = this._y;
>
>  //Par�metros ecuaciones ease Penner
>  this.t = new Number();
>  this.NFrames = new Number();
> }
>
> item.prototype = new MovieClip();
>
> // Seteamos los par�metros
> // para que el item se mueva desde
> // su posici�n inicial hasta la posici�n
> // de su localizador
> item.prototype.mostrar = function() {
>  delete this.onEnterFrame;
>
>  this.t = 0;
>  this.NFrames = 15;
>  this.endX = int(this.localizador._x);
>  this.endY = int(this.localizador._y);
>
>  this.dy = -(this._y - this.endY);
>  this.dx = -(this._x - this.endX);
>  this.y = this._y;
>  this.x = this._x;
>  this.sx = 300;
>  this.sy = 300;
>  this.reposition();
> }
>
> // Idem que mostrar() pero al rev�s
> item.prototype.volver = function() {
>  delete this.onEnterFrame;
>
>  this.t = 0;
>  this.NFrames = 15;
>  this.dy = -(this._y - this.initY);
>  this.dx = -(this._x - this.initX);
>
>  this.y = this._y;
>  this.x = this._x;
>  this.sx = 70;
>  this.sy = 70;
>  this.reposition();
> }
>
>
> item.prototype.reposition = function() {
>  this.onEnterFrame = effects.easeReposition;
> }
>
> item.prototype.onRelease = function() {
>  this.localizador.setActualItem(this);
> }
>
> item.prototype.onRollOver = function() {
>  //this.area.init(1);
>  if(this._xscale > 200) {
>   trace("");
>     areaIndex.init();
>     areaIndex.seText ("El texto que quiero que aparezca");
>  }
> }
>
> /* --------------------------------------------
> /*                  EFFECTS
> /* --------------------------------------------
> /* Clase est�tica con m�todos para gestionar
> /* las ecuaciones de movimiento.
> /* NOTE: los distintos m�todos se invocan
> /* en el �mbito de la instancia que los llama
> /**********************************************/
>
> function effects() {
> }
>
> effects.easeReposition = function() {
>  if (this.t++ < this.NFrames) {
>   this._y = Math.easeOutQuart (this.t, this.y, this.dy, this.NFRAMES);
>   this._x = Math.easeOutQuart (this.t, this.x, this.dx, this.NFRAMES);
>   this._xscale += (this.sx - this._xscale)/4;
>   this._yscale += (this.sy - this._yscale)/4;
>  } else {
>   this.t = 0;
>   delete this.onEnterFrame;
>  }
> }
>
>
> // Ease Equation tomada de robertPenner
> // www.robertPenner.com
> Math.easeOutQuart = function (t, b, c, d) {
>  return -c * ((t=t/d-1)*t*t*t - 1) + b;
> };
>
> // Registramos las clases
> Object.registerClass("localizador_MC",localizador);
> Object.registerClass("area", area);
> Object.registerClass("galicia",item);
> Object.registerClass("galicia2",item);
> </code>
> Sixto
>
>
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
> <!-------------------------------
> Lista ASNativos:
> subscripciones/desubscripciones
> http://www.sidedev.net/asnativos
> -------------------------------->
>

<!-------------------------------
Lista ASNativos:
subscripciones/desubscripciones
http://www.sidedev.net/asnativos
-------------------------------->

Responder a