Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

andretlima

Desabilitar função, Desabilitar a função quando identificar um valor d

Recommended Posts

E ai pessoal td bem.. preciso de uma ajuda de vcs caso possam me ajudar..

 

Possuo uma rquivo flash onde o menu do sitge e conteudo é todo gerado apartir de um xml. se eu incluir uma linha no xml menu ele inclui mas um icone de menu.

Esse menus pelo que ue pude ver no depurador do flash.. quando clico no menu numero 2 ele me diz que a variavel dele é 2 por exemplo....

 

Ai que vem meu problema... gostaria que quando eu clicasse no menu 3 ele visse o valor da variavel id=3 e não executasse essa função a baixo.. e se fosse outro valor de id.. ele executasse ess função abaixo.. o arquivo que esta essa programação esta na biblioteca sento executada puxando da biblioteca..

 

Alguem poderia me ajudar porfavor?

 

a.onRollOver=function(){
	this._parent.overThumb(this.id);
	this.addTooltip();
}
// Stop highlighting the thumb when rolled out
a.onRollOut=function(){
	this._parent.outThumb(this.id);
	this.removeTooltip();
}
// When a thumbnail is clicked the right deeplink is set to the project movieclip
a.onRelease=function(){
	if(this.imgbig==undefined){
		this._parent._parent.setDeeplink(this.id);
	}else{
		_global.contentbase.showBig(this.imgbig,this.imgbigdes);
	}
	this.removeTooltip();
}

Compartilhar este post


Link para o post
Compartilhar em outros sites

E ai pessoal td bem.. preciso de uma ajuda de vcs caso possam me ajudar..

 

Possuo uma rquivo flash onde o menu do sitge e conteudo é todo gerado apartir de um xml. se eu incluir uma linha no xml menu ele inclui mas um icone de menu.

Esse menus pelo que ue pude ver no depurador do flash.. quando clico no menu numero 2 ele me diz que a variavel dele é 2 por exemplo....

 

Ai que vem meu problema... gostaria que quando eu clicasse no menu 3 ele visse o valor da variavel id=3 e não executasse essa função a baixo.. e se fosse outro valor de id.. ele executasse ess função abaixo.. o arquivo que esta essa programação esta na biblioteca sento executada puxando da biblioteca..

 

Alguem poderia me ajudar porfavor?

 

a.onRollOver=function(){

this._parent.overThumb(this.id);

this.addTooltip();

}

// Stop highlighting the thumb when rolled out

a.onRollOut=function(){

this._parent.outThumb(this.id);

this.removeTooltip();

}

// When a thumbnail is clicked the right deeplink is set to the project movieclip

a.onRelease=function(){

if(this.imgbig==undefined){

this._parent._parent.setDeeplink(this.id);

}else{

_global.contentbase.showBig(this.imgbig,this.imgbigdes);

}

this.removeTooltip();

}

 

Quem sabe se entendi direito!!!! Mas vamos lá.


