after successfully creating six movieclips, each holds a different image,
within a loop structure that calls duplicateMovieClip,
i am unable to use these movie clips as a button, ie my_mc.onRelease =
function(){}.. does not work, yet debug shows that the
clips exists and i use the name that debug shows and i can see them..to keep
this message short, i have attached pertintent code..
thanks Don97
1.) i created a dummy movie clip in lib and place an instance named "button"
on the stage,
but not viewable..
2.) then i make six duplicates using your syntax..
function showThumb(n:Number):MovieClip{
button.duplicateMovieClip("button"+n,100+n);
if(n<=4){
_root["button"+n]._x=80 * n;
_root["button"+n]._y = 345;
}else{
_root["button"+n]._x = 80 * (n-5);
_root["button"+n]._y = 410;
}
_root["button"+n].loadMovie(thumbImage[n]);
return _root["button"+n];
} //this code works in
that it produces
the six thumbnails
with images and
properly located
3.) then i call the function, which returns a movieclip..
for (j=0;j<total;j++){
thmAr[j] = showThumb(j);
trace("thmAr["+j+"] = "+thmAr[j]);
}
the trace, which is OUTSIDE of the showthumb() reveals
thmAr[0] = _level0.button0
thmAr[1] = _level0.button1
thmAr[2] = _level0.button2
thmAr[3] = _level0.button3
thmAr[4] = _level0.button4
thmAr[5] = _level0.button5
thmAr[6] = _level0.button6
4.) but when i try to use mc as button
thmAr[0].onRelease = function(){
trace("Button 0 Released");}
or
_level0.button6.onRelease = function(){
trace("Button 6 Released");}
No LUCK ... I am perplexed?? Don97