Start blogging by creating a new post. You can edit or delete me by clicking under the comments. You can also customize your sidebar by dragging in elements from the top bar.
venkatesh.A
8/2/2011 01:55:00 am

fs_btn.addEventListener(MouseEvent.CLICK,go);
stage.addEventListener(KeyboardEvent.KEY_DOWN,exit);
function exit(eve:KeyboardEvent):void
{
if(eve.keyCode == 37)
{
stage.displayState = StageDisplayState.NORMAL;
trace("Normal state");
}
}
function go(eve:MouseEvent):void
{
if(stage.displayState == StageDisplayState.FULL_SCREEN)
{
stage.displayState = StageDisplayState.NORMAL;

}
else
{
stage.displayState = StageDisplayState.FULL_SCREEN;
}


}

Reply
8/5/2011 03:48:56 pm

var musicReq: URLRequest;
var music:Sound = new Sound();
var sndC:SoundChannel;
var currentSnd:Sound = music;
var position:Number;
var songPaused:Boolean;
var songStopped:Boolean;
var xml:XML;
var songList:XMLList;
var loader:URLLoader = new URLLoader();

var timer:Timer = new Timer(30000);
timer.addEventListener(TimerEvent.TIMER,stopMusic);
timer.start();

function stopMusic(event:TimerEvent):void
{
SoundMixer.stopAll();
play_btn.visible = true;
}


loader.addEventListener(Event.COMPLETE, Loaded);
loader.load(new URLRequest("musiclist.xml"));
play_btn.visible = false;

function Loaded(e:Event):void{
xml = new XML(e.target.data);
songList = xml.song;
musicReq = new URLRequest(songList[0].url);
music.load(musicReq);
sndC = music.play();
}

play_btn.addEventListener(MouseEvent.CLICK, playSong);
pause_btn.addEventListener(MouseEvent.CLICK, pauseSong);


function playSong(e:Event):void{
pause_btn.visible = true;
play_btn.visible = false;
sndC = music.play();

if(songPaused)
{
sndC = currentSnd.play(position);
songPaused = false;
}


}

function pauseSong(e:Event):void{
play_btn.visible = true;
pause_btn.visible = false;

if(sndC){
sndC.stop();
songPaused = true;
}
}

Reply
8/5/2011 03:51:35 pm

Web Camera

import flash.media.Camera;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.media.Video;

var bmp:BitmapData = new BitmapData(video.width,video.height);
var bp:Bitmap = new Bitmap(bmp);
addChild(bp);

var cam:Camera = Camera.getCamera();
var video:Video = new Video();
video.attachCamera(cam);
addChild(video);

click_btn.addEventListener(MouseEvent.CLICK,Takepic);

function Takepic(eve:MouseEvent):void
{
var pic = bmp.draw(video);
trace("click");
}


if (cam == null)
{
trace("User has no cameras installed.");
}
else
{
trace("User has at least 1 camera installed.");
}

Reply
8/7/2011 08:33:41 pm

30 sec preview Music player Using Flash Vars

var flashvars = this.loaderInfo.parameters.soundFile;
var myMusic:Sound = new Sound(new URLRequest(flashvars));
var timer:Timer = new Timer(30000);

myMusic.addEventListener(Event.COMPLETE,loadFlashvars);
timer.addEventListener(TimerEvent.TIMER,TimeOut);
play_btn.addEventListener(MouseEvent.CLICK,playMySong);
pause_btn.addEventListener(MouseEvent.CLICK,pauseMySong);

function loadFlashvars():void
{
myMusic.play();
play_btn.visible = false;
}

function playMySong(event:MouseEvent):void
{
myMusic.play(0);
play_btn.visible = false;
}

function pauseMySong(event:MouseEvent):void
{
SoundMixer.stopAll();
play_btn.visible = true;
}
function TimeOut(event:TimerEvent):void
{
SoundMixer.stopAll();
play_btn.visible = true;
}
timer.start();
dyna_txt.text = flashvars;

Reply
8/17/2011 08:39:37 pm

Mp3 Audio Recorder in Flash cs5.5

