Professional Web Applications Themes

Newbie Stupid Problem - Macromedia Flash Flashcom

Hi All, I'm an expirienced developer in Flash, but recently I was forced to deal with Flash Media Server. I'm quite excited but I have one really stupid question: I want to have an application which will call client's function and pass a parameter to it. Any replies are warmly welcome! Here is what I have : // APPLICATION application.onAppStart = function() { trace("onAppStart> " + application.name + " is starting at " + new Date()); } application.onConnect =function(clientObj,userName, password){ trace("we are connected"); application.acceptConnection(clientObj); //setting parametter to the client clientObj.RedirectURL="rtmp:/appName/tesgin_new_instance"; clientObj.call("testFunction"); }; // END OF APPLICATION // CLIENT ACTIONSCRIPT // ...

  1. #1

    Default Newbie Stupid Problem

    Hi All,

    I'm an expirienced developer in Flash, but recently I was forced to deal
    with Flash Media Server.
    I'm quite excited but I have one really stupid question:

    I want to have an application which will call client's function and pass a
    parameter to it.

    Any replies are warmly welcome!

    Here is what I have :

    // APPLICATION
    application.onAppStart = function() {
    trace("onAppStart> " + application.name + " is starting at " + new
    Date());
    }


    application.onConnect =function(clientObj,userName, password){
    trace("we are connected");
    application.acceptConnection(clientObj);

    //setting parametter to the client
    clientObj.RedirectURL="rtmp:/appName/tesgin_new_instance";
    clientObj.call("testFunction");
    };

    // END OF APPLICATION


    // CLIENT ACTIONSCRIPT


    // First, make sure an onStatus
    NetConnection.prototype.onStatus = function(info){
    trace("NetConnection STATUS: " + info.code);
    }


    nc =new NetConnection();

    nc.testFunction = function(){
    trace("testFunction -> nc.RedirectURL: "+this.RedirectURL);
    }


    if ( nc.connect("rtmp:/appName/") ){
    trace("Attempting connection...");
    } else {
    trace("Can't attempt connection. Is the URI correct?");
    }

    // END OF CLIENT ACTIONSCRIPT

    PROBLEM DESCRIPTION:
    Cannot find the nc.RedirectURL parametter from the nc object.
    Its undefined.
    I've tried it with a parametter on the testFunction and display it.. along
    with clientObj.call("testFunction","redirTest");
    And its still not returing this string.

    Please whats the problem with this code ???


    Ender.bg Guest

  2. #2

    Default Re: Newbie Stupid Problem

    Use clientObj.call("testFunction",null,"redirTest"); in the server side code.
    The second parameter is the name of the callback function, which in your case
    is not there.

    Client Side
    nc.testFunction = function(str){
    trace("testFunction -> nc.RedirectURL: "+str);
    }
    I will suggest that you go through some of the basic syntax of FMS:)

    Tarun

    tarungupta Guest

  3. #3

    Default Re: Newbie Stupid Problem

    Thanks Tarun,

    This really works.

    Thanks for the help,
    Martin

    "tarungupta" <webforumsusermacromedia.com> wrote in message
    news:eg89la$ogg$1forums.macromedia.com...
    > Use clientObj.call("testFunction",null,"redirTest"); in the server side
    > code.
    > The second parameter is the name of the callback function, which in your
    > case
    > is not there.
    >
    > Client Side
    > nc.testFunction = function(str){
    > trace("testFunction -> nc.RedirectURL: "+str);
    > }
    > I will suggest that you go through some of the basic syntax of FMS:)
    >
    > Tarun
    >
    >

    Ender.bg Guest

Similar Threads

  1. Stupid Newbie need help
    By hisheirs in forum Macromedia Flash Flashcom
    Replies: 5
    Last Post: June 13th, 04:29 PM
  2. newbie problem
    By Karzy in forum ASP.NET Building Controls
    Replies: 5
    Last Post: June 26th, 04:31 AM
  3. newbie has a problem...please help me out
    By Timon in forum FileMaker
    Replies: 1
    Last Post: September 17th, 11:55 AM
  4. Stupid newbie question re website hit counting
    By Michael McLaughlin in forum PERL Miscellaneous
    Replies: 3
    Last Post: July 22nd, 11:42 PM
  5. newbie php problem
    By Matt in forum PHP Development
    Replies: 1
    Last Post: July 19th, 06:52 AM

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