Net Stream StreamNotFound

I just migrated from ColdFusion MX 7 to ColdFusion 8. The CF7
app is at
http://64.78.60.211/timos/greenEarth/GreenEarth.html.
The CF8 version is at
http://www.timos.com/timos/greenEarth/GreenEarth.html.
These two URLs contain the exact same files. They are both the same
Windows 2003 server.
If you wish to help and have a couple of minutes, browse to
the CF7 app, and look at the video (click photo of a girl named
Severn Suzuki, on the right side, second image down). Then do the
same with the CF8 app and see the error message:
Error #2044: Unhandled NetStatusEvent:. level=error,
code=NetStream.Play.StreamNotFound
Apparently, Flex cannot find the NetStream in the new server.
I have tried putting the FLV file on the same level as the main
HTML page; I have also tried using a complete absolute URL path to
the FLV. Always the same result.
What I find most curious about this is that it all works
fine in my 'localhost', which is now CF8 Developer Edition.
I don't think this is a CF issue, but I am posting this in
both the CF and the Flex forums, in hopes someone can come up with
something else to try.
Any suggestions would be greatly appreciated.
Carlos

Simultaneously with starting this thread, I wrote to my
hosting provider about the problem.
I got a response saying: "We have added Flash Video MIME type
for your new Web server configuration, this should fix the problem
with your video not loading properly".
That did correct the problem.
Between my initial post and the response from my provider, I
also found this Adobe document:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19439&sliceId=1.
So, if you are on a Windows 2003 server and run into this
problem, now you know the solution.
Regards,
Carlos

Similar Messages

  • Net stream glitch when loading external content

    I have a program that plays an FLV using netStream and has cue points embedded which trigger the loading of external graphics.  If the code for loading the external graphics is commented out the video plays normally.  However, if the code to load the external graphics is left in, each time a graphic is loaded the video appears to stop and start.  Has anyone experienced similar issues and/or have any suggestions.
    FYI, I built the program using a FLVplayback instance on stage and there is no glitch when the images load, but I have a lot of other things built using the nestStream class so I'd prefer to do it that way.

    In considering kglad's comment about streaming capacity I starting running a brief test whereby the external graphics would be loaded into the flash file and attached using the attachMovie method rather than loaded using the loadMovie method.  In doing so, I found the offending code. 
    The code was borrowed from a previous program that streamed a number of videos of different sizes.  To make a long story short, for that project I was setting the video player visibility to false each time a new video loaded and this was done where the loader was given the loadMovie command.  Visibility was turned on when the loader issued the onLoadComplete call.  So I got exactly what I was asking for a momentary interruption in the visibility of the video.

  • Problems setting volume of a net stream

    I'm using this actionscript, but the volume doesnt seem to be
    set to 0.
    Any tips, greatly appreciated.

    Yes I know setVolume, but I was looking for a solution
    without actionscripting.
    The sound is not controlled through actionscript but is
    integrated in author
    environment, so I thought perhaps there is any hidden feature
    (in the prioperty
    panel?) to configure allowing you to set the volume.
    For example if you drag and drop a sound from the library to
    the stage, I
    would expect a feature in the property panel to setup the
    volume but obviously
    there is none.

  • Like to understand - Stream DataSet (of XML data) to ZIP file?

    i have similar kind of requirement where i need to save dataset data in multi part zip file. from this site i got a sample code
    .NET - Stream DataSet (of XML data) to ZIP file? but few area is not clear.
    the sample code as follows
    // get connection to the database
    var c1= new System.Data.SqlClient.SqlConnection(connstring1);
    var da = new System.Data.SqlClient.SqlDataAdapter()
    SelectCommand= new System.Data.SqlClient.SqlCommand(strSelect, c1)
    DataSet ds1 = new DataSet();
    // fill the dataset with the SELECT
    da.Fill(ds1, "Invoices");
    // write the XML for that DataSet into a zip file (split into 1mb chunks)
    using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile())
    zip.MaxOutputSegmentSize = 1024*1024;
    zip.AddEntry(zipEntryName, (name,stream) => ds1.WriteXml(stream) );
    zip.Save(zipFileName);
    how this word code Ionic they are using dotnet zip library ? tell me what is
    Ionic
    i guess this line zip.MaxOutputSegmentSize = 1024*1024; means each segment size would be 1mb ? am i right ?
    this line is not clear
    zip.AddEntry(zipEntryName, (name,stream) => ds1.WriteXml(stream) );
    what is the meaning of this (name,stream) stream never declared but how they can use ?
    tell me what is the meaning of this line zip.AddEntry(zipEntryName, (name,stream) => ds1.WriteXml(stream) ); what the code will do reading the above statement.
    suppose if the above code save dataset data in 5 separate zip file then what name will be used for each segment?
    if possible give me the code which will read all segment file and extract its content in a folder. thanks

    Ionic is a 3rd party library which can be download by click on the shortcut where you got the code.  I don't recommend using compiled 3rd part software unless the source code is provided.  Codeplex solutions are usually very reliable.
    Yes 1024 x 1024 is the 1mbyte size of the stream
    The library is using a Linq syntax.  So  simple Linq uses something like this
    .Select(x => x.ToString())  Where x is a variable name that can be any letter(s) you choose.  Select is part of an enumeration.  It is really just a shortcut instead of using a "FOR" statement.
    The line zip is more complicated version of Linq.  It is using two parameters (name,stream).  I don't think the code actually works and you would have to look at the documentation at the codeplex website.
    jdweng

  • HTTP dynamic streaming without FMS ?

    Hi,
    is it possible to use HTTP Streaming without a Flash Media Server ?
    Cheers
    Marc

    OK , I did it !
    I event get the audio playing with the flex spark videoplayer component.
    When I try it the following it is not working :
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                      creationComplete="SuperSimpleFLVPlayer()"
                      >
         <fx:Script>
              <![CDATA[
                   import flash.display.Sprite;
                   import flash.media.Video;
                   import flash.net.NetConnection;
                   import flash.net.NetStream;
                   import mx.events.FlexEvent;
                   private var nc:NetConnection;
                   private var ns:NetStream;
                   //private var vid:Video;
                   private var client:Object;
                   public function SuperSimpleFLVPlayer ():void
                        // Initialize net stream
                        nc = new NetConnection();
                        nc.connect (null); // Not using a media server.
                        ns = new NetStream(nc);
                        client = new Object();
                        ns.client = client;
                        client.onMetaData = onMetaData_handler;
                        client.onCuePoint = onCuePoint_handler
                        // Play video
                        //vid.attachNetStream ( ns );September Drive by Lightrocker_1.flv
                        ns.play ( 'http://xx.xx.xx.xx/vod/September_Drive_by_Lightrocker_1/September_Drive_by_Lightrocker_1.f4m' );
                        //ns.seek( 555.664 );
                   //MetaData
                   private function onMetaData_handler ( mdata:Object ):void {
                        trace (mdata.duration);
                   private function onCuePoint_handler( item:Object ):void {
                        trace("cuePoint");
                        trace(item.name + "\t" + item.time);
              ]]>
         </fx:Script>
    </s:Application>

  • VideoJukebox stop streaming

    Hello there all you flash gurus and experts!
    I'm trying to learn how to use the VideoJukebox sample that
    you can download from:
    http://www.adobe.com/support/documentation/en/flash/samples/
    My problem is, that I'm adding the child swf (videojukebox)
    to my main swf as a videoplayer. When I remove the child the sound
    continues to play. I know this is a common problem and that I
    should use unload and close the netstream, but some how I can only
    do it within the external actionscript code. I even added a button
    to the Videojukebox fla, to test if I manage to close the net
    stream. That worked ok, but trying to control the VideoJukebox from
    the mother swf doesn't work. There are three files involved:
    website.swf, videojukebox.swf and videojukebox.as.
    This is how I attach the videojukebox.swf to my website.swf:
    var container:Sprite = new Sprite();
    addChild(container);
    var ldr:Loader = new Loader();
    var urlReq:URLRequest = new URLRequest("VideoJukebox.swf");
    ldr.load(urlReq);
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,
    loaded);
    function loaded(event:Event):void
    myMovieClip_mc.addChild(ldr.content);
    Then to remove it I use:
    button1.addEventListener (MouseEvent.CLICK,do_videoaway);
    function do_videoaway(event:Event):void
    myMovieClip_mc.removeChild(ldr.content);
    I know I should access the NetStream of videojukebox.as
    somehow and turn it off before removing the child...
    Videojukebox.as uses:
    package {
    (...first imports all kinds of stuff...)
    public class VideoJukebox extends Sprite {
    private var meta:Object;
    private var nc:NetConnection;
    private var ns:NetStream;
    private var playlist:XML;
    private var t:Timer;
    private var uldr:URLLoader;
    private var vid:Video;
    private var videosXML:XMLList;
    This might be really stupid question, but how can I use the
    commond ns.close(); from my website.swf???
    Using it just like that it gives an error:
    1120: Access of undefined property ns.

    Could it have something to do with the package? Can I enter
    the variables outside of the package?
    - Still an amateur

  • Failed to play (stream ID: 1).

    Hi all, I'm trying to simply stream audio from a FCS using
    akamai, I can give you the stream if necessary, but for now I'd
    prefer to keep it private. I can connect
    (NetConnection.Connect.Success), but the net stream then fails.
    // CODE
    nc = new NetConnection();
    nc.onStatus = function(oInfo:Object):Void {
    trace("> nc status > " + oInfo.code);
    trace("The connection code is: " + oInfo.code);
    nc.connect("rtmp-stream-here");
    ns = new NetStream(nc);
    ns.onStatus = function(oInfo:Object):Void {
    trace("> ns status > " + oInfo.code);
    trace(">> " + oInfo.description);
    ns.setBufferTime(1)
    ns.play("test");
    // OUTPUT
    > nc status > NetConnection.Connect.Success
    The connection code is: NetConnection.Connect.Success
    > ns status > NetStream.Failed
    >> Failed to play (stream ID: 1).
    Does anyone know why I'm getting the: Failed to Play (Stream:
    1).

    Hi John,
    Form the description of your issue (and from a short investigation) I can deduce that your assets do not have synchronized keyframes. Please try to re-encode them and force a fixed keyframe interval.
    Since the switch can be done on keyframe only, and if you do not have a keyframe in the second stream at that position, the playback will stop with an error.
    S.

  • Network stream using 64-bit and 32-bit VIs on same computer

    I have a project where I'm forced to use a VI written in 32-bit LV2012 (because I need mathscript, which isn't supported in 64-bit) to communicate via network streams with a VI written in 64-bit LV2012 (they only version I can use an externally written 64-bit toolkit for my camera communication) on the same PC.
    I need a network stream target to run on the 32-bit VI, and a host to run on 64-bit VI.
    It kept not working, and finally I checked using the example host.vi and target.vi, and discovered if I open both in either 32-bit or 64-bit, they work, but if I open one in 32-bit and the other in 64-bit it won't connect, giving error -314100 (specified endpoint doesn't exist).
    So question: is there any inherent reason this happens, since both 64-bit and 32-bit should support Network Streams? My first obvious alternative would be rewriting the mathscript code in native LV so i can all be on 64-bit VI's, but it's quite big (based on old, proven Matlab script) and that would be a significant effort I don't have time for now.
    The reason I'm using net streams is that I also get data from 2x other networked PC's at the same time. Is there an alternative to network streams that can communicate data over a network in real(ish)-time?
    Cheers
    Dan

    I just tested this and was able to get it to work.  Were you running both reader and writer applications on the same computer?  If so, I suspect you might be running into context naming issues with multiple application instances running on the same computer.  See this link for more info how to specify a context in the URL.  I suspect you might find it easier to create your own test VI for this rather than modify the shipping examples.

  • AS3 + FMS2 = problem with "stream" MP3

    I use AS3!
    I can not get mp3 "duration" (Net Stream)
    where event: onID3??????? how it works???? and it works?????
    help plz :)

    My guess is that its to do with your embedding code. Check a)
    you have an id attribute assigned to the resulting object tag from
    whatever embedding method you use and b) for good measure make sure
    its unique in your html page.
    Javascript needs to have a valid reference to return the
    value from the javascript function back to flash. In my experience
    IE is more sensitive to issues here.
    If you get stuck post a test page somewhere.
    Tools to use to help with javascript debugging and view the
    html embed results (e.g. from swfobject or activecontent.js):
    In firefox : Firebug
    In IE: IE Developer Toolbar , Companion JS, and DebugBar are
    all helpful and , combined, get close to Firebug.

  • How to stop video from playing?

    Hi,
    i have a problem that i've already see that is pretty usual, the videoplayer that i have works fine but when i click in a button to go to another page the videoplayer doesn't stop,the audio continues playing even when i'm not on the videoplayer page.
    I've already found some solutions in the web but none of them worked,probably because i didn't put them in the right place
    The code is a little long:
    // ############# CONSTANTS
    // time to buffer for the video in sec.
    const BUFFER_TIME:Number                = 8;
    // start volume when initializing player
    const DEFAULT_VOLUME:Number                = 0.6;
    // update delay in milliseconds.
    const DISPLAY_TIMER_UPDATE_DELAY:int    = 10;
    // smoothing for video. may slow down old computers
    const SMOOTHING:Boolean                    = true;
    // ############# VARIABLES
    // flag for knowing if user hovers over description label
    var bolDescriptionHover:Boolean = false;
    // flag for knowing in which direction the description label is currently moving
    var bolDescriptionHoverForward:Boolean = true;
    // flag for knowing if flv has been loaded
    var bolLoaded:Boolean                    = false;
    // flag for volume scrubbing
    var bolVolumeScrub:Boolean                = false;
    // flag for progress scrubbing
    var bolProgressScrub:Boolean            = false;
    // holds the number of the active video
    var intActiveVid:int;
    // holds the last used volume, but never 0
    var intLastVolume:Number                = DEFAULT_VOLUME;
    // net connection object for net stream
    var ncConnection:NetConnection;
    // net stream object
    var nsStream:NetStream;
    // object holds all meta data
    var objInfo:Object;
    // shared object holding the player settings (currently only the volume)
    var shoVideoPlayerSettings:SharedObject = SharedObject.getLocal("playerSettings");
    // url to flv file
    var strSource:String                    = root.loaderInfo.parameters.playlist == null ? "playlist.xml" : root.loaderInfo.parameters.playlist;
    // timer for updating player (progress, volume...)
    var tmrDisplay:Timer;
    // loads the xml file
    var urlLoader:URLLoader;
    // holds the request for the loader
    var urlRequest:URLRequest;
    // playlist xml
    var xmlPlaylist:XML;
    // ############# STAGE SETTINGS
    stage.scaleMode    = StageScaleMode.NO_SCALE;
    stage.align        = StageAlign.TOP_LEFT;
    // ############# FUNCTIONS
    // sets up the player
    function initVideoPlayer():void {
        // hide video controls on initialisation
        mcVideoControls.visible = false;
        // hide buttons
        mcVideoControls.btnUnmute.visible            = false;
        mcVideoControls.btnPause.visible            = false;
        mcVideoControls.btnFullscreenOff.visible    = false;
        // set the progress/preload fill width to 1
        mcVideoControls.mcProgressFill.mcFillRed.width    = 1;
        mcVideoControls.mcProgressFill.mcFillGrey.width    = 1;
        // set time and duration label
        mcVideoControls.lblTimeDuration.htmlText        = "<font color='#ffffff'>00:00</font> / 00:00";
        // add global event listener when mouse is released
        stage.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
        // add fullscreen listener
        stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreen);
        // add event listeners to all buttons
        mcVideoControls.btnPause.addEventListener(MouseEvent.CLICK, pauseClicked);
        mcVideoControls.btnPlay.addEventListener(MouseEvent.CLICK, playClicked);
        mcVideoControls.btnStop.addEventListener(MouseEvent.CLICK, stopClicked);
        mcVideoControls.btnNext.addEventListener(MouseEvent.CLICK, playNext);
        mcVideoControls.btnPrevious.addEventListener(MouseEvent.CLICK, playPrevious);
        mcVideoControls.btnMute.addEventListener(MouseEvent.CLICK, muteClicked);
        mcVideoControls.btnUnmute.addEventListener(MouseEvent.CLICK, unmuteClicked);
        mcVideoControls.btnFullscreenOn.addEventListener(MouseEvent.CLICK, fullscreenOnClicked);
        mcVideoControls.btnFullscreenOff.addEventListener(MouseEvent.CLICK, fullscreenOffClicked);
        mcVideoControls.btnVolumeBar.addEventListener(MouseEvent.MOUSE_DOWN, volumeScrubberClicked);
        mcVideoControls.mcVolumeScrubber.btnVolumeScrubber.addEventListener(MouseEvent.MOUSE_DOWN , volumeScrubberClicked);
        mcVideoControls.btnProgressBar.addEventListener(MouseEvent.MOUSE_DOWN, progressScrubberClicked);
        mcVideoControls.mcProgressScrubber.btnProgressScrubber.addEventListener(MouseEvent.MOUSE_ DOWN, progressScrubberClicked);
        mcVideoControls.mcVideoDescription.btnDescription.addEventListener(MouseEvent.MOUSE_OVER, startDescriptionScroll);
        mcVideoControls.mcVideoDescription.btnDescription.addEventListener(MouseEvent.MOUSE_OUT, stopDescriptionScroll);
        // create timer for updating all visual parts of player and add
        // event listener
        tmrDisplay = new Timer(DISPLAY_TIMER_UPDATE_DELAY);
        tmrDisplay.addEventListener(TimerEvent.TIMER, updateDisplay);
        // create a new net connection, add event listener and connect
        // to null because we don't have a media server
        ncConnection = new NetConnection();
        ncConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
        ncConnection.connect(null);
        // create a new netstream with the net connection, add event
        // listener, set client to this for handling meta data and
        // set the buffer time to the value from the constant
        nsStream = new NetStream(ncConnection);
        nsStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
        nsStream.client = this;
        nsStream.bufferTime = BUFFER_TIME;
        // attach net stream to video object on the stage
        vidDisplay.attachNetStream(nsStream);
        // set the smoothing value from the constant
        vidDisplay.smoothing = SMOOTHING;
        // set default volume and get volume from shared object if available
        var tmpVolume:Number = DEFAULT_VOLUME;
        if(shoVideoPlayerSettings.data.playerVolume != undefined) {
            tmpVolume = shoVideoPlayerSettings.data.playerVolume;
            intLastVolume = tmpVolume;
        // update volume bar and set volume
        mcVideoControls.mcVolumeScrubber.x = (53 * tmpVolume) + 318;
        mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 371 + 53;
        setVolume(tmpVolume);
        // create new request for loading the playlist xml, add an event listener
        // and load it
        urlRequest = new URLRequest(strSource);
        urlLoader = new URLLoader();
        urlLoader.addEventListener(Event.COMPLETE, playlistLoaded);
        urlLoader.load(urlRequest);
    function playClicked(e:MouseEvent):void {
        // check's, if the flv has already begun
        // to download. if so, resume playback, else
        // load the file
        if(!bolLoaded) {
            nsStream.play(strSource);
            bolLoaded = true;
        else{
            nsStream.resume();
        vidDisplay.visible = true;
        // switch play/pause visibility
        mcVideoControls.btnPause.visible    = true;
        mcVideoControls.btnPlay.visible        = false;
    function pauseClicked(e:MouseEvent):void {
        // pause video
        nsStream.pause();
        // switch play/pause visibility
        mcVideoControls.btnPause.visible    = false;
        mcVideoControls.btnPlay.visible        = true;
    function stopClicked(e:MouseEvent):void {
        // calls stop function
        stopVideoPlayer();
    function muteClicked(e:MouseEvent):void {
        // set volume to 0
        setVolume(0);
        // update scrubber and fill position/width
        mcVideoControls.mcVolumeScrubber.x                = 318;
        mcVideoControls.mcVolumeFill.mcFillRed.width    = 1;
    function unmuteClicked(e:MouseEvent):void {
        // set volume to last used value or DEFAULT_VOLUME if last volume is zero
        var tmpVolume:Number = intLastVolume == 0 ? DEFAULT_VOLUME : intLastVolume
        setVolume(tmpVolume);
        // update scrubber and fill position/width
        mcVideoControls.mcVolumeScrubber.x = (53 * tmpVolume) + 318;
        mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 371 + 53;
    function volumeScrubberClicked(e:MouseEvent):void {
        // set volume scrub flag to true
        bolVolumeScrub = true;
        // start drag
        mcVideoControls.mcVolumeScrubber.startDrag(true, new Rectangle(318, 19, 53, 0)); // NOW TRUE
    function progressScrubberClicked(e:MouseEvent):void {
        // set progress scrub flag to true
        bolProgressScrub = true;
        // start drag
        mcVideoControls.mcProgressScrubber.startDrag(true, new Rectangle(0, 2, 432, 0)); // NOW TRUE
    function mouseReleased(e:MouseEvent):void {
        // set progress/volume scrub to false
        bolVolumeScrub        = false;
        bolProgressScrub    = false;
        // stop all dragging actions
        mcVideoControls.mcProgressScrubber.stopDrag();
        mcVideoControls.mcVolumeScrubber.stopDrag();
        // update progress/volume fill
        mcVideoControls.mcProgressFill.mcFillRed.width    = mcVideoControls.mcProgressScrubber.x + 5;
        mcVideoControls.mcVolumeFill.mcFillRed.width    = mcVideoControls.mcVolumeScrubber.x - 371 + 53;
        // save the volume if it's greater than zero
        if((mcVideoControls.mcVolumeScrubber.x - 318) / 53 > 0)
            intLastVolume = (mcVideoControls.mcVolumeScrubber.x - 318) / 53;
    function updateDisplay(e:TimerEvent):void {
        // checks, if user is scrubbing. if so, seek in the video
        // if not, just update the position of the scrubber according
        // to the current time
        if(bolProgressScrub)
            nsStream.seek(Math.round(mcVideoControls.mcProgressScrubber.x * objInfo.duration / 432))
        else
            mcVideoControls.mcProgressScrubber.x = nsStream.time * 432 / objInfo.duration;
        // set time and duration label
        mcVideoControls.lblTimeDuration.htmlText        = "<font color='#ffffff'>" + formatTime(nsStream.time) + "</font> / " + formatTime(objInfo.duration);
        // update the width from the progress bar. the grey one displays
        // the loading progress
        mcVideoControls.mcProgressFill.mcFillRed.width    = mcVideoControls.mcProgressScrubber.x + 5;
        mcVideoControls.mcProgressFill.mcFillGrey.width    = nsStream.bytesLoaded * 438 / nsStream.bytesTotal;
        // update volume and the red fill width when user is scrubbing
        if(bolVolumeScrub) {
            setVolume((mcVideoControls.mcVolumeScrubber.x - 318) / 53);
            mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 371 + 53;
        // chech if user is currently hovering over description label
        if(bolDescriptionHover) {
            // check in which direction we're currently moving
            if(bolDescriptionHoverForward) {
                // move to the left and check if we've shown everthing
                mcVideoControls.mcVideoDescription.lblDescription.x -= 0.1;
                if(mcVideoControls.mcVideoDescription.lblDescription.textWidth - 133 <= Math.abs(mcVideoControls.mcVideoDescription.lblDescription.x))
                    bolDescriptionHoverForward = false;
            } else {
                // move to the right and check if we're back to normal
                mcVideoControls.mcVideoDescription.lblDescription.x += 0.1;
                if(mcVideoControls.mcVideoDescription.lblDescription.x >= 0)
                    bolDescriptionHoverForward = true;
        } else {
            // reset label position and direction variable
            mcVideoControls.mcVideoDescription.lblDescription.x = 0;
            bolDescriptionHoverForward = true;
    function onMetaData(info:Object):void {
        // stores meta data in a object
        objInfo = info;
        // now we can start the timer because
        // we have all the neccesary data
        if(!tmrDisplay.running)
            tmrDisplay.start();
    function netStatusHandler(event:NetStatusEvent):void {
        // handles net status events
        switch (event.info.code) {
            // trace a messeage when the stream is not found
            case "NetStream.Play.StreamNotFound":
                trace("Stream not found: " + strSource);
            break;
            // when the video reaches its end, we check if there are
            // more video left or stop the player
            case "NetStream.Play.Stop":
                if(intActiveVid + 1 < xmlPlaylist..vid.length())
                    playNext();
                else
                    stopVideoPlayer();
            break;
    function stopVideoPlayer():void {
        // pause netstream, set time position to zero
        nsStream.pause();
        nsStream.seek(0);
        // in order to clear the display, we need to
        // set the visibility to false since the clear
        // function has a bug
        vidDisplay.visible                    = false;
        // switch play/pause button visibility
        mcVideoControls.btnPause.visible    = false;
        mcVideoControls.btnPlay.visible        = true;
    function setVolume(intVolume:Number = 0):void {
        // create soundtransform object with the volume from
        // the parameter
        var sndTransform        = new SoundTransform(intVolume);
        // assign object to netstream sound transform object
        nsStream.soundTransform    = sndTransform;
        // hides/shows mute and unmute button according to the
        // volume
        if(intVolume > 0) {
            mcVideoControls.btnMute.visible        = true;
            mcVideoControls.btnUnmute.visible    = false;
        } else {
            mcVideoControls.btnMute.visible        = false;
            mcVideoControls.btnUnmute.visible    = true;
        // store the volume in the flash cookie
        shoVideoPlayerSettings.data.playerVolume = intVolume;
        shoVideoPlayerSettings.flush();
    function formatTime(t:int):String {
        // returns the minutes and seconds with leading zeros
        // for example: 70 returns 01:10
        var s:int = Math.round(t);
        var m:int = 0;
        if (s > 0) {
            while (s > 59) {
                m++; s -= 60;
            return String((m < 10 ? "0" : "") + m + ":" + (s < 10 ? "0" : "") + s);
        } else {
            return "00:00";
    function fullscreenOnClicked(e:MouseEvent):void {
        // go to fullscreen mode
        stage.displayState = StageDisplayState.FULL_SCREEN;
    function fullscreenOffClicked(e:MouseEvent):void {
        // go to back to normal mode
        stage.displayState = StageDisplayState.NORMAL;
    function onFullscreen(e:FullScreenEvent):void {
        // check if we're entering or leaving fullscreen mode
        if (e.fullScreen) {
            // switch fullscreen buttons
            mcVideoControls.btnFullscreenOn.visible = false;
            mcVideoControls.btnFullscreenOff.visible = true;
            // bottom center align controls
            mcVideoControls.x = (Capabilities.screenResolutionX - 440) / 2;
            mcVideoControls.y = (Capabilities.screenResolutionY - 33);
            // size up video display
            vidDisplay.height     = (Capabilities.screenResolutionY - 33);
            vidDisplay.width     = vidDisplay.height * 4 / 3;
            vidDisplay.x        = (Capabilities.screenResolutionX - vidDisplay.width) / 2;
        } else {
            // switch fullscreen buttons
            mcVideoControls.btnFullscreenOn.visible = true;
            mcVideoControls.btnFullscreenOff.visible = false;
            // reset controls position
            mcVideoControls.x = 0;
            mcVideoControls.y = 330;
            // reset video display
            vidDisplay.y = 0;
            vidDisplay.x = 0;
            vidDisplay.width = 440;
            vidDisplay.height = 241;
    function playlistLoaded(e:Event):void {
        // create new xml with loaded data from loader
        xmlPlaylist = new XML(urlLoader.data);
        // set source of the first video but don't play it
        playVid(0, true)
        // show controls
        mcVideoControls.visible = true;
    function playVid(intVid:int = 0, bolPlay = true):void {
        if(bolPlay) {
            // stop timer
            tmrDisplay.stop();
            // play requested video
            nsStream.play(String(xmlPlaylist..vid[intVid][email protected]));
            // switch button visibility
            mcVideoControls.btnPause.visible    = true;
            mcVideoControls.btnPlay.visible        = false;
        } else {
            strSource = xmlPlaylist..vid[intVid][email protected];
        // show video display
        vidDisplay.visible                    = true;
        // reset description label position and assign new description
        mcVideoControls.mcVideoDescription.lblDescription.x = 0;
        mcVideoControls.mcVideoDescription.lblDescription.htmlText = (intVid + 1) + ". <font color='#ffffff'>" + String(xmlPlaylist..vid[intVid][email protected]) + "</font>";
        // update active video number
        intActiveVid = intVid;
    function playNext(e:MouseEvent = null):void {
        // check if there are video left to play and play them
        if(intActiveVid + 1 < xmlPlaylist..vid.length())
            playVid(intActiveVid + 1);
    function playPrevious(e:MouseEvent = null):void {
        // check if we're not and the beginning of the playlist and go back
        if(intActiveVid - 1 >= 0)
            playVid(intActiveVid - 1);
    function startDescriptionScroll(e:MouseEvent):void {
        // check if description label is too long and we need to enable scrolling
        if(mcVideoControls.mcVideoDescription.lblDescription.textWidth > 138)
            bolDescriptionHover = true;
    function stopDescriptionScroll(e:MouseEvent):void {
        // disable scrolling
        bolDescriptionHover = false;
    // ############# INIT PLAYER
    initVideoPlayer();

    No,im not using flvplayback component (i think).
    Heres the video player that i'm using:
    http://www.thetechlabs.com/tutorials/xml/expanding-the-as3-videoplayer/

  • Problem in full screen mode air application

    Hi All
    I am facing some problem in creating an air application. I used fullscreenmode .FULL_SCREEN_INTERACTIVE to maximize the window on load the application was succeeded in some extent. But there is one problem one bottom bar is coming just under the window. can anybody please help me. I am attaching the preview with this.
    Thanks and regards

    Hi M*A*S*H 4077 thanks agan for your reply sending you the total code i used in my project.As I am a new coder my codes are not in abc please try to understand.please have a look and if u want to see my componentcode then also i can send code.component i only used in the video part.
    thank you
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:components="components.*"
        verticalAlign="top"
        backgroundColor="white"
        borderStyle="none"
        borderThickness="0"
        creationComplete="init();"
        baseline="0"
        paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0"      
        initialize="service.send()"               
        applicationComplete="fullscreenmode()"
        backgroundGradientAlphas="[1.0, 1.0]"
        backgroundGradientColors="[#CCCCCC, #090909]"
        backgroundImage="@Embed(source='assets/background/background.jpg')"
        >
        <mx:Script>
            <![CDATA[
                import mx.controls.Alert;
                import flash.display.Sprite;
                import flash.display.StageAlign;
                import flash.display.StageScaleMode;
                import mx.rpc.events.ResultEvent;
                import mx.effects.Iris;
                import mx.effects.easing.*;
                import flash.utils.Timer;
                [Bindable]
                public var secondsTillDue:int=100;
                import mx.collections.ArrayCollection;
                import mx.rpc.events.ResultEvent;
                public var bol:Boolean;
                [Bindable]
                private var images:ArrayCollection;
                [Bindable]
                private var centerpoint:Number;
                [Bindable]
                private var currentIndex : Number = 0;
                public var myTimer:Timer;
                [Bindable]
                private var mainwidth:Number;
                [Bindable]
                private var mainheight:Number;
       private function init():void {
                myTimer=new Timer(1000);
                myTimer.addEventListener(TimerEvent.TIMER,warnIfClose);
                myTimer.start();
                // Initialize the uldr variable which will be used to load the external
                // playlist XML file.
                uldr = new URLLoader();
                uldr.addEventListener(Event.COMPLETE, xmlCompleteHandler);
                uldr.load(new URLRequest(PLAYLIST_XML_URL));
            /* function setFullScreenDisplayState():void{
                 stage.displayState=stageDisplayState.FULL_SCREEN_INTERACTIVE;
          public function warnIfClose(event:TimerEvent):void{
            secondsTillDue=secondsTillDue-1;
            if(secondsTillDue==90){   
             lab1.setStyle("hideEffect", fade);
             lab1.visible=false;
             clockpan.visible=false;
             clockpan.includeInLayout=false        
             clock1.setStyle("hideEffect", fade);
             clock1.visible=false;        
            else if(secondsTillDue==88){
                mainbox
                imagePart.setStyle("showEffect",fade);
                imagePart.visible=true;
                imagePart.includeInLayout=false;
             else if(secondsTillDue==83){
                 imagePart.visible=false;            
                 imagePart.setStyle("hideEffect",fade)        
                 videoContainer.visible=true;
                 playVideo();    
                private function fullscreenmode():void{
                stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
                mainwidth=stage.width;
                mainheight=stage.height;
                centerpoint=stage.height/2;
                private function serviceHandler(event:ResultEvent):void{           
                    images = event.result.gallery.img;
                    var timer:Timer = new Timer(15000);
                    timer.addEventListener(TimerEvent.TIMER,nextImage);
                    timer.start();
                private function nextImage(event:TimerEvent):void{
                        if (currentIndex < images.length - 1){
                            currentIndex++;
                        else {
                            currentIndex = 0;
            import mx.controls.ProgressBarMode;
                 * The amount of time between calls to update the playhead timer, in
                 * milliseconds.
                private const PLAYHEAD_UPDATE_INTERVAL_MS:uint = 10;
                 * The path to the XML file containing the video playlist.
                private const PLAYLIST_XML_URL:String = "playlist.xml";
                 * The client object to use for the NetStream object.
                private var client:Object;
                 * The index of the currently playing video.
                [Bindable]
                private var idx:uint = 0;
                 * A copy of the current video's metadata object.
                private var meta:Object;
                private var nc:NetConnection;
                private var ns:NetStream;
                private var playlist:XML;
                private var t:Timer;
                private var uldr:URLLoader;
                private var vid:Video;
                private var videosXML:XMLList;
                 * The SoundTransform object used to set the volume for the NetStream.
                private var volumeTransform:SoundTransform;
                 * Constructor
                private function initApp():void {
                    // Initialize the uldr variable which will be used to load the external
                    // playlist XML file.
                    uldr = new URLLoader();
                    uldr.addEventListener(Event.COMPLETE, xmlCompleteHandler);
                    uldr.load(new URLRequest(PLAYLIST_XML_URL));
                 * Once the XML file has loaded, parse the file contents into an XML object,
                 * and create an XMList for the video nodes in the XML.
                private function xmlCompleteHandler(event:Event):void {
                    playlist = XML(event.target.data);
                    videosXML = playlist.video;
                    main();
                 * The main application.
                private function main():void {
                    volumeTransform = new SoundTransform();
                    // Create the client object for the NetStream, and set up a callback
                    // handler for the onMetaData event.
                    client = new Object();
                    client.onMetaData = metadataHandler;
                    nc = new NetConnection();
                    nc.connect(null);
                    // Initialize the NetSteam object, add a listener for the netStatus
                    // event, and set the client for the NetStream.
                    ns = new NetStream(nc);
                    ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ns.client = client;
                    // Initialize the Video object, attach the NetStram, and add the Video
                    // object to the display list.
                    vid = new Video();
                    vid.x = 0;
                    vid.y = 0;
                    vid.attachNetStream(ns);
                    videoContainer.addChild(vid);
                    // Begin playback of the first video.
                    //playVideo();
                     //play video code goes here
                    // Initialize the Timer object and set the delay to
                    // PLAYHEAD_UPDATE_INTERVAL_MS milliseconds.
                    t = new Timer(PLAYHEAD_UPDATE_INTERVAL_MS);
                    t.addEventListener(TimerEvent.TIMER, timerHandler);
                    // Configure the positionBar ProgressBar instance and set the mode to
                    // MANUAL. Progress  bar values will be explicitly set using the
                    // setProgress() method.
                    //positionBar.mode = ProgressBarMode.MANUAL;
                    // Configure the volumeSlider Slider component instance. The maximum
                    // value is set to 1 because the volume in the SoundTransform object
                    // is set to a number between 0 and 1. The snapInterval and tickInterval
                    // properties are set to 0.1 which allows users to set the volume to
                    // 0, 0.1 - 0.9, 1.0 which allows users to increment or decrement the
                    // volume by 10%.
                    //volumeSlider.value = volumeTransform.volume;
                    //volumeSlider.minimum = 0;
                    //volumeSlider.maximum = 1;
                    //volumeSlider.snapInterval = 0.1;
                    //volumeSlider.tickInterval = volumeSlider.snapInterval;
                    // Setting the liveDragging property to true causes the Slider
                    // instance's change event to be dispatched whenever the slider is
                    // moved, rather than when the user releases the slider thumb.
                    //volumeSlider.liveDragging = true;
                    //volumeSlider.addEventListener(Event.CHANGE, volumeChangeHandler);
                    // Configure the various Button instances. Each Button instance uses
                    // the same click handler.
                    //playButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                    //pauseButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                    //stopButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                    //backButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                    //forwardButton.addEventListener(MouseEvent.CLICK, buttonClickHandler);
                 * Event listener for the volumeSlider instance. Called when the user
                 * changes the value of the volume slider.
                private function volumeChangeHandler():void {
                    // Set the volumeTransform's volume property to the current value of the
                    // Slider and set the NetStream object's soundTransform property.
                    //volumeTransform.volume = volumeSlider.value;
                    ns.soundTransform = volumeTransform;
                 * Event listener for the ns object. Called when the net stream's status
                 * changes.
                private function netStatusHandler(event:NetStatusEvent):void {
                    try {
                        switch (event.info.code) {
                            case "NetStream.Play.Start" :
                                // If the current code is Start, start the timer object.
                                t.start();
                                break;
                            case "NetStream.Play.StreamNotFound" :
                            case "NetStream.Play.Stop" :
                                // If the current code is Stop or StreamNotFound, stop
                                // the timer object and play the next video in the playlist.
                                t.stop();
                                playNextVideo();
                                break;
                    } catch (error:TypeError) {
                        // Ignore any errors.
                 * Event listener for the ns object's client property. This method is called
                 * when the net stream object receives metadata information for a video.
                private function metadataHandler(metadataObj:Object):void {
                    // Store the metadata information in the meta object.
                    meta = metadataObj;
                    // Resize the Video instance on the display list with the video's width
                    // and height from the metadata object.
                    vid.width = mainwidth;
                    vid.height = mainheight;
                    // Reposition and resize the positionBar progress bar based on the
                    // current video's dimensions.
                    //positionBar.move(vid.x, vid.y + vid.height);
                    //positionBar.width = vid.width;
                 * Retrieve the current video from the playlist XML object.
                private function getVideo():String {
                    return videosXML[idx][email protected];
                 * Play the currently selected video.
                private function playVideo():void {
                    var url:String = getVideo();
                    ns.play(url);
                 * Decrease the current video index and begin playback of the video.
                private function playPreviousVideo():void {
                    if (idx > 0) {
                        idx--;
                        playVideo();
                        // Make sure the positionBar progress bar is visible.
                        //positionBar.visible = true;
                 * Increase the current video index and begin playback of the video.
                 [Bindable]
                 private var newTime:Number;
                private function playNextVideo():void{
                    if (idx < (videosXML.length() - 1)) {
                        // If this is not the last video in the playlist increase the
                        // video index and play the next video.
                        idx++;
                        playVideo();
                        // Make sure the positionBar progress bar is visible.
                        //positionBar.visible = true;
                    } else {
                        // If this is the last video in the playlist increase the video
                        // index, clear the contents of the Video object and hide the
                        // positionBar progress bar. The video index is increased so that
                        // when the video ends, clicking the backButton will play the
                        // correct video.
                        idx++;
                        vid.clear();
                        init();
                        //Alert.show("video end")
                        //positionBar.visible = false;
                private function timerHandler(event:TimerEvent):void {
                    try {
                    } catch (error:Error) {
            ]]>
        </mx:Script>
    <mx:XML id="imagesXML" source="data/images.xml" />
        <mx:Zoom id="zoom" />
        <mx:Fade id="fadein" duration="1000" alphaFrom="100" alphaTo="0" />
        <mx:Fade id="fade" />
        <mx:Rotate id="rotate"
                angleFrom="-180"
                angleTo="0"
                easingFunction="Elastic.easeInOut"
                duration="2000" />
    <mx:VBox  id="mainbox" horizontalAlign="left" width="100%" height="100%" verticalScrollPolicy="off" horizontalScrollPolicy="off">
                <mx:Panel borderStyle="none"
               borderAlpha="0"
               cornerRadius= "0"
               headerHeight= "0"
               backgroundAlpha= "0"
               borderThickness="0"
               verticalAlign="middle"
               top="100"
               height="500"
               paddingLeft="0"
               paddingRight="0"
               paddingBottom="0"
               verticalScrollPolicy="off"
               horizontalScrollPolicy="off"
               horizontalAlign="center"          
               width="{mainwidth-100}"           
               id="clockpan"
               >       
                    <mx:Label text="Current Time : " fontFamily="arial" fontWeight="bold" fontSize="15" id="lab1" color="#FFFFFF"/>
                    <components:MyWatch formatString="DD/MM/YYYY KK:NN:SS " themeColor="#0D424C" id="clock1"/>
                </mx:Panel> 
        <!--image part start-->     
        <mx:Panel horizontalAlign="left" id="imagePart" visible="false" includeInLayout="false" borderStyle="none"
               borderAlpha="0"
               cornerRadius= "0"
               headerHeight= "0"
               borderThickness="0"
               verticalScrollPolicy="off"
               paddingLeft="0" paddingBottom="0" paddingRight="0" paddingTop="0"
               horizontalScrollPolicy="off"
               backgroundAlpha= "0" width="100%" height="100%">       
                <mx:Image source="assets/images/{images.getItemAt(currentIndex).file}"
                    showBusyCursor="true" id="imagefile" width="{mainwidth}" maxHeight="{mainheight}" minHeight="{mainheight}" maxWidth="{mainwidth}" minWidth="{mainwidth}" height="{mainheight}" hideEffect="{fadein}"  x="0" y="0" maintainAspectRatio="false"/>
                <mx:Text text="{images.getItemAt(currentIndex).title}" styleName="title" color="#ffffff" x="0" y="30"/>
         </mx:Panel>
        <!--image part end-->
        <!--image part start-->      
        <mx:Panel borderStyle="none"
               borderAlpha="0"
               cornerRadius= "0"
               borderThickness="0"
               headerHeight= "0" top="0" left="0"
               backgroundAlpha= "0" verticalAlign="middle"
               verticalScrollPolicy="off"
               horizontalScrollPolicy="off"
               x="0"
               >
             <mx:VideoDisplay borderStyle="none" borderThickness="0" visible="false" id="videoContainer"
                  maintainAspectRatio="false"           
                  />
        </mx:Panel>
        <!--image part end-->
         <!--<mx:Button label="fullscreen" click="stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;"/>-->
         </mx:VBox>   
        <mx:HTTPService id="service" url="data.xml" result="serviceHandler(event)"/>
    </mx:WindowedApplication>

  • Scrub Bar Problems

    My scrub bar isn't so percise. When I scrub, the duration is off track. What am I doing wrong? Please help.
    PS, it's stream NOT progressive.
    // ############# CONSTANTS
    // time to buffer for the video in sec.
    const BUFFER_TIME:Number                = 8;
    // start volume when initializing player
    const DEFAULT_VOLUME:Number                = 0.6;
    // update delay in milliseconds.
    const DISPLAY_TIMER_UPDATE_DELAY:int    = 10;
    // smoothing for video. may slow down old computers
    const SMOOTHING:Boolean                    = true;
    // ############# VARIABLES
    // flag for knowing if flv has been loaded
    var bolLoaded:Boolean                    = false;
    // flag for volume scrubbing
    var bolVolumeScrub:Boolean                = false;
    // flag for progress scrubbing
    var bolProgressScrub:Boolean            = false;
    // holds the last used volume, but never 0
    var intLastVolume:Number                = DEFAULT_VOLUME;
    // net connection object for net stream
    var ncConnection:NetConnection;
    // net stream object
    var nsStream:NetStream;
    // object holds all meta data
    var objInfo:Object;
    var dur:Number;
    var totalBytes:Number;
    //rtmp of server hosting the flv
    var FLVServer:String                    = "rtmp://www.chameleon.com/vids";
    //flv file
    // Create a new NetConnection instance
    var conn:NetConnection = new NetConnection();
    // Connect with a null value for progressive FLV files
    conn.connect(null);
    var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
    var strSource:String                    = "6.flv";
    // timer for updating player (progress, volume...)
    var tmrDisplay:Timer;
    // ############# FUNCTIONS
    // sets up the player
    function initVideoPlayer():void {
        // hide buttons
        controlPanel.mcVideoControls.btnUnmute.visible    = false;
        controlPanel.mcVideoControls.btnPause.visible    = false;
        controlPanel.mcVideoControls.normalS.visible    = false;
        // set the progress/preload fill width to 1
        controlPanel.mcVideoControls.mcProgressFill.mcFillRed.width = 1;
        controlPanel.mcVideoControls.mcProgressFill.mcFillGrey.width = 1;
        // add global event listener when mouse is released
        stage.addEventListener( MouseEvent.MOUSE_UP, mouseReleased);
        stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreen);
    // ###### PB HIDEN TIMER
        stage.addEventListener(MouseEvent.MOUSE_MOVE, cPanel);
        function cPanel(event:MouseEvent):void {
            controlPanel.gotoAndPlay(1);
            controlPanel.mcVideoControls.mcProgressScrubber.btnProgressScrubber.visible = true;
            Mouse.show();
        // add event listeners to all buttons
        controlPanel.mcVideoControls.btnPause.addEventListener(MouseEvent.CLICK, pauseClicked);
        controlPanel.mcVideoControls.btnPlay.addEventListener(MouseEvent.CLICK, playClicked);
        controlPanel.mcVideoControls.btnStop.addEventListener(MouseEvent.CLICK, stopClicked);
        controlPanel.mcVideoControls.btnMute.addEventListener(MouseEvent.CLICK, muteClicked);
        controlPanel.mcVideoControls.btnUnmute.addEventListener(MouseEvent.CLICK, unmuteClicked);
        controlPanel.mcVideoControls.btnProgressBar.addEventListener(MouseEvent.MOUSE_DOWN, progressScrubberClicked);
        controlPanel.mcVideoControls.btnVolumeBar.addEventListener(MouseEvent.MOUSE_DOWN, volumeScrubberClicked);
        controlPanel.mcVideoControls.mcProgressScrubber.btnProgressScrubber.addEventListener(MouseEvent.MOUSE_DOWN, progressScrubberClicked);
        big_play.addEventListener(MouseEvent.CLICK, BIGPLAY);
        controlPanel.mcVideoControls.fullS.addEventListener(MouseEvent.CLICK, FullScreen);
        controlPanel.mcVideoControls.normalS.addEventListener(MouseEvent.CLICK, NormalScreen);
        // create timer for updating all visual parts of player and add
        // event listener
        tmrDisplay = new Timer(DISPLAY_TIMER_UPDATE_DELAY);
        tmrDisplay.addEventListener(TimerEvent.TIMER, updateDisplay);
        // create a new net connection, add event listener and connect
        // to null because we don't have a media server
        ncConnection = new NetConnection();
        ncConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
        ncConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
        ncConnection.connect(FLVServer);
        // set the smoothing value from the constant
        vidDisplay.smoothing = SMOOTHING;
        controlPanel.mcVideoControls.mcProgressScrubber.durationBubble.visible        =    false;
        // set default volume
        controlPanel.mcVideoControls.mcVolumeScrubber.x = (52 * DEFAULT_VOLUME) + 341;
        controlPanel.mcVideoControls.mcVolumeFill.mcFillRed.width = controlPanel.mcVideoControls.mcVolumeScrubber.x - 394 + 52;
    function onFullscreen(e:FullScreenEvent):void {
        // check if we're entering or leaving fullscreen mode
        if (e.fullScreen) {
            // switch fullscreen buttons
            controlPanel.mcVideoControls.fullS.visible = false;
            controlPanel.mcVideoControls.normalS.visible = true;
            // bottom center align controls
            controlPanel.x = (Capabilities.screenResolutionX - 440) / 2;
            controlPanel.y = (Capabilities.screenResolutionY - 33);
            // size up video display
            vidDisplay.height     = (Capabilities.screenResolutionY - 33);
            vidDisplay.width     = vidDisplay.height * 4 / 3;
            vidDisplay.x        = (Capabilities.screenResolutionX - vidDisplay.width) / 2;
        } else {
            // switch fullscreen buttons
            controlPanel.mcVideoControls.fullS.visible = true;
            controlPanel.mcVideoControls.normalS.visible = false;
            // reset controls position
            controlPanel.x = 0;
            controlPanel.y = 330;
            // reset video display
            vidDisplay.y = 0;
            vidDisplay.x = 0;
            vidDisplay.width = 440;
            vidDisplay.height = 330;
    function FullScreen(e:MouseEvent):void {
        stage.displayState    = "fullScreen";
        controlPanel.mcVideoControls.normalS.visible    = true;
    function NormalScreen(e:MouseEvent):void {
        stage.displayState    = "normal";
        controlPanel.mcVideoControls.fullS.visible    = false;
    function BIGPLAY(e:MouseEvent):void {
        if( bolLoaded) {
            nsStream.resume();
        // show video display
        vidDisplay.visible                    = true;
        // switch play/pause visibility
        controlPanel.mcVideoControls.btnPause.visible    = true;
        controlPanel.mcVideoControls.btnPlay.visible        = false;
        big_play.visible    =    false;
    function playClicked(e:MouseEvent):void {
        // check's, if the flv has already begun
        // to download. if so, resume playback, else
        // load the file
        if( bolLoaded) {
            nsStream.resume();
        // show video display
        vidDisplay.visible                    = true;
        // switch play/pause visibility
        controlPanel.mcVideoControls.btnPause.visible    = true;
        controlPanel.mcVideoControls.btnPlay.visible        = false;
        big_play.visible    =    false;
    function pauseClicked(e:MouseEvent):void {
        // pause video
        nsStream.pause();
        // switch play/pause visibility
        controlPanel.mcVideoControls.btnPause.visible    = false;
        controlPanel.mcVideoControls.btnPlay.visible        = true;
        big_play.visible    =    true;
    function stopClicked(e:MouseEvent):void {
        // calls stop function
        stopVideoPlayer();
        big_play.visible    =    true;
    function muteClicked(e:MouseEvent):void {
        // set volume to 0
        setVolume(0);
        // update scrubber and fill position/width
        controlPanel.mcVideoControls.mcVolumeScrubber.x                = 341;
        controlPanel.mcVideoControls.mcVolumeFill.mcFillRed.width    = 1;
    function unmuteClicked(e:MouseEvent):void {
        // set volume to last used value
        setVolume(intLastVolume);
        // update scrubber and fill position/width
        controlPanel.mcVideoControls.mcVolumeScrubber.x = (53 * intLastVolume) + 341;
        controlPanel.mcVideoControls.mcVolumeFill.mcFillRed.width = controlPanel.mcVideoControls.mcVolumeScrubber.x - 394 + 53;
    function volumeScrubberClicked(e:MouseEvent):void {
        // set volume scrub flag to true
        bolVolumeScrub = true;
        // start drag
        controlPanel.mcVideoControls.mcVolumeScrubber.startDrag(true, new Rectangle(341, 19, 53, 0));
    function progressScrubberClicked(e:MouseEvent):void {
        // set progress scrub flag to true
        bolProgressScrub = true;
        controlPanel.mcVideoControls.mcProgressScrubber.durationBubble.visible        =    true;
        // start drag
        controlPanel.mcVideoControls.mcProgressScrubber.startDrag(true, new Rectangle(0, -6, 630, 0));
    function mouseReleased(e:MouseEvent):void {
        // set progress/volume scrub to false
        bolVolumeScrub        = false;
        bolProgressScrub    = false;
        controlPanel.mcVideoControls.mcProgressScrubber.durationBubble.visible        =    false;
        // stop all dragging actions
        controlPanel.mcVideoControls.mcProgressScrubber.stopDrag();
        controlPanel.mcVideoControls.mcVolumeScrubber.stopDrag();
        // update progress/volume fill
        controlPanel.mcVideoControls.mcProgressFill.mcFillRed.width    = controlPanel.mcVideoControls.mcProgressScrubber.x + 5;
        controlPanel.mcVideoControls.mcVolumeFill.mcFillRed.width    = controlPanel.mcVideoControls.mcVolumeScrubber.x - 394 + 53;
        // save the volume if it's greater than zero
        if((controlPanel.mcVideoControls.mcVolumeScrubber.x - 341) / 53 > 0)
            intLastVolume = (controlPanel.mcVideoControls.mcVolumeScrubber.x - 341) / 53;
    var duration:Number;
    function updateDisplay(ev:TimerEvent):void {
        // checks, if user is scrubbing. if so, seek in the video
        // if not, just update the position of the scrubber according
        // to the current time
        if(bolProgressScrub)
            nsStream.seek( Math.round( controlPanel.mcVideoControls.mcProgressScrubber.x * objInfo.duration / 630 ) )
        else
        controlPanel.mcVideoControls.mcProgressScrubber.x = nsStream.time * 630 / objInfo.duration;
        // set time and duration label
        controlPanel.mcVideoControls.lblTimeDuration.htmlText        = "<font color='#FFFFFF'>" + formatTime(nsStream.time) + "</font> / " + formatTime(objInfo.duration);
        controlPanel.mcVideoControls.mcProgressScrubber.durationBubble.lblTimeDuration.htmlText        = "<font color='#FFFFFF'>" + formatTime(nsStream.time) + "</font>";
        // update the width from the progress bar. the grey one displays
        // the loading progress
        controlPanel.mcVideoControls.mcProgressFill.mcFillRed.width        =     controlPanel.mcVideoControls.mcProgressScrubber.x + 5;
        controlPanel.mcVideoControls.mcProgressFill.mcFillGrey.width    =    nsStream.bytesLoaded * 630 / nsStream.bytesTotal;
        // update volume and the red fill width when user is scrubbing
        if(bolVolumeScrub) {
            setVolume((controlPanel.mcVideoControls.mcVolumeScrubber.x - 341) / 53);
            controlPanel.mcVideoControls.mcVolumeFill.mcFillRed.width = controlPanel.mcVideoControls.mcVolumeScrubber.x - 394 + 53;
    function onMetaData(info:Object):void {
    objInfo = info;
    // now we can start the timer because
    // we have all the necessary data
    if(!tmrDisplay.running)
    tmrDisplay.start();
    function netStatusHandler(event:NetStatusEvent):void {
        // handles net status events
        trace( event.info.code );
        switch (event.info.code) {
            case "NetConnection.Connect.Success":
               connectStream();
                break;
            // trace a messeage when the stream is not found
            case "NetStream.Play.StreamNotFound":
                trace("Stream not found: " + strSource);
                break;
            // when the video reaches its end, we stop the player
            case "NetStream.Play.Stop":
                stopVideoPlayer();
                trace('stoped');
            break;
    function securityErrorHandler(event:SecurityErrorEvent):void {
        trace("securityErrorHandler: " + event);
    function connectStream():void {
        nsStream = new NetStream(ncConnection);
        nsStream.bufferTime = BUFFER_TIME;
        // nsStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
        nsStream.client =  this;
        bolLoaded = true;
        vidDisplay.attachNetStream(nsStream);       
        nsStream.seek(5);
        nsStream.play(strSource);
        nsStream.pause();
        // attach net stream to video object on the stage
        vidDisplay.attachNetStream(nsStream);
        vidDisplay.visible = true;
    function stopVideoPlayer():void {
        // pause netstream, set time position to zero
        nsStream.pause();
        nsStream.seek(0);
        // in order to clear the display, we need to
        // set the visibility to false since the clear
        // function has a bug
        vidDisplay.visible                    = false;
        // switch play/pause button visibility
        controlPanel.mcVideoControls.btnPause.visible    = false;
        controlPanel.mcVideoControls.btnPlay.visible        = true;
    function setVolume(intVolume:Number = 0):void {
        // create soundtransform object with the volume from
        // the parameter
        var sndTransform        = new SoundTransform(intVolume);
        // assign object to netstream sound transform object
        nsStream.soundTransform    = sndTransform;
        // hides/shows mute and unmute button according to the
        // volume
        if(intVolume > 0) {
            controlPanel.mcVideoControls.btnMute.visible        = true;
            controlPanel.mcVideoControls.btnUnmute.visible    = false;
        } else {
            controlPanel.mcVideoControls.btnMute.visible        = false;
            controlPanel.mcVideoControls.btnUnmute.visible    = true;
    function formatTime(t:int):String {
        var remainder:Number;
        var hours:Number = t / ( 60 * 60 );
        remainder = hours - (Math.floor ( hours ));
        hours = Math.floor ( hours );
        var minutes = remainder * 60;
        remainder = minutes - (Math.floor ( minutes ));
        minutes = Math.floor ( minutes );
        var seconds = remainder * 60;
        remainder = seconds - (Math.floor ( seconds ));
        seconds = Math.floor ( seconds );
        var hString:String = hours < 10 ? "0" + hours : "" + hours;   
        var mString:String = minutes < 10 ? "0" + minutes : "" + minutes;
        var sString:String = seconds < 10 ? "0" + seconds : "" + seconds;
        if ( t < 0 || isNaN(t)) return "00:00";           
        if ( hours > 0 )
            return hString + ":" + mString + ":" + sString;
        }else
            return mString + ":" + sString;
    // ############# INIT PLAYER
    initVideoPlayer();

    errr you won't be able to do anything with that......here you go. Don't say I never gave you anything.
    package NetConnections.NetStreams{
    import flash.net.*;
    import flash.events.*;
    import flash.display.Sprite;
    import flash.display.DisplayObject;
    import flash.display.MovieClip;
    import flash.media.*;
    import flash.net.*;
    import NetConnections.NetConnections;
    //import UI.BeginAudio;
    //import UI.RecordAudio;
    //import Main.SendObject;
    import fl.controls.ProgressBar;
    import fl.controls.ProgressBarDirection;
    import fl.controls.ProgressBarMode;
    //import fl.controls.NumericStepper;
    //import fl.controls.Label;
    import flash.utils.Timer;
    public class Audio extends Sprite {
      //var audioS0:NetStream;
      var audioR0:NetStream;
      //var btns1:Object;
      //var mic0:Microphone;
      var rePublishID1:Number;
      //var speaker:int=0;
      var userName00:*;
      var main00:Object;
      public var video0:Video;
      public var progBar:ProgBar;
      //var stepper:NumericStepper;
      //var progLabel:Label;
      //var divID=1;
      var percent;
      var customClient0:Object;
      //var customClient2:Object;
      var duration:Number;
      var step:Number;
      //public var uvCon:Sprite;
      //public var auTrack:Sprite;
      //var micAct:Number;
      //var scale0:Number;
      var oneTime0:int=0;
      var oneTime1:int=0;
      var audioTime0:int=0;
      var yMin:Number;
      var yMax:Number;
      var yOffset:Number;
      var yMin1:Number;
      var yMax1:Number;
      var yOffset1:Number;
      var step1:Number=0;
         var step2:Number=0;
      var amountLoaded:Number;
      var stepper0:Number=0;
      var thisButton:String;
      var stopScrub:int=0;
      var vol:Number =0.75;
      var flashID=0;
      var tim0:Timer;
      //var ID3Meta00:Object;
      //var sFX:SoundChannel;
      //var soundFactory:Sound;
      //var request:URLRequest;
      //var mp3ID:int=0;
      //var T:int=0;
      //var mp3Tim:Timer;
      //var inc:Number;
      //var inc1;
      //var inc2;
      //var inc3;
      public function Audio(audioR:NetStream,userName0:*,main0:Object):void {
       main00=main0;
       //ID3Meta00 = ID3Meta;
       //mic0=Microphone.getMicrophone();
       //mic0.gain =50;
       //mic0.rate=11;
       //audioS0=audioS;
       audioR0=audioR;
       userName00 = userName0;
       main00=main0;
       video0 = new Video(320,240);
       progBar = new ProgBar();
       progBar.progBar.direction = ProgressBarDirection.RIGHT;
       progBar.progBar.mode = ProgressBarMode.POLLED;
       yMin = 0;
       yMax = main00.progBar.progBar.width - main00.progBar.scrubber.width;
       yMin1 = 0;
       yMax1 = main00.track0.width - main00.track0.volThumb.width;
       main00.progBar.progBar.addEventListener(Event.COMPLETE, CompleteHandler,false,0,true);
       main00.play_btn.buttonMode=true;
       main00.play_btn.addEventListener(MouseEvent.MOUSE_DOWN,PlayBack);
       main00.pause_btn.buttonMode=true;
       main00.pause_btn.addEventListener(MouseEvent.MOUSE_DOWN,PausePlayBack);
       audioR0.addEventListener(NetStatusEvent.NET_STATUS,DetectEnd,false,0,true);
       tim0 = new Timer(1000,0);
       tim0.addEventListener(TimerEvent.TIMER,countBuff,false,0,true);
       PlayBack();
      private function PlayBack(e:MouseEvent=null):void{
       main00.pause_btn.x=main00.play_btn.x;
       main00.pause_btn.y=main00.play_btn.y;
       main00.play_btn.x =main00.pause_btn.x;
       main00.play_btn.y =2800;
       if(audioTime0==0){
       SetAudio(0);
       audioTime0=1;
       }else{
       SetAudio(1);
      private function PausePlayBack(e:MouseEvent=null):void{
       main00.play_btn.x =main00.pause_btn.x;
       main00.play_btn.y =main00.pause_btn.y;
       main00.pause_btn.x=main00.play_btn.x;
       main00.pause_btn.y=2800;
       SetAudio(1);
      private function thumbDown(e:MouseEvent):void {
       thisButton ="scrubber";
       stopScrub=1;
          ChangeHandler();
       main00.stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
       yOffset = mouseX - main00.progBar.scrubber.x;
      private function thumbUp(e:MouseEvent):void {
       stopScrub=0;
       ChangeHandler();
       step1=0;
       step2=0;
       main00.stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
      private function thumbMove(e:MouseEvent):void {
       main00.progBar.scrubber.x = mouseX - yOffset;
       if (main00.progBar.scrubber.x <= yMin) {
        main00.progBar.scrubber.x = yMin;
       if (main00.progBar.scrubber.x >= yMax) {
        main00.progBar.scrubber.x = yMax;
       dispatchEvent(new ScrollBarEvent(main00.progBar.scrubber.x / yMax));
       e.updateAfterEvent();
      private function sbChange(e:ScrollBarEvent):void {
       trace(e.currentTarget.name);
       //var vol = Math.floor(e.scrollPercent*100)*.01;
       if(thisButton=="scrubber"){
       //audioR0.seek(step2);
       step1 = Math.floor((main00.progBar.scrubber.x/main00.progBar.progBar.width)*duration);
       audioR0.seek(step1);
       trace(step1);
       //main00.progBar.progBar.setProgress(step1,duration);
       if(thisButton=="volThumb"){
        vol=Math.floor(e.scrollPercent*100)*.02;
        trace("+++++++"+main00.track0.volThumb.x);
        trace(vol);
       if (audioR0 != null) {
       var st:SoundTransform = new SoundTransform(vol);
       audioR0.soundTransform = st;
      //rewind
      private function Rewind(e:MouseEvent):void{
       audioR0.seek(0);
       stepper0=0;
      private function FastFD(e:MouseEvent):void{
      trace("ok");
      var stepper1:Number=Math.floor((main00.progBar.scrubber.x/main00.progBar.progBar.width)*durat ion);
      stepper1++;
      stepper1=stepper1*2;
      if(stepper1>=duration){
       stepper1=duration-2;
      if(main00.progBar.progBar.percentComplete ==100){
       stepper1=duration-2;
       progBar.progBar.reset();
       audioR0.seek(stepper1);
    //volume
    private function thumbDown1(e:MouseEvent):void {
             thisButton="volThumb";
       main00.stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMove1);
       yOffset1 = mouseX - main00.track0.volThumb.x;
      private function thumbUp1(e:MouseEvent):void {
       main00.stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMove1);
      private function thumbMove1(e:MouseEvent):void {
       main00.track0.volThumb.x = mouseX - yOffset1;
       if (main00.track0.volThumb.x <= yMin1) {
        main00.track0.volThumb.x = yMin1;
       if (main00.track0.volThumb.x >= yMax1) {
        main00.track0.volThumb.x = yMax1;
       dispatchEvent(new ScrollBarEvent(main00.track0.volThumb.x / yMax));
       e.updateAfterEvent();
      private function sbChange1(e:ScrollBarEvent):void {
       var vol = Math.floor(e.scrollPercent*100)*.01;
       var st:SoundTransform = new SoundTransform(vol);
       if (audioR0 != null) {
        audioR0.soundTransform = st;
      private function auTrackMic(e:Event):void {
       micAct = Math.floor(mic0.activityLevel);
       if (micAct<=0) {
        scale0 =0;
       } else if (micAct>1&&micAct<=15) {
        scale0=0;
       } else if (micAct>15&&micAct<=30) {
        scale0=0;
       } else if (micAct>30&&micAct<=45) {
        scale0=8;
       } else if (micAct>45&&micAct<=60) {
        scale0=8.5;
       } else if (micAct>60&&micAct<=75) {
        scale0=9;
       } else if (micAct>1&&micAct<=80) {
        scale0=9.5;
       } else if (micAct>1&&micAct<=90) {
        scale0=10;
       } else if (micAct>90) {
        scale0=10.5;
       auTrack.scaleX =scale0;
      function RemoveProgBar(e:Event):void {
       ////trace("progbar gone");
       if (progBar.parent !=null) {
        progBar.parent.removeChild(progBar);
      public function metaDataHandler(info:Object):void {
       duration =info.duration;
       trace("+++++++======="+duration);
       if(duration <=1||!duration){
        audioR0.close();
        main00.progBar.progBar.reset;
        main00.progBar.scrubber.x=main00.progBar.progBar.x;
        addEventListener(Event.ENTER_FRAME,FlashTastic,false,0,true);
      private function FlashTastic(e:Event):void{
    trace("flashing");
    if(flashID==0){
      main00.play_btn.removeEventListener(MouseEvent.MOUSE_DOWN,PlayBack);
      main00.pause_btn.removeEventListener(MouseEvent.MOUSE_DOWN,PausePlayBack);
    RemoveListeners();
    main00.play_btn.enabled=false;
    main00.pause_btn.enabled=false;
    main00.progBar.progBar.setProgress(100,100);
    main00.progBar.progBar.alpha=0;
    flashID=1;
    }else{
    main00.progBar.progBar.alpha=1;
    flashID=0;
    private function ChangeHandler(event:Event=null):void {
       if(main00.play_btn.y ==2800 && main00.pause_btn.y==2800){
          main00.play_btn.y =15;
       if(main00.progBar.scrubber.x==0 && main00.progBar.progBar==100){
        main00.progBar.progBar.reset();
       if (oneTime0==0) {
        //main00.progBar.progBar.reset();
        oneTime0=1;
       //amountLoaded = audioR0.time/duration;
             //main00.progBar.progBar.width = amountLoaded*218;
            if(stopScrub==0){
         main00.progBar.scrubber.x = audioR0.time/duration*main00.progBar.progBar.width;
       //main00.progBar.scrubber.x = percent;
       //seconds//getmetadata
       main00.progBar.progBar.setProgress(audioR0.time,duration);
      percent = int(main00.progBar.progBar.percentComplete);
       if(percent ==100){
        main00.progBar.progBar.reset();
        main00.progBar.scrubber.x=main00.progBar.progBar.x;
      private function Mp3Tim(e:TimerEvent){
          if(oneTime1 ==0){
       //dur total number of segments
       var dur=Math.ceil(soundFactory.length/1000);//number of segments
       trace("duration = "+dur);
          inc = 1;
       oneTime1=1;
       inc = (inc++)+1.114;
       trace(inc);
       dur=Math.ceil(soundFactory.length/1000);//number of segments
       progBar.progBar.setProgress(inc,dur);
       //the end of MP3 is delayed by 5 seconds to allow for slight changes multiple mp3 length .
       if(inc >= dur+5){
       Mp3Fin();
      function CompleteHandler(e:Event):void {
       //oneTime0=0;
       progBar.progBar.setProgress(100,100);
      function Mp3Fin():void {
       mp3Tim.stop();
       mp3Tim.reset();
       mp3Tim.removeEventListener(TimerEvent.TIMER,Mp3Tim);
       dispatchEvent(new Event("TYPE_AUDIOSTOP"));
       oneTime0=0;
       progBar.progBar.setProgress(100,100);
                oneTime1=0;
      private function SetListeners():void {
       main00.play_btn.enabled = true;
       main00.pause_btn.enabled= true;
       main00.progBar.scrubber.addEventListener(MouseEvent.MOUSE_DOWN, thumbDown,false,0,true);
       main00.progBar.scrubber.enabled=true;
       main00.stage.addEventListener(MouseEvent.MOUSE_UP, thumbUp,false,0,true);
       main00.track0.volThumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbDown1,false,0,true);
       main00.track0.volThumb.buttonMode=true;
       main00.track0.volThumb.enabled=true;
       main00.stage.addEventListener(MouseEvent.MOUSE_UP, thumbUp1,false,0,true);
       addEventListener(ScrollBarEvent.VALUE_CHANGED, sbChange,false,0,true);
       main00.rw_btn.addEventListener(MouseEvent.CLICK,Rewind,false,0,true);
       main00.rw_btn.buttonMode=true;
       main00.rw_btn.enabled=true;
       main00.ff_btn.addEventListener(MouseEvent.CLICK,FastFD,false,0,true);
       main00.ff_btn.buttonMode=true;
       main00.ff_btn.enabled=true;
      private function RemoveListeners():void {
       main00.progBar.scrubber.removeEventListener(MouseEvent.MOUSE_DOWN, thumbDown);
       main00.progBar.scrubber.enabled=false;
       main00.stage.removeEventListener(MouseEvent.MOUSE_UP, thumbUp);
       main00.track0.volThumb.removeEventListener(MouseEvent.MOUSE_DOWN, thumbDown1);
       main00.track0.volThumb.enabled=false;
       main00.stage.removeEventListener(MouseEvent.MOUSE_UP, thumbUp1);
       removeEventListener(ScrollBarEvent.VALUE_CHANGED, sbChange);
       main00.rw_btn.removeEventListener(MouseEvent.CLICK,Rewind);
       main00.rw_btn.enabled=false;
       main00.ff_btn.removeEventListener(MouseEvent.CLICK,FastFD);
          main00.ff_btn.enabled=false;
      private function DetectEnd(e:NetStatusEvent=null):void {
       //detect end of audio/video file
                    trace(e.info.code);
       if(e.info.code=="NetStream.Play.Start"){
        vol=vol;
          tim0.start();
       if (e.info.code == "NetStream.Buffer.Full") {
        removeEventListener(Event.ENTER_FRAME,FlashTastic);
        tim0.stop();
        SetListeners();
       if (e.info.code == "NetStream.Play.Stop") {
        audioTime0=0;
        main00.play_btn.x =main00.pause_btn.x;
           main00.play_btn.y =main00.pause_btn.y;
           main00.pause_btn.x=main00.play_btn.x;
           main00.pause_btn.y=2800;
        if (percent < 100) {
         main00.progBar.progBar.reset();
         percent = int(main00.progBar.progBar.percentComplete);
         main00.progBar.scrubber.x = percent;
         RemoveListeners();
        main00.call0.removeEventListener("TYPE_TIMER",ChangeHandler);
        //dispatchEvent(new Event("TYPE_AUDIOSTOP"));
       if(e.info.code=="NetStream.Buffer.Empty"){
        main00.progBar.progBar.reset();
           main00.progBar.scrubber.x = 0;
        step1=0;
      private function countBuff(e:TimerEvent):void{
       addEventListener(Event.ENTER_FRAME,FlashTastic,false,0,true);
      private function SetAudio(btnID) {
       var determine = e.num0[0].toString().search(".mp3");
       if (determine != -1) {
        //play mp3
        var url=e.num0[0].toString();
        request=new URLRequest(url);
        soundFactory=new Sound  ;
        soundFactory.load(request);
        sFX=soundFactory.play();
       mp3Tim=new Timer(1000,0);
       mp3Tim.addEventListener(TimerEvent.TIMER,Mp3Tim,false,0,true);
       mp3Tim.start();
        main00.call0.addEventListener("TYPE_TIMER",ChangeHandler,false,0,true);
                    mp3ID=1;
       } else {
        //play flv
        mp3ID=0;
        if(btnID==0){
         if(main00.uniqueID!=null){
         trace("audio audio");
         main00.call0.addEventListener("TYPE_TIMER",ChangeHandler,false,0,true);
         audioR0.play(main00.uniqueID);
         customClient0 = {onMetaData:metaDataHandler};
         audioR0.client= customClient0;
         video0.attachNetStream(audioR0);
         video0.x=main00.stage.stageWidth/2-video0.width/2;
         video0.y=6;
         addChild(video0);
         removeEventListener(Event.ENTER_FRAME,FlashTastic);
         }else{
         addEventListener(Event.ENTER_FRAME,FlashTastic,false,0,true);
        }else if(btnID==1){
         removeEventListener(Event.ENTER_FRAME,FlashTastic);
        tim0.removeEventListener(TimerEvent.TIMER,countBuff);
        audioR0.togglePause();
        else {
         trace("ok"+e.num0[0]);
         main00.call0.addEventListener("TYPE_TIMER",ChangeHandler,false,0,true);
         customClient0 = {onMetaData:metaDataHandler};
         audioR0.play(e.num0[0].toString());
         audioR0.client= customClient0;
         video0.attachNetStream(audioR0);
         video0.x=186;
         video0.y=245;
         addChild(video0);
      private function RecAudio(e:RecordAudio) {
       var recID = new Date().time;
       audioS0.attachAudio(mic0);
       audioS0.publish(recID.toString(),"live");
       main00.nc1.call("RecordAudio",null,userName00,recID.toString());
    class CustomClient0 {
    public function onMetaData(info:Object):void {
      //trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);
    public function onCuePoint(info:Object):void {
      //trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);
    public function onPlayStatus(info:Object):void {
      //trace("onPlayStatus");
    class CustomClient1 {
    //trace("info");
    public function onMetaData(info:Object):void {
      //trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);
    public function onCuePoint(info:Object):void {
      //trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);
    public function onPlayStatus(info:Object):void {
      //trace("onPlayStatus");

  • How do i make a single connection to handle video, audio and chat

    I'm developing an application and i want to make one single connection for video(netstream) and chat(sharedObject).
    I have one connection for each but i have limited connection availeble in the server so i need to make a single connection to handle the video net stream and chat sharedObject.
    I use this urls to connect:
    private var serverWebcamURL:String = "rtmp://myserverIP/live";
    private var serverChatURL:String = "rtmp://myserverIP/multicast/chat";
    What do i have to do to make this work?
    Thank You,
    Just-ME

    LOL...thanks QTK.
    In front of my face!

  • F4v in IE 7 fails - no metadata?

    Hey all -
    I'm having trouble with my new player in IE 7 (it works great in all other browsers, of course).
    It seems that in IE 7, it is waiting until the full file downloads in order to get metadata; what this means is that the player itself is not built until after the video fully loads, since it's pulling width and height from the file.
    However, f4vs don't seem to work at all. The video player is never built, I'm assuming because no metadata is being sent, and the player is built after the metadata is recieved. But I don't know if that's it - there are no errors thrown in the debugging flash player distribution.
    Here's a link to the player:
    http://www.tribepictures.com/player/player.html?pageVideo=Daniel_Patents_04_06_09.f4v

    Here it is - the pertinent code is at the top and at the bottom, the rest is fluff and works fine.  Basically, it's instructed to create the netstream. Then, once the netstream has loaded the file, to pull the metadata. From there, it can build the player and start playing.
    package resources{
        import flash.media.Video;
        import flash.net.NetConnection;
        import flash.net.NetStream;
        import flash.display.Sprite;
        import flash.events.MouseEvent;
        import flash.events.KeyboardEvent;
        import flash.events.Event;
        import flash.display.LoaderInfo;
        import flash.display.Stage;
        import flash.display.Shape;
        import flash.geom.Rectangle;
        import flash.display.MovieClip;
        import flash.text.TextField;
        import flash.display.StageDisplayState;
        public class videoPlayer extends Sprite {
            private var ncFLVConnection:NetConnection = new NetConnection();
            private var nsVideo:NetStream;
            private var videoTitle:String;
            private var videoStage:Video;
            private var videoHeight:int;
            private var videoWidth:int;
            private var videoURL:String;
            private var AutoPlay:Boolean;
            private var totalHeight:int;
            private var isPaused:Boolean;
            private var client:Object;
            private var metaDataLoaded:int;
            private var sliderLength:Number;
            private var sliderIncrement:Number;
            private var theLastTime:Number;
            private var videoLength:Number;
            private var sliderStartPoint:Number;
            private var fullyDownloaded:Boolean;
            private var pausedTime:Number;
            private var seeked:Boolean;
            private var startedYet:Boolean;
            public var playBtn:MovieClip;
            public var fullscreenmc_mc:MovieClip;
            public var current_Time:TextField;
            public var total_Time:TextField;
            public var videoTitle_txt:TextField;
            public var orange:Shape;
            public var slider:Sprite;
            public var sliderShape:Shape;
            public var sliderBar:Sprite;
            public var sliderBarShape:Shape;
            public var sliderBounds:Rectangle;
            public var downloadCompleted:Sprite;
            public var downloadCompletedShape:Shape;
            public var videoStageClicker:Sprite;
            public var videoStageClickerShape:Shape;
            public var loading_mc:MovieClip;
            public function videoPlayer():void {
                trace("videoPlayer loaded");
                metaDataLoaded=0;
                theLastTime=0;
                fullyDownloaded=false;
                pausedTime=0;
                seeked=false;
                startedYet=false;
                //FINAL CODE
                videoURL=root.loaderInfo.parameters.pageVideo;
                AutoPlay=root.loaderInfo.parameters.AutoPlay;
                videoTitle=root.loaderInfo.parameters.videoTitle;
                //FOR TESTING, COMMENT OUT OTHERWISE!!!!!!
                //AutoPlay=false;
                //videoURL="personal.flv";
                //videoTitle="test";
                videoTitle_txt.text=videoTitle;
                if (videoTitle_txt.text=="") {
                    videoTitle_txt.text="Tribe Pictures"
                setupANetStream();
                centerThatShit(videoTitle_txt);
                videoTitle_txt.y=stage.stageHeight-30;
            private function setupANetStream():Boolean {
                trace("Starting a Net Stream");
                ncFLVConnection.connect(null);
                nsVideo=new NetStream(ncFLVConnection);
                nsVideo.client = new Object();
                client = new Object();
                nsVideo.client=client;
                client.onMetaData=nsMetaDataCallback;
                nsVideo.play(videoURL);
                nsVideo.togglePause();
                return (true);
            private function afterMetaData():void {
                trace("Added to stage");
                loading_mc.stop();
                loading_mc.alpha=0;
                addChild(videoStage);
                centerThatShit(videoStage);
                videoStage.attachNetStream(nsVideo);
                buildControls();
                orangeOutlineMaker();
                buildTheVideoClicker();
                if (AutoPlay==true) {
                    nsVideo.resume();
                    isPaused=false;
                    playBtn.gotoAndStop(3);
                    startedYet=true;
                    trace("Autoplaying");
                } else {
                    isPaused=true;
                    playBtn.gotoAndStop(1);
                    trace("Not autoplaying");
                playBtn.addEventListener(MouseEvent.MOUSE_DOWN, pauseIt);
                addEventListener(Event.ENTER_FRAME, onEnterFrame);
                stage.addEventListener(KeyboardEvent.KEY_DOWN, pauseItKey);
            private function buildTheVideoClicker():void {
                videoStageClicker = new Sprite();
                videoStageClickerShape = new Shape();
                videoStageClickerShape.graphics.beginFill(0xFFFFFF,0);
                trace(videoStage.width+","+videoStage.height);
                videoStageClickerShape.graphics.lineTo(videoStage.width,0);
                videoStageClickerShape.graphics.lineTo(videoStage.width,videoStage.height);
                videoStageClickerShape.graphics.lineTo(0,videoStage.height);
                videoStageClickerShape.graphics.lineTo(0,0);
                videoStageClicker.addChild(videoStageClickerShape);
                addChild(videoStageClicker);
                videoStageClicker.x=videoStage.x;
                videoStageClicker.y=videoStage.y;
                videoStageClicker.addChild(fullscreenmc_mc);
                fullscreenmc_mc.x=0+videoWidth-20;
                fullscreenmc_mc.y=0+videoHeight-20;
                videoStageClicker.addEventListener(MouseEvent.MOUSE_DOWN, fullScreen);
                videoStageClicker.addEventListener(MouseEvent.MOUSE_OVER, fullScreenIcon);
                videoStageClicker.addEventListener(MouseEvent.MOUSE_OUT, fullScreenIconOut);
                trace("Video Clicker created");
            private function centerThatShit(obj:Object):Boolean {
                obj.y = (obj.stage.stageHeight - obj.height)/2;
                obj.x = (obj.stage.stageWidth - obj.width)/2;
                trace(obj.name+" centered!");
                return (true);
            private function buildControls() {
                totalHeight=videoHeight+playBtn.height+5;
                playBtn.x=videoStage.x;
                playBtn.y=videoStage.y+videoHeight+5;
                total_Time.x=videoStage.x+videoWidth-60;
                total_Time.y=videoStage.y+videoHeight+6.5;
                current_Time.x=videoStage.x+videoWidth-120;
                current_Time.y=videoStage.y+videoHeight+6.5;
                makeDownloadedBar();
                makeTheSlider();
                downloadCompleted.x=slider.x;
                downloadCompleted.y=slider.y;
                trace("Controls built.");
                return (true);
            private function makeDownloadedBar():void {
                downloadCompleted = new Sprite();
                downloadCompletedShape = new Shape();
                downloadCompletedShape.graphics.beginFill(0xFFFFFF,.5);
                downloadCompletedShape.graphics.lineTo(1,0);
                downloadCompletedShape.graphics.lineTo(1,5);
                downloadCompletedShape.graphics.lineTo(0,5);
                downloadCompletedShape.graphics.lineTo(0,0);
                downloadCompleted.addChild(downloadCompletedShape);
                addChild(downloadCompleted);
            private function makeTheSlider() {
                slider = new Sprite();
                sliderShape = new Shape();
                sliderLength=videoWidth-170;
                trace("Slider Length="+sliderLength);
                sliderShape.graphics.lineStyle(1,0xFFFFFF,1,true);
                sliderShape.graphics.lineTo(sliderLength,0);
                sliderShape.graphics.lineTo(sliderLength,5);
                sliderShape.graphics.lineTo(0,5);
                sliderShape.graphics.lineTo(0,0);
                slider.addChild(sliderShape);
                addChild(slider);
                slider.x=videoStage.x+40;
                slider.y=playBtn.y+12.5;
                sliderBar = new Sprite();
                sliderBarShape = new Shape();
                sliderBarShape.graphics.beginFill(0xFFFFFF,.8);
                sliderBarShape.graphics.lineStyle(2,0xFFFFFF,.8,true);
                sliderBarShape.graphics.lineTo(5,0);
                sliderBarShape.graphics.lineTo(5,20);
                sliderBarShape.graphics.lineTo(0,20);
                sliderBarShape.graphics.lineTo(0,0);
                sliderBar.addChild(sliderBarShape);
                sliderBar.x=slider.x;
                sliderBar.y=playBtn.y+5;
                sliderIncrement=((sliderLength-4)/videoLength);
                sliderBounds=new Rectangle(sliderBar.x,sliderBar.y+1,sliderLength,.1);
                sliderBar.addEventListener(MouseEvent.MOUSE_DOWN, seekIt);
                addChild(sliderBar);
            private function orangeOutlineMaker() {
                var orange:Shape = new Shape();
                orange.graphics.lineStyle(2,0xD47200,1,true);
                orange.graphics.lineTo(videoWidth+25,0);
                orange.graphics.lineTo(videoWidth+25,totalHeight+25);
                orange.graphics.lineTo(0,totalHeight+25);
                orange.graphics.lineTo(0,0);
                addChild(orange);
                orange.y=videoStage.y-12.5;
                orange.x=videoStage.x-12.5;
                return (true);
            private function pauseItKey(evt:KeyboardEvent) {
                if (evt.charCode==32) {
                    switch (isPaused) {
                        case true :
                            nsVideo.togglePause();
                            isPaused=false;
                            playBtn.play();
                            break;
                        case false :
                            nsVideo.togglePause();
                            trace(nsVideo.time);
                            pausedTime=nsVideo.time;
                            trace(pausedTime);
                            isPaused=true;
                            playBtn.play();
                            break;
            private function pauseIt(evt:Event) {
                switch (isPaused) {
                    case true :
                        nsVideo.togglePause();
                        isPaused=false;
                        playBtn.play();
                        break;
                    case false :
                        nsVideo.togglePause();
                        trace(nsVideo.time);
                        pausedTime=nsVideo.time;
                        trace(pausedTime);
                        isPaused=true;
                        playBtn.play();
                        break;
            private function fullScreenIcon(evt:MouseEvent) {
                trace("Mouse Screen Over");
                fullscreenmc_mc.play();
                fullscreenmc_mc.alpha=1;
            private function fullScreenIconOut(evt:MouseEvent) {
                trace("Mouse Screen Out");
                fullscreenmc_mc.gotoAndStop(1);
                fullscreenmc_mc.alpha=0;
            private function seekIt(evt:MouseEvent) {
                stage.addEventListener(MouseEvent.MOUSE_UP, playIt);
                seeked=true;
                nsVideo.pause();
                sliderStartPoint=sliderBar.x;
                evt.target.startDrag(false,sliderBounds);
            private function playIt(evt:MouseEvent) {
                trace("MouseUp");
                if (isPaused==false) {
                    seeked=false;
                    sliderBar.stopDrag();
                    sliderBar.x=nsVideo.time*sliderIncrement+slider.x;
                    nsVideo.togglePause();
                } else {
                    seeked=false;
                    sliderBar.stopDrag();
                    sliderBar.x=nsVideo.time*sliderIncrement+slider.x;
                stage.removeEventListener(MouseEvent.MOUSE_UP, playIt);
            private function timeCodeIt(currentTime:Number):String {
                var theMinutes:int = new int();
                var theSeconds:int = new int();
                theMinutes=int(currentTime/60);
                theSeconds=int(currentTime%60);
                if (theMinutes<10&&theSeconds<10) {
                    return ("0"+theMinutes+":0"+theSeconds);
                } else if (theMinutes>=10 && theSeconds<10) {
                    return (theMinutes+":0"+theSeconds);
                } else if (theMinutes<10 && theSeconds>=10) {
                    return ("0"+theMinutes+":"+theSeconds);
                } else {
                    return (theMinutes+":"+theSeconds);
            private function getTheTime():Number {
                var currentVidTime:Number = new Number();
                currentVidTime=nsVideo.time;
                return (currentVidTime);
            private function fullScreen(event:Event):void {
                trace("full screen clicked");
                if (stage.displayState==StageDisplayState.FULL_SCREEN) {
                    stage.displayState=StageDisplayState.NORMAL;
                } else if (stage.displayState == StageDisplayState.NORMAL) {
                    stage.displayState=StageDisplayState.FULL_SCREEN;
                    fullscreenmc_mc.alpha=0;
            private function onEnterFrame(evt:Event) {
              if (isPaused==false&&seeked==false) {
                    var theTime:Number = new Number();
                    theTime=getTheTime();
                    current_Time.text=timeCodeIt(theTime);
                    if (int(theTime)>int(theLastTime)) {
                        sliderBar.x+=sliderIncrement;
                        trace((sliderBar.x-slider.x)/sliderIncrement);
                    theLastTime=theTime;
                } else if (isPaused==true && seeked==true) {
                    if (sliderBar.x!=sliderStartPoint) {
                        var thePercentage:Number = new Number();
                        thePercentage=(sliderBar.x-slider.x)/sliderLength;
                        current_Time.text=timeCodeIt(thePercentage*videoLength);
                        nsVideo.seek(thePercentage*videoLength);
                } else if (isPaused==false && seeked==true) {
                    if (sliderBar.x!=sliderStartPoint) {
                        thePercentage=(sliderBar.x-slider.x)/sliderLength;
                        current_Time.text=timeCodeIt(thePercentage*videoLength);
                        nsVideo.seek(thePercentage*videoLength);
                if (fullyDownloaded==false) {
                    downloadCompleted.width=(nsVideo.bytesLoaded/nsVideo.bytesTotal)*sliderLength;
                    sliderBounds.width=downloadCompleted.width;
                if (sliderBar.x>=(slider.x+sliderLength)) {
                    sliderBar.x=slider.x+sliderLength;
            private function nsMetaDataCallback(mData:Object):void {
                if (metaDataLoaded==0) {
                    videoHeight=mData.height;
                    videoWidth=mData.width;
                    videoLength=mData.duration;
                    trace("metaData loaded, height="+videoHeight+", width="+videoWidth);
                    videoStage=new Video(videoWidth,videoHeight);
                    videoStage.name="Player";
                    total_Time.text=timeCodeIt(mData.duration);
                    trace("Creating a "+videoWidth+"x"+videoHeight+" player for "+videoURL);
                    current_Time.text="00:00";
                    //recurrsion prevention
                    metaDataLoaded+=1;
                    afterMetaData();

  • Create Sound Spectrum in AS3

    I'm trying to create a spectrum display for microphone
    input/playback in ActionScript 3 but can't seem to get it to work.
    I understand that the SoundMixer class does not control dynamically
    created Sound objects, but surely there is a way around this! Has
    anyone done this or have any ideas on how to approach this problem?
    I can record and playback the sound using rtmp and net streams just
    fine, but can't manage to create any form of sound spectrum from
    this sound. I'm at a loss here...
    Any suggestions would be appreciated!!

    I have created the variable and set to 0.  However i'm not sure how to get it to add one when an item on the stage is clicked on??  What would this look like??  Any help would be great
    Thanks in anticipation

Maybe you are looking for

  • X-Fi XtremeMusic and Digital Out

    Please forgive me if this has been asked before, but here goes... I have a WinXP machine with an X-Fi XtremeMusic card that I would like to hook up to my Onkyo TX-SR600 receiver. The ideal situation would be to run a single digital line into the coax

  • Some svg files are not opening in adobe illustrator

    hii, i m trying to open .svg picture files into adobe illustrator. some file are opening but for some files its giving a message that "Validate svg files"... i have to embed these .svg file into an excel sheet but unable to do it . please suggest.

  • HP 7510 All-in-One Won't Wake Up

    My networked HP 7510 goes into power saving mode as set in default settings, but will not wake up when a print job is sent from a networked PC - except randomly and for reasons that I can't explain. I can't correlate when it will wake up to any parti

  • Cover flow still not up to par

    Getting my dad (we're both photographers) to switch to Mac took enough convincing... he had used Windows for so long and when he saw my Mac the on thing that stood out to him was the fact that he couldn't edit his photo workflow in 'Finder' like he c

  • Creating a DVD menu, how do I compress videos?

    I'm going to be creating a DVD menu on DVD studio pro for an assignment, but I don't know how to use Compressor. I was wondering if anyone can help me on how to compress videos (main menu, chapter selection menu, transition, etc) on Compressor before