Posted by cwills in Plugin Development on Aug 05 2008, 05:46 pm

Alright I am trying the Sample to work, but I don't seem to get the results that I am expecting. I have a pretty simple fla file that has the following code.

ssCore.init();

myButton1.addEventListener( MouseEvent.CLICK, myTest )
myButton2.addEventListener( MouseEvent.CLICK, myTest2 )

ssCore.Plugin.getCommands({alias:"Sample"}, {callback:"getCommandsEvent"});
ssCore.Sample.SetNotify({event:"onTick"}, {callback:"tickEvent"});
ssCore.Sample.SetNotify({event:"onTickCountChanged"}, {callback:"tickCountChangedEvent"});

function myTest( myVar:MouseEvent ):void
{
   ssCore.Sample.BeginTicking();
}
function myTest2( myVar:MouseEvent ):void
{
   ssCore.Sample.StopTicking();
}
function tickEvent(ret_obj, cb_obj, err_obj)
{
   if (ret_obj.success)
    {
      ssDebug.trace("tickEvent");
    }
}
function tickCountChangedEvent(ret_obj, cb_obj, err_obj)
{
   if (ret_obj.success)
    {
      ssDebug.trace("tickCountChangedEvent");
    }
}
function getCommandsEvent(ret_obj, cb_obj, err_obj)
{
   if (ret_obj.success)
    {
      ssDebug.trace(ret_obj.result);
    }
}


What happens is that the getCommandsEvent works as expected.

The behavior that I get that is unexpected is that the events are fired off before I even call BeginTicking. Once I do call the BeginTicking, I can hear the console beeping, but no events are fired off.


Posted by cwills in Plugin Development on Aug 07 2008, 05:11 pm

Additional information.

I am using CS3 and VS2008.

My compiled Sample.dll from VS2008 works just fine with your Test and Code Test projects. I noticed that both of those are AS2. My AS3 test project doesn't work quite right. Can anyone help?


Posted by Dan in Plugin Development on Aug 08 2008, 09:46 am

We have been looking into this, and also concluded that it works fine under AS2. We have a few tests to do under AS3 to see why that scenario is different.


Posted by cwills in Plugin Development on Aug 13 2008, 04:07 pm

Any conclusions?


Posted by northcode in Plugin Development on Aug 13 2008, 04:17 pm

There were several problems that came together to break the C# example (i) the sample itself used "SetNotify" instead of "setNotify" (ii) the AS3 core did a case sensitive compare of the names and (iii) the shim that handles the lookup of names in the plugin (via reflection) should have dropped the case of the first letter of the method name for compatibility with the C++ plugin naming convention. We've fixed all of these and they'll be available in the next release. If you really need it now, drop us an email (support@northcode.com) with your serial number and we'll get you fixed up.