if (a.id != 3) {
  a.onRollOver=function(){
    this._parent.overThumb(this.id);
    this.addTooltip();
  }
  a.onRollOut=function(){
    this._parent.outThumb(this.id);
    this.removeTooltip();
  }

  a.onRelease=function(){
    if(this.imgbig==undefined){
      this._parent._parent.setDeeplink(this.id);
    }else{
      _global.contentbase.showBig(this.imgbig,this.imgbigdes);
  }
  this.removeTooltip();
} // Se liga aqui pois no seu código tinha uma chave amais.

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

E ai pessoal td bem.. preciso de uma ajuda de vcs caso possam me ajudar..

 

Possuo uma rquivo flash onde o menu do sitge e conteudo é todo gerado apartir de um xml. se eu incluir uma linha no xml menu ele inclui mas um icone de menu.

Esse menus pelo que ue pude ver no depurador do flash.. quando clico no menu numero 2 ele me diz que a variavel dele é 2 por exemplo....

 

Ai que vem meu problema... gostaria que quando eu clicasse no menu 3 ele visse o valor da variavel id=3 e não executasse essa função a baixo.. e se fosse outro valor de id.. ele executasse ess função abaixo.. o arquivo que esta essa programação esta na biblioteca sento executada puxando da biblioteca..

 

Alguem poderia me ajudar porfavor?

 

a.onRollOver=function(){

this._parent.overThumb(this.id);

this.addTooltip();

}

// Stop highlighting the thumb when rolled out

a.onRollOut=function(){

this._parent.outThumb(this.id);

this.removeTooltip();

}

// When a thumbnail is clicked the right deeplink is set to the project movieclip

a.onRelease=function(){

if(this.imgbig==undefined){

this._parent._parent.setDeeplink(this.id);

}else{

_global.contentbase.showBig(this.imgbig,this.imgbigdes);

}

this.removeTooltip();

}

 

Quem sabe se entendi direito!!!! Mas vamos lá.


if (a.id != 3) {
  a.onRollOver=function(){
    this._parent.overThumb(this.id);
    this.addTooltip();
  }
  a.onRollOut=function(){
    this._parent.outThumb(this.id);
    this.removeTooltip();
  }

  a.onRelease=function(){
    if(this.imgbig==undefined){
      this._parent._parent.setDeeplink(this.id);
    }else{
      _global.contentbase.showBig(this.imgbig,this.imgbigdes);
  }
  this.removeTooltip();
} // Se liga aqui pois no seu código tinha uma chave amais.

 

isso não desabilitou a função no id=3. o que sera que pode ser?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tente na condição utilizar = if (this.id != 3) {

 

Se não der certo, poste o restante do código...

 

Mas eu não entendi bem a finalidade disso, se não quer que o botão funcione, não poderia removê-lo do XML ??

 

Att.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tente na condição utilizar = if (this.id != 3) {

 

Se não der certo, poste o restante do código...

 

Mas eu não entendi bem a finalidade disso, se não quer que o botão funcione, não poderia removê-lo do XML ??

 

Att.

 

é o seguinte.. gostaria de usar a mesma galeria que tenho para clientes.. só que gostaria de tirar a função de click apenas quando clicarem no cliente que nocaso é id 3...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tente utilizar a condição que citei apenas na função "onRelease" ou seja, você permanece com os eventos "Over" e "Out" mas sem o click...

Se não der certo poste o restante do cód como solicitado.

 

Att.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tente utilizar a condição que citei apenas na função "onRelease" ou seja, você permanece com os eventos "Over" e "Out" mas sem o click...

Se não der certo poste o restante do cód como solicitado.

 

Att.

 

Não deu certo.. ja to ficando doido. rsrsr

 

Seguinte.. vopu te explicar como ta funcionando..

 

Tenho um arquivo principal que se chama site que chama outro swf chamado galeria.. nessa galeria tem uma programação que pega o movie clip que tem essa programação a cima... não sei se isso ajuda em relação a level... ou to forçando? rs

Compartilhar este post


Link para o post
Compartilhar em outros sites

Queria ver o restante do cód para ver como você chegava nesse trecho... Provavelmente você está fazendo um laço de repetição (loop) e utilizando uma variável dentro dos parâmetros, tipo "for(i=0;i<..." Neste exemplo a variável contadora é "i"

Tente alterar então a condição para if (variavel != 3) { , dessa forma em cada laço quando chegar no item indesejado ele vai pular, mas lembre-se de verificar como iniciou sua variável, se foi do "0", então no caso não utilize o 3 e sim o 2 pois dentro do laço o "0" seria o primeiro registro...

 

Att.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Queria ver o restante do cód para ver como você chegava nesse trecho... Provavelmente você está fazendo um laço de repetição (loop) e utilizando uma variável dentro dos parâmetros, tipo "for(i=0;i<..." Neste exemplo a variável contadora é "i"

Tente alterar então a condição para if (variavel != 3) { , dessa forma em cada laço quando chegar no item indesejado ele vai pular, mas lembre-se de verificar como iniciou sua variável, se foi do "0", então no caso não utilize o 3 e sim o 2 pois dentro do laço o "0" seria o primeiro registro...

 

Att.

 

usei o que você disse não deu certo.. vou adicionar o código desse clip para você ver...

 

#initclip 0
wm_thumb=function(){}
var a=wm_thumb.prototype=new MovieClip();
// This is the movieclip for a thumbnail. They all move indepently based on their scrollposition.
a.startClip=function(info,id,x,y){
	// Setting the information
	this.id=id;
	this.my=y-1;
	this.out=false;
	// Setting the right shade amount
	if(_global.general.showshades){
		import flash.filters.GlowFilter;
		var glow:GlowFilter=new GlowFilter(0x000000,.8,10,10,_global.general.shadesstrength,3);
		this.filters=[glow];
	}
	// Checking for direct big image
	var big=info.attributes.imgbig;
	if(big!=undefined&&big.length>1){
		this.imgbig=big;
		this.imgbigdes=info.firstChild.nodeValue;
	}
	// Checking whether a thumbnail should be visible
	if(info!=undefined){
		this.des=info.attributes.des;
		var thumb=info.attributes.thumb;
		var a=this.attachMovie("imgholder","imgholder",10);
		a.loadImage(thumb);
	}else{
		this.attachMovie("nothumb","nothumb",10);
		this.enabled=false;
	}
	// Setting the start position of the thumbnail
	this.sx=this._x;
	this.sy=this._y;
	// Setting the left and right border for each thumbnail
	this.right=768;
	this.left=-80;
	this.rightborder=(_global.wc+10)+424;
	this.leftborder=(-_global.wc-170)+424;
	this.margin=Math.round((_global.w-848)/2)+500;
	if(this.sx>this.right){
		// Starting with a thumbnail that is not visible on screen
		var tx=this.sx+this.margin;
		this._x=tx;
		if(_global.general.thumbsverticalmotion){
			var ty=this.sy+(this.my*300);
			this._y=ty;
		}
		this.isin=false;
	}else{
		// Starting with a thumbnail that is visible on screen
		var tx=this.sx+(this.margin*2)+(y*(this.margin/2));
		this._x=tx;
		this.mD=setInterval(this,"startThumbs",300+(x*75));
		this.isin=true;
	}
	if(_global.colors.itemsbackground!=undefined){
		var c=new Color(this.bg);
		c.setRGB(_global.colors.itemsbackground);
	}else{
		this.bg._alpha=0;
	}
}
// Starting up the first thumbs to appear on screen
a.startThumbs=function(){
	clearInterval(this.mD);
	this.setScroll(0);
}
// When the image is loaded it is visible rightaway
a.imageLoaded=function(){
	this.cacheAsBitmap=true;
	this.hitArea=this.bg;
	this.imgholder.addDescription(this.des);
	this.imgholder.fadeImage(75);
}
// Highlighting the thumb when rolled over
a.onRollOver=function(){
	this._parent.overThumb(this.id);
	this.addTooltip();
}
// Stop highlighting the thumb when rolled out
a.onRollOut=function(){
	this._parent.outThumb(this.id);
	this.removeTooltip();
}

	if (variavel != 3) {
    a.onRelease=function(){
    if(this.imgbig==undefined){
      this._parent._parent.setDeeplink(this.id);
    }else{
      _global.contentbase.showBig(this.imgbig,this.imgbigdes);
  }}
  this.removeTooltip();
} // Se liga aqui pois no seu código tinha uma chave amais.














//// When a thumbnail is clicked the right deeplink is set to the project movieclip
//a.onRelease=function(){
//	if(this.imgbig==undefined){
//		this._parent._parent.setDeeplink(this.id);
//	}else{
//		_global.contentbase.showBig(this.imgbig,this.imgbigdes);
//	}
//	this.removeTooltip();
//}
// Hide the thumbnail when rolled over another thumbnail
a.hideMe=function(){
	if(!this.isin){
		return;
	}
	this.imgholder.fadeImage(30,4);
}
// Highlight the thumbnail when rolled over this thumbnail
a.showMe=function(){
	this.imgholder.fadeImage(100,3);
}
// Restore the old alpha value when no rollover over a thumbnail
a.restoreMe=function(){
	if(!this.isin){
		this.imgholder.fadeImage(75);
		return;
	}
	this.imgholder.fadeImage(75,4);
}
// Adding a thumb description when rolled over
a.addTooltip=function(){
	this.imgholder.tdes.showDescription();
}
// Hiding a thumb description when rolled out
a.removeTooltip=function(){
	this.imgholder.tdes.hideDescription();
}
// Setting the right scrollposition of a thumbnail
a.setScroll=function(s){
	var tx=this.sx+s;
	var dy=(this.my==0)? 0 : 300;
	this.speed=5;
	this.isin=true;
	if(tx>this.right){
		tx+=(this.margin+dy);
		this.speed=12;
		this.isin=false;
	}
	if(tx<this.left){
		tx-=(this.margin+dy);
		this.speed=12;
		this.isin=false;
	}
	this.tx=tx;
	this.onEnterFrame=this.getPosition;
}
// Tweening the thumbnail to the right position
a.getPosition=function(){
	this._x+=(this.tx-this._x)/this.speed;
	if(this._x>this.rightborder){
		this._visible=0;
	}else if(this._x<this.leftborder){
		this._visible=0;
	}else{
		this._visible=1;
	}
	if(_global.general.thumbsverticalmotion){
		var ty=this.sy;
		if(this._x>this.right){
			var ty=this.sy+((this.my*(this._x-this.right))/2);
		}
		if(this._x<this.left){
			var ty=this.sy+((this.my*(this.left-this._x))/2);
		}
		this._y=ty;
	}
	var dif=this.tx-this._x;
	dif=Math.sqrt(dif*dif);
	if(this.speed==12){
		if(dif<5){
			this._x=this.tx;
			this.onEnterFrame=null;
			if(this.out){
				this.removeMovieClip();
			}
		}
	}else{
		if(dif<.5){
			this._x=this.tx;
			this.onEnterFrame=null;
		}
	}
}
// Removing the thumbnail from stage
a.removeMe=function(){
	this.enabled=false;
	if(!this.isin){
		this.mD=setInterval(this,"doRemove",500);
	}else{
		var d=100+Math.round(this._x/2.5);
		this.mD=setInterval(this,"tweenOut",d);		
	}
}
// When the thumbnail was visible, tween it off the stage
a.tweenOut=function(){
	clearInterval(this.mD);
	this.speed=12;
	this.out=true;
	this.tx=0-this.margin-((this.my+1)*this.margin);
	this.onEnterFrame=this.getPosition;
}
// Do remove the thumbnail
a.doRemove=function(){
	clearInterval(this.mD);
	this.removeMovieClip();
}
// When the screen is resized a new left an right border for the thumbnail is defined
a.screenResized=function(){
	var nm=Math.round((_global.w-848)/2)+500;
	var dif=nm-this.margin;
	this.rightborder=(_global.wc+10)+424;
	this.leftborder=(-_global.wc-170)+424;
	if(!this.isin){
		if(this._x<400){
			this._x-=dif;
			this.tx-=dif;
			if(this._x<this.leftborder){
				this._visible=0;
			}
		}else{
			this._x+=dif;
			this.tx+=dif;
			if(this._x>this.rightborder){
				this._visible=0;
			}
		}
	}
	this.margin=nm;
}
Object.registerClass("thumb",wm_thumb);
#endinitclip 0

Compartilhar este post


Link para o post
Compartilhar em outros sites

Nossa... muito cód para olhar e não vi o loop...

Tente assim: Antes da função "onRollover", dê uns traces para ver se descobre a possível variável que possui o valor numérico desejado, ex:

trace(this);
trace(this.id);
trace(a);
entre outras...

 

E repare no output qual delas possui o valor. Então basta utilizar esta variável na condição e não literalmente o que sugeri : "variável", pois foi somente exemplo...

if (variavel != 3) {

 

 

testa ae...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Nossa... muito cód para olhar e não vi o loop...

Tente assim: Antes da função "onRollover", dê uns traces para ver se descobre a possível variável que possui o valor numérico desejado, ex:

trace(this);
trace(this.id);
trace(a);
entre outras...

 

E repare no output qual delas possui o valor. Então basta utilizar esta variável na condição e não literalmente o que sugeri : "variável", pois foi somente exemplo...

if (variavel != 3) {

 

 

testa ae...

 

verifiquei ele acha o id e mostrae exatamente onde eu quero como id=3 você não poderia me adicionar no msn e eu te mandar o arquivo.. acho que ficaria mais facil.. não pedindo para fazer pra mim ok.. só uma luz. rsrsrsrsrss desculpa insistencia.. qualquer coisa me adiciona no msn.. andret.lima@terra.com.br

Compartilhar este post


Link para o post
Compartilhar em outros sites

Nossa... muito cód para olhar e não vi o loop...

Tente assim: Antes da função "onRollover", dê uns traces para ver se descobre a possível variável que possui o valor numérico desejado, ex:

trace(this);
trace(this.id);
trace(a);
entre outras...

 

E repare no output qual delas possui o valor. Então basta utilizar esta variável na condição e não literalmente o que sugeri : "variável", pois foi somente exemplo...

if (variavel != 3) {

 

 

testa ae...

 

Agora sim deu para ter uma noção do pq não funcionou!

 

Você está utilizando prototipagem... sendo assim:

 

a.onRollOver=function(){
    if (this.id != 3) {
      this._parent.overThumb(this.id);
      this.addTooltip();
    }
  }
  a.onRollOut=function(){
    if (this.id != 3) {
      this._parent.outThumb(this.id);
      this.removeTooltip();
    }
  }

  a.onRelease=function(){
    if (this.id != 3) {
      if(this.imgbig==undefined){
        this._parent._parent.setDeeplink(this.id);
      }else{
        _global.contentbase.showBig(this.imgbig,this.imgbigdes);
    }
  }
  this.removeTooltip();

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

Nossa... muito cód para olhar e não vi o loop...

Tente assim: Antes da função "onRollover", dê uns traces para ver se descobre a possível variável que possui o valor numérico desejado, ex:

trace(this);
trace(this.id);
trace(a);
entre outras...

 

E repare no output qual delas possui o valor. Então basta utilizar esta variável na condição e não literalmente o que sugeri : "variável", pois foi somente exemplo...

if (variavel != 3) {

 

 

testa ae...

 

Agora sim deu para ter uma noção do pq não funcionou!

 

Você está utilizando prototipagem... sendo assim:

 

a.onRollOver=function(){
    if (this.id != 3) {
      this._parent.overThumb(this.id);
      this.addTooltip();
    }
  }
  a.onRollOut=function(){
    if (this.id != 3) {
      this._parent.outThumb(this.id);
      this.removeTooltip();
    }
  }

  a.onRelease=function(){
    if (this.id != 3) {
      if(this.imgbig==undefined){
        this._parent._parent.setDeeplink(this.id);
      }else{
        _global.contentbase.showBig(this.imgbig,this.imgbigdes);
    }
  }
  this.removeTooltip();

Cara brigadão por tentar me ajudar.. vou te dizer o que aconteceu.. quando joguei o código eme deu erro por faltar uma aspas.. COLOQUEI NO FINAL...

rodei o filme ele não desabilitou.. vou te passar o link do site... se você reparar ele desabilitou o bt da imagem dois das 3 galerias... digital, Eventos, Clientes.

 

Se puder dar uma olhada no site. www.iz3.com.br/galeria se puder me adicionar no seu msn caso tenha andret.lima@terra.com.br prometo não tomar muito seu tempo. rs

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.