Professional Web Applications Themes

FCS connect - Macromedia Flash Flashcom

Hi Guys, I have a little issue with my connection. i am running my CCTV through my FlashComm Server and I have to start my broadcast manually. if the server goes down then i have to go back to the location where my CCTV is and re-start my broadcast it can be quite a pain. What I would like to know is how to check for the connection to the server and if it is down auto reconnect. Any ideas welcome. Thanks in advance....

  1. #1

    Default FCS connect

    Hi Guys,

    I have a little issue with my connection.
    i am running my CCTV through my FlashComm Server and I have to start my
    broadcast manually.
    if the server goes down then i have to go back to the location where my CCTV
    is and re-start my broadcast it can be quite a pain.

    What I would like to know is how to check for the connection to the server and
    if it is down auto reconnect.

    Any ideas welcome.

    Thanks in advance.

    ActionScripter1 Guest

  2. #2

    Default Re: FCS connect

    You would handle that in the client side onStatus event for the netconnection

    nc.onstatus=function(info){
    if (info.code == "NetConnection.Connect.Closed"){
    //code to reconnect here
    }
    if (info.code == "NetConnection.Connect.Failed"){
    //code to reconnect here
    }
    if (info.code == "NetConnection.Connect.Rejected"){
    //code to reconnect here
    }
    }

    Keep in mind that this will cause the player to continuously attempt
    connections when there isn't one, so you might want to set up some other
    conditions to limit the number of attempts.

    See the docs for the netconnection onstatus event for more info.



    JayCharles Guest

  3. #3

    Default Re: FCS connect

    Thanks for that, it will be a great help.

    Now that I have added this code i seem to be having a little problem
    connecting.

    here is what I have upto now

    mycam = Camera.get();
    mycam.setQuality(25600, 0);
    mymic = Microphone.get();
    mymic.setRate(11);
    ns.attachVideo(mycam);
    ns.attachAudio(mymic);
    myvid.attachVideo(mycam);
    nc = new NetConnection();
    nc.onStatus = function(info) {
    if (info.code == "NetConnection.Connect.Success") {
    createNetStream(this);
    }
    }
    nc.connect(_root.rtmp_txt.text);
    ns.publish(_root.streamname_txt.text, "live");
    createNetStream = function(nc){
    ns = new NetStream(nc);
    ns.onStatus = function(info) {
    if (info.code == "NetConnection.Connect.Closed"){
    nc.connect(_root.rtmp_txt.text);
    ns.publish(_root.streamname_txt.text, "live");
    }
    if (info.code == "NetConnection.Connect.Failed"){
    nc.connect(_root.rtmp_txt.text);
    ns.publish(_root.streamname_txt.text, "live");
    }
    if (info.code == "NetConnection.Connect.Rejected"){
    nc.connect(_root.rtmp_txt.text);
    ns.publish(_root.streamname_txt.text, "live");
    }
    }
    mycam = Camera.get();
    mycam.setQuality(25600, 0);
    mymic = Microphone.get();
    mymic.setRate(11);
    ns.attachVideo(mycam);
    ns.attachAudio(mymic);
    myvid.attachVideo(mycam);
    }

    I am not too good at all this so if you can see where I am going wrong I would
    appreciate any more help.

    thanks in advance.

    ActionScripter1 Guest

Similar Threads

  1. connect to SQL
    By boato in forum Coldfusion Database Access
    Replies: 5
    Last Post: March 13th, 01:32 PM
  2. How to use “RDS.Connect” to connect to a MS Access database?
    By hannaman@msn.com in forum ASP Database
    Replies: 0
    Last Post: August 2nd, 11:09 PM
  3. Connect to IDS 9.4 with 16 bit BDE
    By Yves Glodt in forum Informix
    Replies: 1
    Last Post: September 4th, 12:52 PM
  4. Cannot connect to db
    By dj Bass in forum ASP.NET Security
    Replies: 9
    Last Post: July 16th, 07:11 PM
  5. Can't Connect to PC on LAN
    By Robert L [MS-MVP] in forum Windows Networking
    Replies: 0
    Last Post: July 13th, 06:40 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139