Here is a class file I wrote to copy stuff to the PC clipboard ( I use a double click to trigger the event). As part of the copying process, it makes the pc speacker "ding". The sound is in an assets folder. I made an mp3 out of the standard windows ding sound.
package myClassLibrary
{
import flash.system.System;
import mx.core.SoundAsset;
import mx.utils.StringUtil;
public class ClipBoardCopy
{
[Embed(source="assets/sounds/ding.mp3")]
private static var
SoundDingClass:Class;
[Bindable] private static var Sound_Ding:SoundAsset =
SoundAsset(new SoundDingClass());
public static function SetClipboard_fromGrid(EventItem:*):void {
var ItemLabel:String;
ItemLabel = StringUtil.trim(EventItem.itemRenderer.listData.label);
if(ItemLabel != ""){
System.setClipboard(ItemLabel);
Sound_Ding.play();
}
}
public static function SetClipboard_fromLabel(EventItem:*):void
{
var ItemLabel:String;
ItemLabel = StringUtil.trim(EventItem.currentTarget.text);
if(ItemLabel != ""){
System.setClipboard(ItemLabel);
Sound_Ding.play();
}
}
public static function
SetClipboard_fromString(inString:String):void {
var ItemLabel:String;
if (inString != null){
ItemLabel = StringUtil.trim(inString);
if(ItemLabel != ""){
System.setClipboard(ItemLabel);
Sound_Ding.play();
}
}
}
}
}
----- Original Message -----
From: cuttenv
To: [email protected]
Sent: Wednesday, March 24, 2010 8:01 PM
Subject: [flexcoders] PC Speaker Beep
Hi everyone I have a quick question about the PC Speaker. Is there a way to
make a call from Flex to make the PC speaker beep? What about in Adobe Air?
Thanks in advance!
ding.mp3
Description: audio/mpeg

