Posted by dougi in SWF Studio V3 on Apr 09 2008, 03:33 am

Hi,

I have to translate the javascript code which manage my activeX component (and works) to the northcode api. i can't make it work ! i think that it comes from the way the activeX is implemented.

Here is a sample.








This activeX control have just one public method named getConfPlayer().

Any help will be appreciated.

Thanks in advance.


Posted by mbd in SWF Studio V3 on Apr 09 2008, 10:17 am

What is the code you have now? Perhaps we can see where things are going wrong.


Posted by dougi in SWF Studio V3 on Apr 10 2008, 05:24 am

I have put my activeX component in the Browser component and it works but it is not really what i want. I call a javascript method from flash with the setURL method and pass information from javascript to flash by setting the status of the browser in javascript and listen to status change into flash.

So here is what i have tried to directly implement the activeX component in SWF studio.

// create my activeX. it 's ok it works i see the video and any call make from the activeX interface works.
private function displayEconfPlayer():void
{
econf = ssCore.ActiveX.createObject({object:"myConf", progId:"xxxx.xxxx", left:10, top:90, width:510, height:580, visible:true});

if (!econf.success)
{
ssCore.App.showMsgBox({prompt:(("ERROR (" + econf.Error.code) + "): ") + econf.Error.description});
}
}

