|
|||
|
how do i use a DLL which can access the parallel port?
the functions are Inp32() and Out32() int Inp32(int port_address); void Out32(int port_address, int data_sent); i'd like to get the status of my parallel port and display them in a textfield in flash... ;D |
|
|||
|
|
|
|||
|
Code:
var path = getAdditionalFile("inpout32.dll");
Dll.registerFunction(path, "Inp32", "inp", "stdcall", "short", "short");
Dll.registerFunction(path, "Out32", "oup", "stdcall", "void", "short", "short");
oup(0x378, 0xFF);
trace(inp(0x378));
|
|
|||
|
thanks man...that really helped...hmmm, i have another things...for example i have a dynamic textfield in my flash movie which has a variable name of "mytext", how will i get the state of my parallel port and send it to that variable?
|
|
|||
|
if i'm gonna use what i got from the parallel port in an "if" condition, how will i do it? will i just use the variable i used in the ffishscript right away in actionscript? 'coz the motion of my object will depend on the data that flash will get from the parallel port...
![]() |
|
|||
|
You cannot access a FFish Script variable in Action Script.
In SWFKit Code:
var state = inp(0x378);
FlashPlayer.setVariable("mytext", state.toString());
FlashPlayer.targetCallLabel("_root", "myframe");
Code:
var value = parseInt(mytext);
if (value == 0)
{
...
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|