Showing posts with label Flash Communication Server. Show all posts
Showing posts with label Flash Communication Server. Show all posts

Monday, June 2, 2008

Deleting files on a Flash Media Server

I haven't post much in a while, because I've been busy with a new project. During the evenings I've been dedicating some time to my portfolio site - I know it is long over due. Hopefully, I will be done some time in the near future. One of my featured components is a webcam. It's taking some time getting the kinks ironed out. I am fairly new to Server-Side ActionScripting and the Flash Media Server. Thanks to some folks, especially Lisa Larson-Kelly - I've been getting through the component. Tonight I figured out how to delete a file off a Flash Media Server. Here is the server-side Script:

I call the removeFile function inside my onDisconnect call. I did that so the server checks if a user published their recent webcam recording. If they didn't, the removeFile function deletes the file. Really, simple script; but most effective.



function removeFile(){
if ( !publish )
{
var file = new File("[my directory]/recorded_video.flv");
if ( file.exists )
{
file.remove();
}
}
}

Tuesday, March 25, 2008

FMS3 Response Error

I have finally purchased my Flash Media Server 3 Space at Influxis. They have awesome rates. Much better than purchasing a $5,000 License. I ran into a bit of a snag connecting my camera to the server. I received this error:

ReferenceError: Error #1069: Property onBWDone not found on flash.net.NetConnection and there is no default value.

(Sorry for the snapshot, I haven't installed the code snippet yet).

It so happens there is a nice fix for this. Check out what I've done. Notice the 'client' property. I place this object into it and create a public method called onBWDone. Try it out for yourself, satisfaction guaranteed.