FORUMS: list search recent posts

actionscript flash

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
julienne rathore
actionscript flash
on Oct 6, 2009 at 11:34:50 am

Hello evryone,
Im trying to display thumbnails with a for loop but i would like that each thumbnail have an onrelease action ( I use a transparent button that I attach from the library. because onrelease doesnt work on a movieclip, i think)
For display the movieclip was not a probleme . but i canot make the onrelease to work, it work only in the last thumbnail


here is my script:

var posX = 163; //1st position
var posY = 103; //1st position
var Dec = 0; // var for the space between thumbnails set to 0

for (i=0; i<5; i++) {
var Num = i+1;
var Clp = "clip"+Num;
var bt_name = "bt"+Num;
var container = (container+Num);
var container:MovieClip = this.createEmptyMovieClip(Clp, this.getNextHighestDepth());
container.loadMovie("images.jpg",1);
container._x = posX;
container._y = posY+Dec;

bt.attachMovie(Btb, bt_name); // 'Btb' is the linkage name of my transparent button in my gallery
bt.onRelease = function() {
WhoIsOn = i;

};
bt._x = posX;
bt._y = posY+Dec;

Dec = Dec+50; // increment the space between thumbnails

}


Return to posts index

julienne rathore
I rewrite the code
on Oct 6, 2009 at 2:25:31 pm

i rewritten it but still the onrelease doesn't work in my script WHY ??

here is my script:(note: i use trace() for look if my loop works aswith the onrelease function)

var posX = 163;//1st position
var posY = 103;//1st position
var Dec = 0;// var for the space between thumbnails set to 0

for (i=0; i<5; i++) {
var Num = i+1;
var Clp_name = "clip"+Num;
var container = (container+Num);
var container:MovieClip = this.createEmptyMovieClip(Clp_name, this.getNextHighestDepth());
container.loadMovie("images/layout_05.jpg",this.getNextHighestDepth());
container._x = posX;
container._y = posY+Dec;

this.Clp_name.onRelease = function() {
WhoIsOn = i-1;
trace(WhoIsOn);

};
trace(Clp_name);
Dec = Dec+40;// increment the space between thumbnail
}



the think i dont understand is that i do the same simple onrelease function on a movieclip that i put in my stage it work. but not in my loop by using createEmptyMovieClip() function....Why ?.


Return to posts index

julienne rathore
Re: I rewrite the code with CODE TAG SORRY
on Oct 6, 2009 at 4:07:15 pm

sorry i forgot the code tag sorry

i rewritten it but still the onrelease doesn't work in my script WHY ??

here is my script:(note: i use trace() for look if my loop works aswith the onrelease function)


var posX = 163;//1st position
var posY = 103;//1st position
var Dec = 0;// var for the space between thumbnails set to 0

for (i=0; i<5; i++) {
var Num = i+1;
var Clp_name = "clip"+Num;
var container = (container+Num);
var container:MovieClip = this.createEmptyMovieClip(Clp_name, this.getNextHighestDepth());
container.loadMovie("images/layout_05.jpg",this.getNextHighestDepth());
container._x = posX;
container._y = posY+Dec;

this.Clp_name.onRelease = function() {
WhoIsOn = i-1;
trace(WhoIsOn);

};
trace(Clp_name);
Dec = Dec+40;// increment the space between thumbnail
}



the think i dont understand is that i do the same simple onrelease function on a movieclip that i put in my stage it work. but not in my loop by using createEmptyMovieClip() function....Why ?.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]