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 :-
import krpano_as3_interface;
var krpano:krpano_as3_interface;
krpano = krpano_as3_interface.getInstance();
function myfunction(p1:String):void {
trace("myfunction");
}
if (krpano) {
trace("krpano initialised");
trace("myfunction = " + myfunction);
krpano.set("events.myfu", myfunction);
}
Display More
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 :-
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...