A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [RESOLVED] VideoError: 1000: Unable to make connection to server or to find FLV on server

  1. #1
    Member
    Join Date
    Sep 2008
    Posts
    39

    resolved [RESOLVED] VideoError: 1000: Unable to make connection to server or to find FLV on server

    I keep getting this error in my output panel when I switch from one flv to another. I am loading up multiple flvs from an xml file.

    VideoError: 1000: Unable to make connection to server or to find FLV on server
    at fl.video::VideoPlayer/pause()
    at fl.video::FLVPlayback/pause()
    at WEBTVtest2_fla::MainTimeline/listListener()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at fl.controls::SelectableList/handleCellRendererClick()

    HERE is the code I use to load the xml file:

    import fl.video.VideoEvent;




    stop();
    myList.visible=false;

    menu_click.addEventListener(MouseEvent.CLICK, openit);
    myList.addEventListener(MouseEvent.ROLL_OVER, drawer_open);
    myList.addEventListener(MouseEvent.ROLL_OUT, drawer_close);
    selections.addEventListener(MouseEvent.ROLL_OUT, selectionsroll);

    function selectionsroll(event:MouseEvent):void {
    selections.rewind=true;
    }


    function drawer_close(event:MouseEvent):void {
    selections.rewind=true;
    }


    function drawer_open(event:MouseEvent):void {
    selections.play();
    selections.rewind=false;
    }

    function openit(event:MouseEvent):void {
    myFLVPlybk.pause();
    menu_mc.play();
    menu_mc.rewind=false;
    menu_click.rewind=false;
    menu_click.play();
    closemenu_mc.play();
    closemenu_mc.rewind=false;
    selections.visible=true;

    }
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    xmlLoader.load(new URLRequest("playlistXML.xml"));


    function xmlLoaded(event:Event):void {
    var playlistXML:XML = new XML(event.target.data);
    var item:XML;
    for each (item in playlistXML.videoname) {
    trace("item: "+item.attribute("flvurl").toXMLString());
    trace("item:"+item.attribute("longdesc").toXMLStri ng());
    this.selections.selection_desc.text = (item.attribute("longdesc").toXMLString());
    titletext.text = (item.attribute("titletext").toXMLString());


    myList.addItem({label:item.attribute("desc").toXML String(),
    data: item.attribute("flvurl").toXMLString(),
    text:item.attribute("titletext").toXMLString(),
    text:item.attribute("longdesc").toXMLString()});

    }
    //select the first video
    myList.selectedIndex = 0;
    //And automatically play it
    myFLVPlybk.play(myList.selectedItem.data);
    this.selections.selection_desc.text = (myList.selectedItem.text);
    titletext.text = (myList.selectedItem.text);


    }

    //Add a listener to detect when new video is selected and play it
    function listListener(event:Event) {
    myFLVPlybk.play(event.target.selectedItem.data);
    this.selections.selection_desc.text = (event.target.selectedItem.text);
    titletext.text = (event.target.selectedItem.text);

    menu_mc.rewind = true;
    closemenu_mc.rewind=true;
    menu_click.rewind = true;
    selections.visible=false;
    titletext.visible=true;
    menu_mc.flv.my_player.pause();

    }
    myList.addEventListener(Event.CHANGE, listListener);


    closemenu_mc.addEventListener(MouseEvent.CLICK, closeit);
    function closeit(event:MouseEvent):void {
    menu_mc.rewind=true;
    closemenu_mc.rewind=true;
    menu_click.rewind=true;
    selections.visible=false;

    }


    myFLVPlybk.addEventListener(VideoEvent.COMPLETE, vidComplete);


    // listen for complete event; play next video
    function vidComplete(eventObject:VideoEvent):void {
    if (myList.selectedIndex < myList.length-1) {
    myList.selectedIndex = myList.selectedIndex+1;
    myList.scrollToIndex(myList.selectedIndex);
    myFLVPlybk.play(myList.selectedItem.data);
    this.selections.selection_desc.text = (myList.selectedItem.text);
    titletext.text = (myList.selectedItem.text);
    }



    }
    My flv componenets name is obviously myFLVPlybk and the list is myList ...

  2. #2
    Member
    Join Date
    Sep 2008
    Posts
    39
    I think this is resolved - I'm not sure yet. does it make sense that I would only get that error when testing the movie - or when playing it on the staging server? WHen I threw it up online it worked with no errors ...?

  3. #3
    Senior Member hanszorg2's Avatar
    Join Date
    Sep 2004
    Posts
    308
    I am getting this error:


    VideoError: 1000: Unable to make connection to server or to find FLV on server
    at fl.video::VideoPlayer/stop()
    at fl.video::FLVPlayback/stop()
    at test14_fla::MainTimeline/clearBigImage()


    For me its working fine offline but doesn't work online

    Please help

  4. #4
    Member
    Join Date
    Sep 2008
    Posts
    39
    Quote Originally Posted by hanszorg2 View Post
    I am getting this error:


    VideoError: 1000: Unable to make connection to server or to find FLV on server
    at fl.video::VideoPlayer/stop()
    at fl.video::FLVPlayback/stop()
    at test14_fla::MainTimeline/clearBigImage()


    For me its working fine offline but doesn't work online

    Please help
    What are you trying to do?
    What does your code look like?

  5. #5
    Senior Member hanszorg2's Avatar
    Join Date
    Sep 2004
    Posts
    308
    Actionscript Code:
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.events.ProgressEvent;
    import flash.events.MouseEvent;
    import fl.video.*;
    import fl.controls.ProgressBar;
    import flash.filters.BlurFilter;
    var bf:BlurFilter;

    var xmlLoader:URLLoader = new URLLoader();
    var xmlData:XML = new XML();
    var thumbNumber:Number=0;
    var boxNumber:Number=1;
    var thumbLoopCount:Number=6;
    var totalBoxes:Number=6;
    var thumbLoader:Loader;
    var thumbRequest:URLRequest;
    var totalImages:Number;
    var currentThumb:String;
    var MS:XMLList;
    var lp:Sprite;
    var req:String="microsites.xml";
    var pb:ProgressBar;
    var lpb:ProgressBar;
    var myVideo:FLVPlayback;

    closeBut.visible=false;

    function initiate() {
        clearBoxes();
        xmlLoader.addEventListener(Event.COMPLETE,loadMicrosites);
        xmlLoader.load(new URLRequest(req));   
    }
    initiate();

    function loadMicrosites(e:Event):void {
        xmlData=new XML(e.target.data);
        totalImages=xmlData.MICROSITE.THUMBIMAGE.length();
        startLoad();
    }

    function openInnovations(evt:Event):void {
        thumbNumber=0;
        boxNumber=1;
        thumbLoopCount=6;
        req="innovations.xml";
        initiate();
    }

    function openMicrosites(evt:Event):void {
        thumbNumber=0;
        boxNumber=1;
        thumbLoopCount=6;
        req="microsites.xml";
        initiate();
    }

    function openBanners(evt:Event):void {
        thumbNumber=0;
        boxNumber=1;
        thumbLoopCount=6;
        req="banners.xml";
        initiate();
    }

    function loadInnovation(e:Event):void {
        xmlData=new XML(e.target.data);
        totalImages=xmlData.MICROSITE.THUMBIMAGE.length();
        startLoad();
    }

    innovationsBut.addEventListener(MouseEvent.CLICK,openInnovations);
    innovationsBut.addEventListener(MouseEvent.CLICK,reduceMenuOpacity);
    micrositesBut.addEventListener(MouseEvent.CLICK,openMicrosites);
    micrositesBut.addEventListener(MouseEvent.CLICK,reduceMenuOpacity);
    bannersBut.addEventListener(MouseEvent.CLICK,openBanners);
    bannersBut.addEventListener(MouseEvent.CLICK,reduceMenuOpacity);

    function startLoad() {

        thumbLoader=new Loader();
        thumbRequest=new URLRequest(xmlData.@SMALLIMAGEPATH+xmlData.MICROSITE.THUMBIMAGE[thumbNumber].text());
        thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onThumbLoadedHandler);
        thumbLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onProgressHandler);
        thumbLoader.load(thumbRequest);
        pb = new ProgressBar();
        pb.source = thumbLoader.contentLoaderInfo;
        pb.width=this["box" + boxNumber].width;
        pb.height=this["box" + boxNumber].height;
        this["box" + boxNumber].addChild(pb);
    }

    function onProgressHandler(mProgress:ProgressEvent) {
    }

    function onThumbLoadedHandler(loadEvent:Event) {
        var sp:Sprite = new Sprite();
        sp.name = xmlData.MICROSITE.THUMBIMAGE[thumbNumber].text();
        sp.addChild(loadEvent.currentTarget.content);
        this["box" + boxNumber].addChild(sp);
        sp.addEventListener(MouseEvent.MOUSE_OVER,addTextToThumb);
        sp.addEventListener(MouseEvent.MOUSE_OUT,removeTextFromThumb);
        this["box" + boxNumber].removeChild(pb);
        thumbNumber++;
        boxNumber++;
        if (boxNumber<=thumbLoopCount) {
            startLoad();
        }
    }

    function onNextHandler(evt:Event) {
        clearBoxes();
        boxNumber=1;
        if (xmlData.MICROSITE.THUMBIMAGE.length()-thumbNumber<totalBoxes) {
            thumbLoopCount=(xmlData.MICROSITE.THUMBIMAGE.length()-thumbNumber);
            nextBut.visible=false;
        } else {
            thumbLoopCount=totalBoxes;
        }
        startLoad();
    }
    function onPrevHandler(evt:Event) {
        clearBoxes();
        boxNumber=1;
        thumbNumber=thumbNumber-thumbLoopCount-(totalBoxes);
        thumbLoopCount=totalBoxes;
        startLoad();
    }

    function clearBoxes() {
        for (var cb:int=1; cb<=6; cb++) {
            for (var cbc:int=1; cbc<this["box"+cb].numChildren; cbc++) {
                this["box" + cb].removeChildAt(cbc);
            }
        }
    }

    function nextPrevButHandler(evt:Event):void {
        if (thumbNumber<=totalBoxes) {
            if (prevBut.visible==true) {
                prevBut.visible=false;
            }
        } else {
            if (prevBut.visible==false) {
                prevBut.visible=true;
            }
        }
        if (thumbNumber>=totalImages) {
            if (nextBut.visible==true) {
                nextBut.visible=false;
            }
        } else {
            if (nextBut.visible==false) {
                nextBut.visible=true;
            }
        }
    }
    nextBut.addEventListener(MouseEvent.CLICK,onNextHandler);
    prevBut.addEventListener(MouseEvent.CLICK,onPrevHandler);
    addEventListener(Event.ENTER_FRAME,nextPrevButHandler);

    function showBigImage(evt:Event):void {
        if (xmlData.@PRODUCT=="innovations") {
            currentThumb=evt.target.name;
            MS = xmlData.MICROSITE.(THUMBIMAGE == currentThumb);
            myVideo = new FLVPlayback();
            myVideo.source=xmlData.@LARGEIMAGEPATH+MS.LARGEIMAGE.text();
            myVideo.skin="images/videos/SkinOverAll.swf";
            myVideo.skinAutoHide=true;
            myVideo.width=640;
            myVideo.height=480;
            lp = new Sprite();
            lp.name="bigImage";
            lp.addChild(myVideo);
            addChild(lp);
            var sh:int = stage.stageHeight;
            var sw:int = stage.stageWidth;
            var allInfo:TextField=new TextField();
            lp.addChild(allInfo);
            allInfo.width=640;
            allInfo.height=50;
            allInfo.background=true;
            allInfo.backgroundColor=0x000;
            allInfo.multiline=true;
            allInfo.htmlText=MS.FULLDETAILS;
            allInfo.blendMode = BlendMode.LAYER;
            allInfo.alpha=0.8;
            //allInfo.autoSize=TextFieldAutoSize.LEFT;
            var allInfoTF:TextFormat = new TextFormat();
            allInfoTF.color=0xffffff;
            allInfoTF.leading=-10;
            allInfoTF.font="arial";
            allInfoTF.size=11;
            allInfo.setTextFormat(allInfoTF);
            allInfo.y=480;
            lp.x=sw/2-(lp.width/2);
            lp.y=(sh/2)-(lp.height/2);
            closeBut.visible=true;
            closeBut.x=lp.x+(closeBut.width/2);
            closeBut.y=lp.y-(closeBut.height/2);
        } else {
            currentThumb=evt.target.name;
            MS = xmlData.MICROSITE.(THUMBIMAGE == currentThumb);
            var bigImageLoader:Loader=new Loader();
            var bigImageRequest:URLRequest=new URLRequest(xmlData.@LARGEIMAGEPATH+MS.LARGEIMAGE.text());
            bigImageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onBigImageLoaded);
            bigImageLoader.load(bigImageRequest);
            lp = new Sprite();
            lp.name="bigImage";
            addChild(lp);
            lpb=new ProgressBar();
            lpb.source=bigImageLoader.contentLoaderInfo;
            lpb.width=300;
            lpb.x=(stage.stageWidth/2)-(lpb.width/2);
            lpb.y=(stage.stageHeight/2)-(lpb.height/2);
            lp.addChild(lpb);
        }
        for(var bl:Number=1;bl<=totalBoxes;bl++)
        {
            bf=new BlurFilter(10,10,5);
            this["box"+bl].filters=[bf];
            this["box"+bl].alpha=0.3;
            this["box"+bl].removeEventListener(MouseEvent.CLICK,showBigImage);
        }
        blurElements();
    }

    function onBigImageLoaded(evt:Event):void {
       
        lp.removeChild(lpb);
        lp.addChild(evt.currentTarget.content);
        var sh:int = stage.stageHeight;
        var sw:int = stage.stageWidth;
        lp.addEventListener(MouseEvent.CLICK,openWebPage);
        var allInfo:TextField=new TextField();
        lp.addChild(allInfo);
        allInfo.width=650;
        allInfo.height=50;
        allInfo.background=true;
        allInfo.backgroundColor=0x000;
        allInfo.multiline=true;
        allInfo.htmlText=MS.FULLDETAILS;
        allInfo.blendMode = BlendMode.LAYER;
        allInfo.alpha=0.6;
        //allInfo.autoSize=TextFieldAutoSize.LEFT;
        var allInfoTF:TextFormat = new TextFormat();
        allInfoTF.color=0xffffff;
        allInfoTF.leading=-10;
        allInfoTF.font="arial";
        allInfoTF.size=11;
        allInfo.setTextFormat(allInfoTF);
        allInfo.y=530;
        lp.x=sw/2-(lp.width/2);
        lp.y=(sh/2)-(lp.height/2);
        closeBut.visible=true;
        closeBut.x=lp.x+(closeBut.width/2);
        closeBut.y=lp.y-(closeBut.height/2);
    }

    function openWebPage(evt:Event):void {
        var webUrlRequest:URLRequest = new URLRequest(MS.SITEURL.text());
        navigateToURL(webUrlRequest);
    }

    function clearBigImage(evt:Event) {
        lp.removeEventListener(MouseEvent.CLICK,openWebPage);
        for (var bi:int=1; bi<lp.numChildren; bi++) {
            lp.removeChildAt(bi);
        }
        removeChild(lp);
        for(var bl:Number=1;bl<=totalBoxes;bl++)
        {
            bf=new BlurFilter(0,0,0);
            this["box"+bl].filters=[bf];
            this["box"+bl].alpha=1;
            this["box"+bl].addEventListener(MouseEvent.CLICK,showBigImage);
        }
        if (xmlData.@PRODUCT=="innovations") {
            myVideo.stop();
        }
        showElements();
        closeBut.visible=false;
    }

    function addTextToThumb(evt:Event) {
        currentThumb=evt.target.name;
        MS = xmlData.MICROSITE.(THUMBIMAGE == currentThumb);
        var mtf:TextField=new TextField();
        evt.target.addChild(mtf);
        mtf.text=MS.DETAILS.text().toUpperCase();
        mtf.width=300;
        mtf.selectable=false;
        mtf.border=false;
        mtf.background=true;
        mtf.backgroundColor=0x000000;
        mtf.blendMode = BlendMode.LAYER;
        mtf.alpha=0.8;
        var mtfo:TextFormat=new TextFormat();
        mtfo.color = 0xffffff;
        mtfo.size=12;
        mtfo.font="arial";
        mtf.setTextFormat(mtfo);
        mtf.y=230;
        mtf.mouseEnabled=false;
    }

    function removeTextFromThumb(evt:Event) {
        evt.target.removeChildAt(1);
    }

    var toHideArray:Array =new Array("micrositesBut","innovationsBut","bannersBut","nextBut","prevBut","logo");
    var menuArray:Array =new Array("micrositesBut","innovationsBut","bannersBut");

    function reduceMenuOpacity(evt:Event):void
    {
        for(var mbm:Number=0; mbm<menuArray.length;mbm++)
        {
            this[toHideArray[mbm]].alpha=0.5;
        }
        evt.currentTarget.alpha=1;
    }


    function blurElements():void
    {
        for(var bm:Number=0; bm<toHideArray.length;bm++)
        {
            bf=new BlurFilter(10,10,5);
            this[toHideArray[bm]].filters=[bf];
            this[toHideArray[bm]].alpha=0.3;
            this[toHideArray[bm]].mouseEnabled=false;
        }
    }
    function showElements():void
    {
        for(var bm:Number=0; bm<toHideArray.length;bm++)
        {
            bf=new BlurFilter(0,0,0);
            this[toHideArray[bm]].filters=[bf];
            this[toHideArray[bm]].alpha=1;
            this[toHideArray[bm]].mouseEnabled=true;
        }
    }


    closeBut.addEventListener(MouseEvent.CLICK,clearBigImage);

    box1.addEventListener(MouseEvent.CLICK,showBigImage);
    box2.addEventListener(MouseEvent.CLICK,showBigImage);
    box3.addEventListener(MouseEvent.CLICK,showBigImage);
    box4.addEventListener(MouseEvent.CLICK,showBigImage);
    box5.addEventListener(MouseEvent.CLICK,showBigImage);
    box6.addEventListener(MouseEvent.CLICK,showBigImage);


    this is my code what it does is on clicking innovations tab it plays video from xml list

  6. #6
    Member
    Join Date
    Sep 2008
    Posts
    39

    paths

    In your xml file try using the full path instead of just the file name...

    try using instead of just example.flv try using http://something/something/example.flv

    does this make sense?

  7. #7
    Senior Member hanszorg2's Avatar
    Join Date
    Sep 2004
    Posts
    308
    Thank you Laurabeth

    Will update you if that works. Wish me luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center