Home » Archive

Articles tagged with: simple

Flex, Tutorials »

[1 Nov 2008 | 4 Comments | 17,768 views]
Flex 3 | Simple FLV Player | Scrubbing, Pause, and Play

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

[21 Aug 2008 | 3 Comments | 14,696 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 …