1. Add sound to your Flex application:
[Embed(source="media/audibles/chimeup.mp3")]
[Bindable]
public var chimeup:Class;
public var snd_chimeup:Sound = new chimeup() as Sound;
public var sndChannel_chimeup:SoundChannel;
public function playChimeup():void {
sndChannel_chimeup = snd_chimeup.play();
}2. Making some code be executed at given intervals:
public function ShortTimer():void
{
var minuteTimer:Timer = new Timer(300000, 0);
minuteTimer.addEventListener(TimerEvent.TIMER, onTick);
minuteTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
minuteTimer.start();
}
public function onTick(evt:TimerEvent):void
{
<!-- Put here the code you need to be executed --->
}
public function onTimerComplete(evt:TimerEvent):void
{
ShortTimer();
}Things to be noted here:
3. Load CSS at runtime
Ruben Swieringa have a very nice tool - CSSLoaderthat allow you do that.
But there is a "spoon of tar". There seem to be cases when the CSS from the external file will not be applied to your application parts. So far it didn't work for me in the following cases:
4. Loading configuration data at runtime
Using something like
var request:URLRequest = new URLRequest('config.xml?' + Math.random());
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onResponse);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorListener);
loader.load(request);will allow you load your configuration and when done the onResponsefunction will be executed. And the onResponsemay look like this:
[Bindable]
private var siteURL:String;
private function onResponse(event:Event):void
{
var loader:URLLoader = event.target as URLLoader;
var _xml:XML = new XML(loader.data);
var _feeds:XMLList = _xml.item;
for each (var item:XML in _feeds ) {
siteURL = item.siteURL.toString();
}
}OK. That's a start. And hereyou can see and try the current version of the chat.




























