Using SFTP with Flash/Zinc - WeOnlyDo Discussion board

Using SFTP with Flash/Zinc (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Magnus Askenbäck, Wednesday, December 21, 2005, 09:33 (6726 days ago)

Hi all,
I've made an app using Flash and Zinc (www.multidmedia.com). Initially I used Zincs internal ftp engine, but since our customer wants sFTP instead and Zinc supports ActiveX, I thought this might be a good idea.

Got the tip from a guy on the Zinc forum about using wodSFTP for this, and he even sent me some code to get started, but now I'm stuck since I dont know how to use the event methods with Flash/Zinc.

The first thing I'm trying to do is just a simple Connected event , but I can't really figure out the syntax, anyone here got the clue on how to do this?

Below is the code he sent me for the Connect method:

[code]
function connectToServer(){

//Load component
id = 0 ;
xPosition = 0 ;
yPosition = 0 ;
myWidth = 0 ;
myHeight = 0 ;
activexObject = WeOnlyDo.wodSFTP ;
mdm.activex_load(id,xPosition,yPosition,myWidth,myHeight,activexObject);
mdm.activex_doverb_inplaceactivate(id);

//Set Blocking to true, like this, the component works
//quasi synchronous with AS-code
id = 0 ;
propertyName = Blocking ;
propertyType = boolean ;
newpropertyValue = true ;
mdm.activex_setproperty(id,propertyName,propertyType,newpropertyValue);

//Set Login Parameter
id = 0 ;
propertyName = Login ;
propertyType = string ;
newpropertyValue = XXXX ;
mdm.activex_setproperty(id,propertyName,propertyType,newpropertyValue);

//Set Hostname parameter
id = 0 ;
propertyName = Hostname ;
propertyType = string ;
newpropertyValue = myHost.XXX.YYY ;
mdm.activex_setproperty(id,propertyName,propertyType,newpropertyValue);

//Set password
id = 0 ;
propertyName = Password ;
propertyType = string ;
newpropertyValue = XXXXX ;
mdm.activex_setproperty(id,propertyName,propertyType,newpropertyValue);

//Run connect method
id = 0 ;
methodName = Connect ;
numberofArguments = 0 ;
mdm.activex_runmethod(id,methodName,numberofArguments);

};
[/code]

Any help with this would be highly appreciated.

Oh, the Zinc help documents would be found here:
http://www.multidmedia.com/support/learning/help/MDM_ZINCv2.5_UserManual.pdf

TIA

.magnus

Re: Using SFTP with Flash/Zinc

by wodSupport, Wednesday, December 21, 2005, 10:06 (6726 days ago) @ Magnus Askenbäck

Magnus,

I'm looking at your code, and the way it seems to me it works, I don't think you can have events at all - but I never used Zinc and I don't know about it's capabilities.

Did you ever manage to use events of any other 3rd party ActiveX control in Zinc? Do you have sample for that? If it can, I should be able to translate it for wodSFTP easily to help you out.

Re: Using SFTP with Flash/Zinc

by Magnus Askenbäck, Wednesday, December 21, 2005, 10:39 (6726 days ago) @ wodSupport

Thanks for the quick reply!

Nope, never used any ActiveX control in Zinc at all before, so I'm not much of help there.

But what about using the Notification parameter instead, would that be more doable? Just looking for a solution to have any kind of callback for the app...

cheers

.magnus

Re: Using SFTP with Flash/Zinc

by wodSupport, Wednesday, December 21, 2005, 10:40 (6726 days ago) @ Magnus Askenbäck

Magnus,

I doubt that. Using fast notifications is (even looks easier) technically hard to achieve here. You would need to implement interface in Zinc, and I doubt it can do that.

Can you ask Zinc support to show how to add any event to any 3rd control, and I could try to proceed from there.

Re: Using SFTP with Flash/Zinc

by Magnus Askenbäck, Wednesday, December 21, 2005, 10:50 (6726 days ago) @ wodSupport

Ok thanks, will get back as soon as I get any response from them!

.magnus

Re: Using SFTP with Flash/Zinc

by Magnus Askenbäck, Thursday, December 22, 2005, 12:09 (6725 days ago) @ Magnus Askenbäck

Looks like there are no way of using events yet... =/

Guess I have to use intervals to do stuff, but that feels a bit shaky and we're probably gonna use some other solution in the end. Ah well, worth a try anyway. =) Tnx for all the help!

.magnus

Re: Using SFTP with Flash/Zinc

by wodSupport, Thursday, December 22, 2005, 12:11 (6725 days ago) @ Magnus Askenbäck

Are you sure you need events at all? If you use Blocking property set to True, events are not needed.

Re: Using SFTP with Flash/Zinc

by Magnus Askenbäck, Thursday, December 22, 2005, 15:23 (6725 days ago) @ wodSupport

ok?! so why is that?

Re: Using SFTP with Flash/Zinc

by wodSupport, Thursday, December 22, 2005, 15:41 (6725 days ago) @ Magnus Askenbäck

Blocking is made for scripting-alike environment. When blocking is used, each method blocks your app until method completes. So, when you for example call Connect it will not go into background - it will actually connect and return back when it connects. After that you can put new methods, line by line, as needed.

You don't need events to act on them because nothing happens in the background.