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

Posted on 2009-02-10
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
    LVL 2

    Accepted Solution

    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;

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    Make a UI for entering XML 3 63
    SVG, jquery, menu 14 54
    router and equipment 3 72
    Play RTMP without Flash 3 148
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
    In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now