View Full Version : Remote control through smart phone.
Smelter
27th February 2012, 00:12
Hey guys, I took the brass monkey flash library and made a app to use your iphone as a remote control. It took 20 minutes to write the flash code. Im just goofing off with the flash lib.
if you want to try the remote control on your iphone/ipad/ipod
The online service url is here
http://thebitstream.com/winremote/
Open this in app store to get brass monkey.
http://itunes.apple.com/us/app/brass-monkey/id455013514?mt=8
Brass monkey is site of the day for today :up:
http://www.thefwa.com/site/brass-monkey
We could add volume controls , etc to the remote too using the touch lib.
Smelter
27th February 2012, 00:17
THis is all the code it took to accomplish.
public var remote:BMApplication=new BMApplication();
public function boot():void
{
while(idLogo.numChildren)
idLogo.removeChildAt(0);
idLogo.addChild(new WinampLogo());
remote.initiate('Winamp Remote Control',1,'f056231599dd49a786216bb7aefb5b7d');
remote.addEventListener(DeviceEvent.DEVICE_LOADED, onDevice);
remote.addEventListener(DeviceEvent.DEVICE_DISCONNECTED, onDevice);
var clip:RemoteControlScheme=new RemoteControlScheme();
remote.session.registry.validateAndAddControlXML(BMControls.parseMovieClip(clip));
remote.start();
}
public function onButton(event:DeviceEvent):void
{
if(event.value.name=='onPlay' && event.value.state=='down')
ExternalInterface.call('window.external.Transport.Play');
if(event.value.name=='onPause' && event.value.state=='down')
ExternalInterface.call('window.external.Transport.Pause');
if(event.value.name=='onPrev' && event.value.state=='down')
ExternalInterface.call('window.external.Transport.Previous');
if(event.value.name=='onNext' && event.value.state=='down')
ExternalInterface.call('window.external.Transport.Next');
}
public function onDevice(event:DeviceEvent):void
{
if(event.type==DeviceEvent.DEVICE_LOADED)
event.device.addEventListener(DeviceEvent.SCHEME_BUTTON, onButton);
if(event.type==DeviceEvent.DEVICE_DISCONNECTED)
event.device.removeEventListener(DeviceEvent.SCHEME_BUTTON, onButton);
}
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.