We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Error #1006: value is not a function (AS3)

Hori76
Hori76 asked
on
Medium Priority
2,228 Views
Last Modified: 2013-11-11
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/group94imageMenu()
      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}));


//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}));		
	}

Open in new window

Comment
Watch Question

Commented:
Where the XMLList is created I used the wrong syntax:
var projectList:String = list[i].fotos.foto.thumb;
has to be:
var projectList:XMLList = list[i].fotos.foto.thumb;

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.