Hori76
asked on
Error #1006: value is not a function (AS3)
Inside a function group94imageMenu I have a loop that generates a photogallery from an xml-list, but everytime I want to use the loop I get the following error.
TypeError: Error #1006: value is not a function.
at content_fla::MainTimeline/ group94ima geMenu()
at MethodInfo-219()
If I trace (thumbs) before the for-loop I get following output:
<thumb>foto1.jpg</thumb>
<thumb>foto2.jpg</thumb>
<thumb>foto3.jpg</thumb>
How can I implement this array so the result would be:
imageMenu.addItem(new imageMenuItem('foto1.jpg', showImage, {thumbnails:thumbList}));
imageMenu.addItem(new imageMenuItem('foto2.jpg', showImage, {thumbnails:thumbList}));
imageMenu.addItem(new imageMenuItem('foto3.jpg', showImage, {thumbnails:thumbList}));
TypeError: Error #1006: value is not a function.
at content_fla::MainTimeline/
at MethodInfo-219()
If I trace (thumbs) before the for-loop I get following output:
<thumb>foto1.jpg</thumb>
<thumb>foto2.jpg</thumb>
<thumb>foto3.jpg</thumb>
How can I implement this array so the result would be:
imageMenu.addItem(new imageMenuItem('foto1.jpg',
imageMenu.addItem(new imageMenuItem('foto2.jpg',
imageMenu.addItem(new imageMenuItem('foto3.jpg',
//this is my code, but it gives the #1006 error
trace (thumbs);
for(var i=0; i<thumbs.length(); i++){
var thumbList:String = thumbs[i];
imageMenu.addItem( new imageMenuItem(thumbList, showImage, {thumbnails:thumbList}));
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.