Go Back   Northcode Support > SWF Studio V3
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 2012-06-21, 09:33 AM   #1
LuckyBoy
Registered User
 
Join Date: Jun 2011
Posts: 25
Question Activex question

Hi,

I try to deal with an ActiveX wich have a writable property that appear like this in the ActiveX Info tool:
Outputstate(Index asNumber) as Boolean

I understand it like this:
Outputstate(Index asNumber, Outputstate as Boolean)

My problem is how to set this property to true with ActiceX.setProperty?

I tried several ways but nothing work:
- ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:true}
- ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:0}
- ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate(0)", value:true}
- ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:[0,true]}
- ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:"0,true"}
- ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", value:{Index:0, OutputState:true}}

How to Deal with properties that have more than one parameter?

Any idea?

Thanks
LuckyBoy is offline   Reply With Quote
Old 2012-06-21, 07:37 PM   #2
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 11,873
Properties can be read-only, write-only or read/write. What it really tells you is whether there is a just a "setter" method, just a "getter" method or both.

The "setter" method looks like this:
Outputstate(Index as Number, value as Boolean)

The "getter" method looks like this:
Outputstate(Index as Number) as Boolean

That's basically why there is an ActiveX.getProperty and an ActiveX.setProperty, they call different methods on the underlying object.

The functionality you need Can't use arguments with ActiveX getPropery/setProperty was added/fixed in 3.7 build 197 so as long as you're using that (or something newer) you should be able to pass the Index to the ActiveX.setProperty call as well, like this...

ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", Index:0, value:true}
northcode is offline   Reply With Quote
Old 2012-06-22, 03:51 AM   #3
LuckyBoy
Registered User
 
Join Date: Jun 2011
Posts: 25
Smile

Thanks a lot for your answer.
Sorry for asking a question that be resolved long time ago.
LuckyBoy is offline   Reply With Quote
Old 2012-06-25, 04:54 AM   #4
LuckyBoy
Registered User
 
Join Date: Jun 2011
Posts: 25
Hi,

I tried it this afternoon with no success:

result = ssCore.ActiveX.setProperty({Object:"MyActivex, property:"Outputstate", Index:0, value:true}

--> result.success return false
--> result.result return nothing

result = ssCore.ActiveX.getProperty({Object:"MyActivex, property:"Outputstate", Index:0}

--> result.success return false
--> result.result return nothing

Get or Set property without argument works fine.
LuckyBoy is offline   Reply With Quote
Old 2012-06-25, 10:59 PM   #5
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 11,873
Did you check to see what kind of error was returned in result.Error.description?

What do you mean "Get or Set property without argument works fine"? If it "works fine" then what's the problem? Do you mean other get/set property calls work?

I really don't want to play 20 questions with you over several weeks so why don't you tell me what OCX you're trying to use and what you're trying to do so I can help instead of just guessing?
northcode is offline   Reply With Quote
Old 2012-06-26, 06:12 AM   #6
LuckyBoy
Registered User
 
Join Date: Jun 2011
Posts: 25
Hi,

ok I will do my best to be more clear. I don't wanna waste your time.

1 - Yes I checked "result.Error.description". It returned "Unexpected error".

2 - Yes I mean other get/set property calls works fine. My problem is focused on properties with multiple arguments.

3 - The OCX I try to use is "PhidgetInterfaceKit Class". You can get it here: http://www.phidgets.com/drivers.php. Although obviously, it only work if hardware is connected.
What I wanna do is very simple, it is to read and change the status of or more output of a Phidgets relay board.

Thanks
LuckyBoy is offline   Reply With Quote
Old 2012-06-26, 05:26 PM   #7
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 11,873
Quote:
I don't wanna waste your time.
Actually, I don't want to waste your time, I want to get you an answer/solution as fast as possible. I'll download the OCX and take a look.

I think I wrote a simple OCX to test properties with parameters. If I can find that I'll send it over (or I'll recreate it), along with a test FLA so we can compare notes.
northcode is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes