here is a function srite from one of my menu :
----------------------------------------
function bouton_HT_numero(objet_in){
var objet = string(objet_in);
var L = objet.length;
var Numero = 999;
for ( var i=objet.length-1; i > 0; i-- ){
var M = parseInt(objet.substr(i,10));
if ( M > -1 ) {
Numero = M;
}
else
{
return Numero;
}
}
return Numero;
}
//------------------------------------------------------------
function bouton_HT_init(objet){
var Numero = bouton_HT_numero(objet);
switch ( Numero ){
case 1 : objet.btn_init( "mon texte 1");
break;
case 2 : objet.btn_init( "et le texte 2");
break;
case 3 : objet.btn_init( "voilà le 3");
break;
default : // objet.btn_init( "");
// juste pour les tests
objet.btn_init( "bouton "+Numero);
}
}
-----------------------------------
my buttons instances are called <bouton1>, <bouton2>....<bouton919>;
telle me if it is clearer like that. The <bouton_HT_init() is called from
inside the button once instancied (last instruction) with this syntax :
_root.bouton_HT_init(this);
--
Pierre Alain
pie@lifnet.com
"tsetliff" <webforumsuser@macromedia.com> a écrit dans le message de
news:bvtdoc$c8s$1@forums.macromedia.com...
[quoted text, click to view] > Hi Pierre,
>
> I am trying your code and not getting it to work.
> I copied and pasted the script into a frame.
> I labeled the buttons: 0,1,2.
>
> I don't have a clue as what to do now.
>
> Thanks again for the information!
>
> Tim
>
>