I think my question is very similar to LordofLimbos but before this one except he is using an array and i am not. Well here goes:
The function populatealbum is called somewhere else in the movie.
It holds a code to create several movieclips filled with pictures loaded from a folder. That all works fine.
What i want to do is have it also make the pictures i load in be interactive with an onRollOver or onPress.
So i then figure why not just assign an onRollOver function to each ["pic"+i] movieclip which holds each image. But it isnt working.. it isnt even recognizing it as something that can be rolled over when i run the movie. Help would be appreciated greatly.
function populatealbum() {
for(i=1; i<=_root.picnumber; i++)
{
menubar.menuone.createEmptyMovieClip("pic"+i, i);
menubar.menuone["pic"+i]._xscale = 100;
menubar.menuone["pic"+i]._yscale = 100;
if (i == 1)
{
menubar.menuone["pic"+i]._x = 30;
menubar.menuone["pic"+i]._y = 0;
}
else
{
menubar.menuone["pic"+i]._x = menubar.menuone["pic"+(i-1)]._x + 120;
}
loadMovie(_root.selectedphoto+"thumbs/"+i+".jpg", menubar.menuone["pic"+i]);
_root.menuwidth += 120;
// THE PROBLEM IS IN HERE
menubar.menuone["pic"+i].onRollOver = function()
{
// JUST USING A Y MOVEMENT TO TEST
this._y += 20;
}
}// END OF FOR STATEMENT
_root.prepicnumber = _root.picnumber;
}// END OF FUNCTION
- function populatealbum() {
-
- for(i=1; i<=_root.picnumber; i++)
- {
- menubar.menuone.createEmptyMovieClip("pic"+i, i);
- menubar.menuone["pic"+i]._xscale = 100;
- menubar.menuone["pic"+i]._yscale = 100;
- if (i == 1)
- {
- menubar.menuone["pic"+i]._x = 30;
- menubar.menuone["pic"+i]._y = 0;
- }
- else
- {
- menubar.menuone["pic"+i]._x = menubar.menuone["pic"+(i-1)]._x + 120;
- }
- loadMovie(_root.selectedphoto+"thumbs/"+i+".jpg", menubar.menuone["pic"+i]);
- _root.menuwidth += 120;
-
- // THE PROBLEM IS IN HERE
- menubar.menuone["pic"+i].onRollOver = function()
- {
- // JUST USING A Y MOVEMENT TO TEST
- this._y += 20;
-
- }
-
-
- }// END OF FOR STATEMENT
- _root.prepicnumber = _root.picnumber;
- }// END OF FUNCTION