private function test():void
{
// try to make direct method call
// do not work
ssCore.myConf.AppExit();

// update aparameter on SceneControl object
// do not work
ssCore.myConf.SceneControl.Update1i({bstrNodeName:"member1", nFieldCode:6, lValue:false );

// make a call from Conf object
// do not work
ssCore.myConf.Conf.Call({ protocol:0, szAddress:"10.193.7.66", nCallType:0});

// try to get the Conf property and launch the call
// do not work
var return_obj:* = ssCore.ActiveX.getProperty({object:"myConf", property:"Conf"});
return_obj.Call(0,"10.193.7.66",0);
}

I have tried many things but nothing works. I think that it could come from the way the activeX have been implemented.

thanks for your help.


Posted by mbd in SWF Studio V3 on Apr 11 2008, 09:47 am

First thing, did you enable synchronous commands? Check my signature for the FAQ.

Second, do you see any error messages? You are checking for success of the ActiveX object being created, but if you don't have sync commands enabled, it will fail but you won't get an error description.

The rest of your calls don't have any error checking so you would have no way to know if they are successful or not.

Are you publishing your SWF for AS3?


Posted by dougi in SWF Studio V3 on Apr 14 2008, 04:35 am

Hi,

i'm working with flex3.

i have activated synchronous commands in applicationComplete event handler and now before each swf studio request...but it still does not work. No error message is returned and no request arrive to my activeX as i can see on my debugger since today. So i think the problem come from the syntax of my request.

Thanks for your help.


Posted by mbd in SWF Studio V3 on Apr 14 2008, 10:04 am

You only have to enable synchronous commands once - not that it would make anything not work.

Can you try this slight change? Before you build your EXE enable the debug option in the Output tab.
private function displayEconfPlayer():void
{
   var econf = ssCore.ActiveX.createObject({object:"myConf", progId:"xxxx.xxxx", left:10, top:90, width:510, height:580, visible:true});
   
   if (econf.success)
   {
      ssDebug.trace('ActiveX object created');
   }
   else
   {
      ssDebug.trace("ERROR (" + econf.Error.code + "): " + econf.Error.description);
   }
}

private function test():void
{
   // try to make direct method call
   var r:Object = ssCore.myConf.AppExit();
   
   if (r.success)
   {
      ssDebug.trace('myConf.AppExit called successfully');
   }
   else
   {
      ssDebug.trace('ERROR - calling myConf.AppExit: '+r.Error.description);
   }
}

That should give you results in the case of a failure or success.

Note: have SWF Studio open and displaying the Trace tab to see the trace messages.

You might also want to try including the Flash debug player (option in the Output tab) in case there's a runtime error happening somewhere.


Posted by dougi in SWF Studio V3 on Apr 15 2008, 03:48 am

I have tested your code...Thanks

first return for activeX creation is "ERROR(0):"
second is "myConf.AppExit called successfully"

The ActiveX is a visio component. I can see my locale video. and when the controls are embedded inside the component i can have a communication without any problem. So i want to say that the component is correctly created.

For the second, i say that it's OK whereas for it the component i have not been created before and i can't see any trace of this action on my debugger ( I use dbview). When i embed the activex in the swf studio browser component, it works and all the actions are traced in my debugger so i'm sure it works.

Any ideas ?

Thanks again.


Posted by mbd in SWF Studio V3 on Apr 15 2008, 09:37 am


QUOTE:
first return for activeX creation is "ERROR(0):"
That doesn't make any sense. If the error code is 0, that would mean success, so the success parameter should be true and you'd never see that text, you would see: "ActiveX object created".

QUOTE:
second is "myConf.AppExit called successfully"
So do you see the ActiveX control behave properly when that command is executed?

As for the other commands, this would cause a compiler error so this is probably not the actual code you are using:

ssCore.myConf.SceneControl.Update1i({bstrNodeName:"member1", nFieldCode:6, lValue:false );You're missing the last }.

Also, the names of the parameters you use MUST correspond with the names of the parameters listed when you view the documentation from the ActiveX Info tool. Open the ActiveX Info tool from SWF Studio. Scroll to your control and double-click it. Your browser should open with a listing of the control's public methods, properties, and events. You need to use the names of the parameters listed for the method you are executing. The order doesn't matter.

This would not work:

var return_obj:* = ssCore.ActiveX.getProperty({object:"myConf", property:"Conf"});
return_obj.Call(0,"10.193.7.66",0);

ActveX.getProperty will return the value of the property, but it will only return the value converted into a string. You can't pass objects across to Flash (well, only Flash generic objects).

If you copied my code exactly and got "ERROR (0):" then there might be a bug in the API. I have tested various controls and haven't been able to reproduce this.

Can you post (or send a copy to support at northcode.com) your FLA, SPF, and the ActiveX control you are having problems with?


Posted by dougi in SWF Studio V3 on Apr 20 2008, 10:07 am

Hi,
sorry for the delay and thanks for your quick answer.

the activeX info tool list only one method called geteConfPlayer(). I think it's directly linked to the component structure. What it 's sure is that it works on a web page with the code i give you in the first post.

The activeX control is paying but i 'm interested by your help and i will try to see if they have a trial license.

I will make more tests and will give u the results at the end of the week.

Thanks again for you help.


Posted by dougi in SWF Studio V3 on Apr 21 2008, 06:21 am

Hi,

i took the time to make the tests again.

First, you are right, i made a mistake and now here are the sequences of messages i 've got.

'ActiveX object created'

then

'myConf.AppExit called successfully'

As u can see in my source file, i have the same behavior with some others methods call.

i also confirm that these actions never reach the activeX as i can see with my debugger.

I have joined a snapshot of the activex info tool with my component and the source of my flex basic application.

I'm currently trying to see if i can get some trial license to allow u to make some tests as u ask me.

attachments: econf_with_activeX_info_tool.JPG   SwfStudioDirectIntegration.mxml.txt  


Posted by mbd in SWF Studio V3 on Apr 21 2008, 11:07 am

If ActiveX Info only finds one method, then I would be surprised that you could call anything other than that one method with a SWF Studio app. The two use the same code to find info about the control.

If the control doesn't expose its members in a way that ActiveX Info can find them, then you probably won't be able to call any of them.


Posted by dougi in SWF Studio V3 on Apr 21 2008, 11:18 am

Yes, i know but it should be the same problem when it is embedded in an html page and it's working.

QUOTE: from mbd;44018
If ActiveX Info only finds one method, then I would be surprised that you could call anything other than that one method with a SWF Studio app. The two use the same code to find info about the control.

If the control doesn't expose its members in a way that ActiveX Info can find them, then you probably won't be able to call any of them.


Posted by northcode in SWF Studio V3 on Apr 21 2008, 02:10 pm


QUOTE:
Yes, i know but it should be the same problem when it is embedded in an html page and it's working.No, you've missed the point. If there's a problem with AXInfo (and the code in the SWF Studio player) that handles the method call then the problem is in SWF Studio not in the OCX or JavaScript.