views:

192

answers:

1

Hi All, I am very new to Action Script. I am using Flash Professional CS5 with ActionScript 3.0. The problem is, When I am trying to use fscommand2 function, Flash Compiler throwing an error saying:

Scene 1, Layer 'Layer 1', Frame 1, Line 7   1180: Call to a possibly undefined method fscommand2.

But, I am able to use fscommand. But, it is for different purpose, so will not fulfill my requirement to get Device(Mobile) properties like DeviceID etc.

Please help me in using fscommand2 or any equivalent API support in ActionScript 3.0. Thanks in advance.

+1  A: 

It depends on which fscommand2 you want to use. fscommand2 is a Flash Lite API, so the only time you'd use it with AS3 would be if you're targeting Flash Lite 4 (which supports AS3 and is back-compatible with fscommand2).

For general AS3 development, some fscommand2 functionalities are replaced by normal AS3 APIs. For example:

// status = fscommand2("FullScreen", true);
// replaced by:
stage.displayState = StageDisplayState.FULL_SCREEN;

// status = fscommand2("GetTotalPlayerMemory");
// replaced by:
trace( System.totalMemory );

But some other fscommand2 functions, like dealing with soft keys, signal level, etc. have no AS3 equivalent. Those are mainly the commands that you couldn't use in a browser anyway though, so I don't think you actually lose any functionality for browser contents.

Anyway, the short version is that you just have to find an equivalent AS3 command for what you'd like to do - so please let us know that, or open a followup question. ;)

fenomas
It would be helpful, if you can tell me how to get Device ID in Action Script 3.0 ?
Andhravaala
I'm afraid there's no AS3 analog for device IDs right now, since Flash doesn't get access to things like MAC addresses. You might like to look into some libraries for GUIDs though? http://www.google.com/search?q=as3+GUID
fenomas
Also, if you're using Flex, it has a similar library function: mx.utils.UIDUtil.createUID();
fenomas
ok .. thank you for ur help !!
Andhravaala