Articles in the Tutorials Category
Code Samples, FMS, Flash, Tutorials »
This tutorial is the final in a series of three. Part one of this tutorial outlined what is needed to detect a users upload, download, and latency between a Flash client and the Flash Media Server. Part two adds on the ability to detect which ports are available while connecting. In part three, we will be adding an external xml file that will allow you to compare connections to different Flash Media Servers in order to find which of them is the best connection for serving media. If you haven’t …
Code Samples, FMS, Flash, Tutorials »
This tutorial is the second in a series of three. Part one of this tutorial outlined what is needed to detect a users upload, download, and latency between a Flash client and the Flash Media Server. Part 2 adds on the ability to detect which ports are available while connecting.
Again, Bandwidth detection is most important when connecting your users to the correctly compressed media to be streamed, recorded, or delivered via a Flash Media Server. This second example will walk you through the process of being able to detect a …
Code Samples, FMS, Flash, Tutorials, Uncategorized »
This tutorial is the first in a series of three that builds upon the first Flash Bandwidth & Port Detection tutorial I created a while back. These three articles look to make it even easier than the original post, and go more in depth on some of the streaming options, and have better structured server side code.
If you are interested in the original article, you can find it here.
Bandwidth detection is most important when connecting your users to the correctly compressed media to be streamed, recorded, or delivered via a …
Code Samples, Flex, Tutorials »
Using Flex, it’s extremely easy to create a simple FLV player. This simple flv player has a scrub bar, pause/play buttons, and can load a flv from any url. The example is pretty basic, but it’s a great starting point on understanding how to stream video using Flex.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
private function formatTime(item:Date):String {
…
Code Samples, FMS, Flash, Tutorials »
Being able to detect a users bandwidth can be an important part of serving them streaming video. Using their bandwidth you can stream a video that will play well using their connection speeds.
The first step is to create our NetConnection.as file. This is used by our bandwidth checking script to connect to our Flash Media Server via RTMP, select an available port, and talk with our bw_check.asc to report the users available bandwidth.
import mx.events.EventDispatcher;
class NCManager extends Object {
// EventDispatcher needs these
var addEventListener:Function;
var removeEventListener:Function;
var dispatchEvent:Function;
var dispatchQueue:Function;
// Constants
private var k_DEFAULTCONNLIST = [{protocol:"rtmp", …
Code Samples, Flash, Tutorials »
A friend my mine just asked me how he could find out how to detect his version of flash, so I wrote a quick bit of AS2 to help him out. Here’s a quick and easy way to detect a users flash version from within your Flash project.
//trace(eval("$version"));
version = eval("$version");
//The operating system: WIN, MAC, LNX
var osType;
//The player versions. 9,0,115,0
var majorVersion; 9
var majorRevision; 0
var minorVersion; 115
var minorRevision; 0
vers.text = version;
osArray = version.split(’ ‘);
osType = osArray[0];
versionArray = osArray[1].split(’,');
majorVersion = versionArray[0];
majorRevision = versionArray[1];
minorVersion = versionArray[2];
minorRevision = versionArray[3];
feedback.text = "Operating System: "+osType + "\n" …
Code Samples, Flash, Tutorials »
I have an upcoming project that will require an mp3 player that can load multiple songs, and let users choose which track they would like to listen to. I created this as a test, and will be developing it further for use on the site itself.
The player loads in mp3’s from an external file based on xml settings.
Here’s the actionscript 3 that is involved:
var getMusic:URLRequest;
var music:Sound = new Sound();
var soundChannel:SoundChannel;
var currentSound:Sound = music;
var pos:Number;
var currentIndex:Number = 0;
var songPlaying:Boolean = false;
var xml:XML;
var songlist:XMLList;
//preloader
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = …
Code Samples, SEO, Tutorials »
Inbound Links
A .htaccess file can be an SEO’s vital friend. When visitors hit your site with either www.yourdomain.com or yourdomain.com, it splits your inbound links into two separate pages. This can have effects on your Google Page Rank. By correctly creating and implementing a .htaccess file at your server root, you can improve your website ranking.
To change the url in the browser before the page loads you can use two different methods.
Here, the url will always contain the www. before the domain name:
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.derekentringer\.com [NC]
RewriteRule (.*) http://www.derekentringer.com/$1 …
Code Samples, Flex, Tutorials »
Flex has a lot to offer when it comes to file manipulation and viewing/interaction. The AIR environment is perfect for an “explorer” type application.
Here’s a quick file browser in Flex:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="1044" height="800" currentState="videoState" creationComplete="init()">
<mx:Style source="assets/css/styles.css" />
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
import mx.controls.Alert;
import flash.html.HTMLLoader;
import flash.net.URLRequest;
import mx.events.MenuEvent;
import mx.collections.*;
[Bindable]
public var menuBarCollection:XMLListCollection;
private var menubarXML:XMLList =
…
Code Samples, FMS, Flash, Tutorials »
This FLV player has quite a few advanced options included. The video is streamed from a Flash Media server, dynamically buffered, and playable. The server side scripts allow for dynamic port detection, and you can setup the player to serve differently encoded flv files based on the users bandwidth.
First let’s start with our external classes.
stop();
/*——————————————————————————–*/
//external classes
/*——————————————————————————–*/
import NCManager;
import mx.transitions.Tween;
We’re using the NCManager.as file as provided by Adobe. This external class allows us to manage our port connection list as well as detect a users bandwidth …








