Flex

Calling multiple methods from one RemoteObject in Flex and Actionscript using BlazeDS

Posted in Flex, web-dev on August 19th, 2009 by Nick – Be the first to comment

BlazeDS allows us to use RPC to access our Java objects from an Adobe Flex or AIR app. This is a simple example that allows you to have a remote java object which you will make calls upon from Flex (or Actionscript). There are plenty of BlazeDS remoting tutorials out there. This HOW-TO shows how to create an actionscript class to handle your remote objects and handlers as well as linking more than one method to a single remote object.
read more »

Looping Sound in Flex and AIR

Posted in Flex on July 27th, 2009 by Nick – 4 Comments

This is a short example of how to play an audio clip and loop it in Flex, and works with AIR. Some of this code is taken from the Sound class example in the Adobe Flex Language Reference docs.

You can paste this into pretty much any function, like an init():

var soundReq:URLRequest = new URLRequest("someSound.mp3"); 
var sound:Sound = new Sound(); 
var soundControl:SoundChannel = new SoundChannel(); 
sound.addEventListener(Event.COMPLETE, completeHandler);
sound.addEventListener(Event.ID3, id3Handler);
sound.addEventListener(IOErrorEvent.IO_ERROR, ioSoundErrorHandler);
sound.addEventListener(ProgressEvent.PROGRESS, progressHandler);
sound.load(soundReq); 
soundControl = sound.play(0, int.MAX_VALUE);

read more »