Kax! ilyaslamasse! anyone! help!

hello again guys…
I have same problems with array(again)… i hope u could help me…

here’s the condition:

  1. i’m duplicating movieclip as a button
  2. when i release the current button*, I want it’s _visible = false;
    and images(mc that has frame contain image).gotoAndStop*;
  3. Other buttons, _visible = true;

code:

//duplicate movieclip(butThumb)

butThumb._visible = false;
for (i=1; i<=5; i++) {
butThumb.duplicateMovieClip(“butThumb”+i, i);
thisBut = this[“butThumb”+i];
if (i>1) {
thisBut._y = this[“butThumb”+(i-1)]._y+this[“butThumb”+(i-1)]._height+10;
}

/here’s the problem (I don’t know how to tell other butThumb except this butThumb that i’m pressing, _visible = true;)/

this["butThumb"+i].ii = i-1;
this["butThumb"+i].onRelease = function() {
	this._visible = false;
                            images.gotoAndStop(i);
};

}

please help me guys:(
thank u…

so quiet around here… where’s everybody…:cyclops:

try to use

with(MCname) {
functions
}

this[“butThumb”+i].ii = i-1;

I’m trying to help you out… but where is the .ii coming from?

ok, nevermind… I dont think the domain of the question is even there… what I would do in the function is a loop


this["butThumb"+i].onRelease = function() {
     this._visible = false;
     images.gotoAndStop(i);

     for (x = 1, x <=5, x++){
          if (x != i){
               this["butThumb"+x]._visible = true
          }     
     }
}

the for loop says that everytime except when x is equal your current index, it should make the button visible…

does this help?

sorry for the late reply…

thank u for the code,
i’ll inform the progress…i’m on it now…

i’m done with the project…(deadline suck!)
but not the way I want it…

I’m startin this from zero again…
1st evaluation :

for lavaboy
PHP:--------------------------------------------------------------------------------
this[“butThumb”+i].onRelease = function() {
this._visible = false;
images.gotoAndStop(i);

 for (x = 1, x &lt;=5, x++){
      if (x != i){
           this["butThumb"+x]._visible = true
      }     
 }

}


it’s not workin…

I attach my fla for u to see…:slight_smile:

this["butMain"+i].onRelease = function() {
	for (x=1; x<=photoArray.length; x++) {
		this._parent["butMain"+x]._visible = true;
	}
	this._visible = false;
}

??

it’s about time man… you’re always there to solve the problems…
where have u been??

can i put your link for the credits when my personal page is online???:slight_smile:
(what is it?)

a question : this._parent, is it the same statement with _root. in this situation??

thank u so much … this is for my appreciation[SIZE=4]KAX THE SAVIOR …[/SIZE]

and by the way…

[COLOR=red][SIZE=4]Happy Belated Birthday !!![/SIZE][/COLOR] :stuck_out_tongue:

it’s about time man… you’re always there to solve the problems…
where have u been??

i’ve been really drunk celabrating my past birthday :stuck_out_tongue:

not kidding … it was my birthday march 7th :slight_smile:

can i put your link for the credits when my personal page is online???
(what is it?)

nah … you don’t need to :wink: [size=1]besides i don’t have a site :P[/size]

a question : this._parent, is it the same statement with _root. in this situation??

yes … but i prefer _parent so you can place everything into a movie clip if needed and the script should still work :wink:

thank u so much … this is for my appreciation KAX THE SAVIOR …

no problem man =) :wink:

*Originally posted by indojepang *
**and by the way…

[COLOR=red][SIZE=4]Happy Belated Birthday !!![/SIZE][/COLOR] :stuck_out_tongue: **

thanks =)

i really appreciate it :wink:

for (x=1; x<=photoArray.length; x++) {
this._parent[“butMain”+x]._visible = true;

should be : photoArray.length+i
isn’t kax?..

next problemo… :slight_smile:
the images(MC), u forgot to write it , if i only put this:

this[“butMain”+i].onRelease = function() {
[COLOR=red]images.gotoAndStop(i);[/COLOR]
for (x=1; x<=photoArray.length; x++) {
this._parent[“butMain”+x]._visible = true;
}
this._visible = false;
}

the images gotoAndStop the last frame on the MC…

Ok, I am confused. I don’t see any problems after what Kax posted. And I don’t see anything on your stage besides the buttons (which are 1 frame), so what are you gotoAndPlaying?

The script there should work.

Nevermind, I just tested it, I see what you mean.

[AS]this[“butMain”+i].playVar = i;
this[“butMain”+i].onRelease = function() {
images.gotoAndStop(this.playVar);
for (x=1; x<=photoArray.length; x++) {
this._parent[“butMain”+x]._visible = true;
}
this._visible = false;
};[/AS]

fixed.

the fla…i forgot

refer above :wink:

WOWOW… THANK U VERY MUCH LOST!!! U’RE GREAT!! THANK’S

but what does (this[“butMain”+i].playVar = i;) means?
is it (this[“butMain”+i]) has another virtual clip??

(if this question make u laugh…well… that’s me…)

thank u for solving this Lost!! u’re throw away my headache…

this[“butMain”+i].playVar = i

It creates a variable on your clip called playVar.

It sets the value of the variable to whatever value “i” is equal to at that time in the for loop.

We then call this variable (this.playVar since the variable is in that clip) in the onRelease of the this[“butMain”+i] clip.