Home » Archive

Articles in the Flash Category

Code Samples, FMS, Flash, General Discussion »

[21 Apr 2009 | View Comments | 5,674 views]
Streaming A Live Event Using Mogulus

One of my clients (borrispowell.com) has an upcoming fashion show, and we thought it would be pretty useful to promote the show as a streaming live production from his website the night of the unveiling of his latest creations. With this being one of his larger shows, we thought we would allow fans around the world to be able to watch the performance online, and for free.

Mogulus live broadcast tool seemed to be able to pull off the task of streaming the show for a pretty decent cost, and with …

Code Samples, FMS, Flash, Tutorials »

[29 Oct 2008 | View Comments | 7,552 views]
Flash Bandwidth & Port Detection

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", …

Flash, Tutorials »

[24 Oct 2008 | View Comments | 4,837 views]
Use Actionscript to Detect Flash Version

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 »

[5 Sep 2008 | View Comments | 3,084 views]
AS3 MP3 Player

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, Flash, SEO »

[22 Aug 2008 | View Comments | 6,149 views]

A very simple RSS feed reader that displays links off to your blog created using Actionscript 2.

stop();
//create the xml object
xmlLoad = new XML();
xmlLoad.load(_root.feed);
xmlLoad.ignoreWhite = true;
xmlLoad.onLoad = function(success){
//if successful
if(success && xmlLoad.status == 0){
//reset the text
xml_text="";
//list of items
var xmlItems:XML = xmlLoad.firstChild.firstChild;
for (var m = 0; m<xmlItems.childNodes.length; m++) {
//grab each item
if (xmlItems.childNodes[m].nodeName == "item") {
for (var n = 0; n<xmlItems.childNodes[m].childNodes.length; n++) {
if (xmlItems.childNodes[m].childNodes[n].nodeName == "link") {
//grab the link of the item
itemlink=xmlItems.childNodes[m].childNodes[n].firstChild.toString();
}
if (xmlItems.childNodes[m].childNodes[n].nodeName == "title") {
//grab the title of the item
itemtitle=xmlItems.childNodes[m].childNodes[n].firstChild.toString();
}
}
//add the current item
xml_text+= "<a href=\""+itemlink+"\">"+itemtitle+"</a><br><br>";
}
}
}
//set the text
xml_holder.text = xml_text;
}

The only library item needed …

Flash, New Developments »

[22 Aug 2008 | View Comments | 1,650 views]

With the inspirations of Borris Powell, I would like to announce the launch of BorrisPowell.com.
From the site:
“Luxury in women’s fashion has a new name—Borris Powell. Born in Alabama, the passionate designer developed his dreams of a career in women’s fashion early on in life. Throughout his childhood, while observing his mother preparing for a night out on the town or even a Sunday visit to church, he trained his young eyes on color and silhouette. This is how his lifelong dream began. He would often advise her on style choices …

Code Samples, FMS, Flash, Tutorials »

[21 Aug 2008 | View Comments | 4,413 views]

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 when they load our swf. I …

Code Samples, Flash, Tutorials »

[21 Aug 2008 | View Comments | 11,281 views]

Here I have all of the code necessary to setup a simple AS2 flv player using progressive download. All of this script is in the first frame of the movie with the appropriate movie clips available on the stage.
First, We setup all of our controls including our Play/Pause button, Rewind, Scrubbing, and volume controls.

stop();

/*——————————————————————————–*/
//sound settings/controls
/*——————————————————————————–*/

globalsound = new Sound();
globalsound.setVolume(100);
volume_slide.volume_slider._x = volume_slide.volume_bar._width-volume_slide.volume_slider._width;

b_volume.onRelease = function() {
if(globalsound.getVolume() == 100){
b_volume.gotoAndStop(2);
globalsound.setVolume(0);
}else if(globalsound.getVolume() == 0){
b_volume.gotoAndStop(1);
globalsound.setVolume(100);
}
}

//volume scrubbing
var pTop_volume:Number = volume_slide.volume_slider._y;
var pLeft_volume:Number = 0;
var pBottom_volume:Number = volume_slide.volume_slider._y;
var pRight_volume:Number = volume_slide.volume_bar._width-volume_slide.volume_slider._width;

volume_slide.volume_slider.onPress = function() {
startDrag("volume_slide.volume_slider", false, pLeft_volume, pTop_volume, pRight_volume, pBottom_volume);
dragging = …

Code Samples, FMS, Flash, Tutorials »

[21 Aug 2008 | View Comments | 28,630 views]

Here’s a quick way to setup a Flash Media Server chat room. This process only allows for two users to video chat over Flash Media Server, and was the start of a larger project that I was involved with.
Setting Up the Flash Media Server Application
It really what you are going to use in terms of either a FMS hosting company, or your own. Most of the FMS hosting companies use the same techniques when setting up their servers for users, but that might not always be true. In general, you …

Code Samples, Flash, Tutorials »

[21 Aug 2008 | View Comments | 15,858 views]

Here’s a class that renders a simple wireframe sphere in Papervision3d, and allows the mouse to control the pitch and yaw. This example can be applied to any simple interactive environment.

package {
import flash.display.Sprite;
import flash.events.Event;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.scenes.*;
import org.papervision3d.materials.*;

public class PaperVisionTest extends Sprite {
/** setup the container */
private var container: Sprite = new Sprite();

/** setup the scene */
private var scene: MovieScene3D = new MovieScene3D(container);

/** setup the camera */
private var camera: Camera3D = new Camera3D();

/** setup the material */
private var material:WireframeMaterial = new WireframeMaterial(0xFF0000);

/** setup the sphere */
private var sphere:Sphere = new …