package
{
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import fl.controls.Button;

import org.as3wavsound.WavSound;
import org.bytearray.micrecorder.MicRecorder;
import org.bytearray.micrecorder.encoder.WaveEncoder;
import org.bytearray.micrecorder.events.RecordingEvent;

import com.noteflight.standingwave3.elements.*;
import com.noteflight.standingwave3.filters.*;
import com.noteflight.standingwave3.formats.*;
import com.noteflight.standingwave3.generators.*;
import com.noteflight.standingwave3.modulation.*;
import com.noteflight.standingwave3.output.*;
import com.noteflight.standingwave3.performance.*;
import com.noteflight.standingwave3.sources.*;
import com.noteflight.standingwave3.utils.*;

import com.greensock.*;

import fr.kikko.lab.ShineMP3Encoder;

public class VOCWordToYourMp3 extends MovieClip {
// mic vars
public var recorder:MicRecorder = new MicRecorder(new WaveEncoder());
private var recording:Boolean = false;
// SW3 vars
public var player:AudioPlayer = new AudioPlayer()
//public var sequence:ListPerformance = new ListPerformance()
// mp3 vars
private var mp3Encoder:ShineMP3Encoder;
private var myWavData:ByteArray = new ByteArray()
private var myWavFile:ByteArray = new ByteArray()
// UI vars
public var wavbtn:Button
// Sine vars
private var speedX:Number = 1;
private var speedAngle:Number = 0.3;
private var amplitude:Number = 45;
private var angle:Number = 0;
private var xpos:Number = 0;
private var ypos:Number = 0;
private var centerY:Number = 350;

public var i:Number = 0;
public var URLrequest:URLRequest = new URLRequest("http://www.thoughtsvent.com/beta/venky/uploader_script.php");
public var fileRef:FileReference = new FileReference();
public var fileFilter:FileFilter = new FileFilter("only mp3 files","*.mp3");


public function VOCWordToYourMp3()
{
btnrec.addEventListener(MouseEvent.CLICK, onBtnClick)
btnrec.addEventListener(MouseEvent.ROLL_OVER, onBtnRoll)
btnrec.addEventListener(MouseEvent.ROLL_OUT, onBtnRoll)
btnrec.buttonMode = true;
statustxt.text = "click the mike to begin recording and then click again to stop recording";

recorder.addEventListener(RecordingEvent.RECORDING, onRecording)
recorder.addEventListener(Event.COMPLETE, onRecordComplete)

player.addEventListener(Event.COMPLETE, onPlayComplete)
wavbtn.addEventListener(MouseEvent.CLICK, onWavClick)

browse_btn.addEventListener(MouseEvent.CLICK, browseBox);
upload_btn.addEventListener(MouseEvent.CLICK, uploadVars);

fileRef.addEventListener(Event.SELECT, syncVariables);
fileRef.addEventListener(Event.COMPLETE, completeHandler);
fileRef.addEventListener(ProgressEvent.PROGRESS, progressHandler);
uploadMsg.visible = false;
progressBar.visible = false;
soundMeter.scaleX = 0

}

public function onBtnClick(e:MouseEvent) { startRecording() }
public function onBtnRoll(e:MouseEvent) { }

public function initSineDrawer()
{
// Sine Drawing
graphics.lineStyle(1.5, 0x000000);
graphics.moveTo(0, 355);
}

public function startRecording()
{
if (!recording)
{
TweenMax.to(btnrec, .3, {glowFilter:{color:0xCCFF00, alpha:1, blurX:50, blurY:50}} )
TweenMax.to(btnrec2, .3, {glowFilter:{color:0xCCFF00, alpha:1, blurX:50, blurY:50}} )

recorder.record()

} else if (recording) {
recorder.stop()
recording = false
TweenMax.to(btnrec, .3, {glowFilter:{color:0xCCFF00, alpha:0, blurX:10, blurY:10}} )
TweenMax.to(btnrec2, .3, {glowFilter:{color:0xCCFF00, alpha:0, blurX:10, blurY:10}} )
}
}
public function onRecording(e:RecordingEvent)
{
statustxt.text = "Please say your thoughts!"
var al:Number = recorder.microphone.activityLevel;
TweenMax.to(soundMeter, .1, {scaleX:al * .01, onUpdate:onActivitylevelUpdate});//, onUpdateParams:[al]})
if (!recording) recording = true;
}
public function onActivitylevelUpdate(al)
{
//statustxt.text = _activityLevel
// draw a cool sine wave!
xpos += speedX;
ypos = centerY + Math.sin(angle) * amplitude * ((al > 20)? al / 100 : 1)
angle += speedAngle;
graphics.lineTo(xpos,ypos)
}
private function onRecordComplete(e:Event):void
{
soundMeter.scaleX = 0

recording = false;
statustxt.text = "recording complete!"

var src = WaveFile.createSample(recorder.output) // this is fine


var sequence = new ListPerformance()
sequence.addSourceAt(0, src)
var ap = new AudioPerformer(sequence, new AudioDescriptor())
//player.play(ap)

renderWav(ap, true)

// save to wav?
// new FileReference().save (recorder.output, "VOCariousRecording.wav")
}
private function renderWav(src, convertToMp3 = false)
{
var innerTimer = new Timer(10,0)

Reply
8/17/2011 08:40:51 pm

var framesPerChunk:uint = 8192;

innerTimer.addEventListener(TimerEvent.TIMER, handleRenderTimer)
innerTimer.start()

function handleRenderTimer(e:TimerEvent)
{
src.getSample(framesPerChunk).writeWavBytes(myWavData)

var m = Math.min(src.frameCount, src.position + framesPerChunk)
var n = Math.max(0, m - src.position)

if (n == 0)
{
if (src.position > 0) finishRender() else trace("cancel rendering")

} else {
statustxt.text = "rendering audio: "+ Math.floor(src.position * 100 / src.frameCount) + "%";
}
}
function finishRender()
{
innerTimer.stop()
statustxt.text = "finishing audio render"
WaveFile.writeBytesToWavFile(myWavFile, myWavData, 44100, 2, 16)

if (!convertToMp3)
{
wavbtn.enabled = true;
} else {
makeIntoMp3(myWavFile)
}
}
}
private function makeIntoMp3(wav)
{
wav.position = 0
mp3Encoder = new ShineMP3Encoder(wav);
mp3Encoder.addEventListener(Event.COMPLETE, mp3EncodeComplete);
mp3Encoder.addEventListener(ProgressEvent.PROGRESS, mp3EncodeProgress);
//mp3Encoder.addEventListener(ErrorEvent.ERROR, mp3EncodeError);
mp3Encoder.start();

function mp3EncodeProgress(e:ProgressEvent) : void
{
statustxt.text = "encoding mp3: " + e.bytesLoaded + "%"
statustxt.text = "";
}

function mp3EncodeComplete(e: Event) : void
{
statustxt.appendText("you can now save your recording to your desktop")
wavbtn.enabled = true;
}
}
private function onWavClick(e:MouseEvent)
{
// WRITE ID3 TAGS
i++;
var sba:ByteArray = mp3Encoder.mp3Data;
sba.position = sba.length - 128
sba.writeMultiByte("TAG", "iso-8859-1");
sba.writeMultiByte("Thoughtsvent "+String.fromCharCode(0), "iso-8859-1"); // Title
sba.writeMultiByte("Thoughtsvent"+String.fromCharCode(0), "iso-8859-1"); // Artist
sba.writeMultiByte("Thoughtsvent "+String.fromCharCode(0), "iso-8859-1"); // Album
sba.writeMultiByte("2011" + String.fromCharCode(0), "iso-8859-1"); // Year
sba.writeMultiByte("www.thoughtsvent.com " + String.fromCharCode(0), "iso-8859-1");// comments
sba.writeByte(57);

new FileReference().save(sba, "audio"+i+".mp3")
}
private function onPlayComplete(e:Event)
{
statustxt.text = "playing complete";
}


/*start of script*/
private function browseBox(event:MouseEvent):void {
fileRef.browse([fileFilter]);
}

private function uploadVars(event:MouseEvent):void {
fileRef.upload(URLrequest);
upload_btn.enabled = false;
uploadMsg.visible = true;
progressBar.visible = true;
}

private function syncVariables(event:Event):void {
statustxt.text = "" + fileRef.name;
upload_btn.visible = true;
statustxt.text = "" + fileRef.name;
upload_btn.visible = true;
/* progressBar.width = 2;*/

var variables:URLVariables = new URLVariables();
variables.todayDate = new Date();
variables.Name = "user";
variables.Email = "[email protected]";
URLrequest.method = URLRequestMethod.POST;
URLrequest.data = variables;
}

private function completeHandler(event:Event):void {
uploadMsg.visible = false;
statustxt.text = fileRef.name + " has been uploaded.";
progressBar.visible = false;
upload_btn.enabled = false;
wavbtn.enabled = false;
}

private function progressHandler(event:ProgressEvent):void {
progressBar.width = Math.ceil(200*(event.bytesLoaded/event.bytesTotal));
}
/*end of script*/

}
}

Reply
7/12/2012 07:01:55 am

Just like the old saying goes, within the pro�s head you can find couple of options, nevertheless , for a person with the beginner�s brain, the world is open up.

Reply
7/17/2012 12:38:57 pm

Rattling exceptional info can be found on internet blog .

Reply
3/29/2013 05:53:03 pm

This is specifically the cause why there is are no evident differences in the prices furnished by diverse laptop or computer mend organizations.|A organization internet site will make it possible for you to be identified by potential prospects who are browsing for computer restore organizations in their town or area.

Reply



Leave a Reply.