Am I missing something?! "Error #1006: value is not a function."

  • Hi, I am trying to create a custom event for the first time and I can't seem to even get started! I am using ActionScript 3 and Flash CS3, and version 1.0.7 of the AS3 Interface for krpano as suggested in this thread: 283. It is just a simple trace test - the simplest thing! - but I just hit the same brick wall every time: "Error #1006: value is not a function."

    I am using the exact code shown in many examples :-

    The krpano_as3_interface.as file is in the same directory as the above source code. Debug shows that it doesn't like the function myFunction. But this is what is used in many examples! The trace shows that myFunction is a function. Here is the output :-

    Code
    krpano initialised
    myfunction = function Function() {}
    TypeError: Error #1006: value is not a function.
    	at test_fla::MainTimeline/frame1()

    I have tried other names as well - all to no avail.

    I have tried making an anonymous package but that conflicts with the package in krpano_as3_interface.as, and I didn't want to complicate things with namespaces or a normal package hierarchy.

    Am I missing something? Is krpano_as3_interface.as all I need to have? I am no Flash/Actionscript 3 expert by any means, and I am new to krpano, however I have developed in many other languages for many years. I have read everything I could possibly find on this!

    Any suggestions would be much appreciated... *cursing* *cry*

    Edited once, last by michael360 (August 13, 2009 at 5:18 PM).

  • I have absolutely no experience with this but thought I would at least give you another perspective.

    Maybe the space before the word initialise. Or the spelling of the word itself?

    I also noticed you referred to the function as myFunction in your text but used lowercase in the code??? Could you have referred to it in upper case somewhere else?


    Or something here?

    krpano.set("events.myfu", myfunction);


    Probably not helping but I took a stab at it.


    One more thing I found on Google, It seems to discuss your issue but as I said, I am clueless to AS3.

    http://troyworks.com/blog/2008/07/2…not-a-function/

    Edited 2 times, last by Jarredja (August 14, 2009 at 4:28 AM).

  • Hi Jarredja,

    Thanks for trying to help, however, I don't think I have a solution yet...

    1. "krpano initialised" is part of the debug output (trace) - not code.
    2. Yes, sorry, I used "myFunction" in the write-up. However, it's all lower-case in the code.
    3. [krpano.set("events.myfu", myfunction);] is taken verbatim from https://krpano.com/docu/actions/#call - that is not to say it is right...
    4. Thanks for the link to the very good discussion - it is like many others I have read - but none of them seem to solve my problem. The error only ever occurs on line 16:

    krpano.set("events.myfu", myfunction);

    Perhaps someone could cut & paste my sample code into their Flash AS3 environment to see if they get the same error, or send some similar sample code that works for them? I have tried it on two machines/builds and get the same problem. I can't help feeling there is something wrong with the example - or something I am missing that the documentation is very vague about, or isn't mentioned...

    Much appreciated,
    Michael

  • Michael, maybe this is a dumb question, but are you testing your swf as a plugin for krpano, or are you running it independently? That is, is your swf loaded by krpano xml file or do you run it by itself. If you look at the krpano_as3_interface file, you will notice that while getInstance is defined, set is simply null. It must run inside krpano for set not to be null.

  • Kyle. It is not a dumb question: I had no idea I had to use a plugin for this! The documentation I could find leaves a lot, shall we say, to the imagination...

    Klaus - maybe worthwhile getting a technical author to write an introduction or something similar. There is a great deal that can be done with this great software and interface - that I am sure the vast majority of people are not using because of the lack of documentation and simple concise examples...

    Kyle, thanks very much. I can make a start now. Watch this space... *g* *cool*

  • Quote

    Klaus - maybe worthwhile getting a technical author to write an introduction or something similar. There is a great deal that can be done with this great software and interface - that I am sure the vast majority of people are not using because of the lack of documentation and simple concise examples...

    Hi,

    I know, the version 1.0.8 is now near ready, and when it was done my plan was to improve/update the complete documentation,

    best regards,
    Klaus

  • Michael, it took a little reading and experimenting (and examining the plugin examples source code), but I've been able to piece together a pretty decent idea of how krpano works. And it's actually pretty straightforward. But as you say, the documentation could be better.

    Klaus, do you have an approximate date for the 1.0.8 release? You've got some amazing new features in there that I'd like to try. Also, will 1.0.8 be a free upgrade from 1.0.7?

  • Klaus, do you have an approximate date for the 1.0.8 release? You've got some amazing new features in there that I'd like to try. Also, will 1.0.8 be a free upgrade from 1.0.7?

    Hi,
    I hope soon,

    but the 1.0.8 beta versions can also already be used - https://krpano.com/download/beta/

    the update is free of course, see here:

    https://krpano.com/buy/

    Quote

    The licensekey file is also valid for all following versions!

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!