[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2009-02-10
Medium Priority
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:

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

Question by:Hori76
1 Comment

Accepted Solution

Hori76 earned 0 total points
ID: 23606372
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;

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question