How could I write this code?

I am trying to create a shared object that will host a chat
room environment. I will have many of these rooms and I know what I
want to do, just not how to write it in actionscript or if it is
even possible. the underlined portion is what i just don't know how
to code (
(room + roomNumber + _so) ) as it should throught usage
equate to something like
room1_so,
room2_so,
room3_so, and so on. any help would be greatly appreciated.
thanks in advance.
function doJoin(roomNumber) {
(room + roomNumber + _so) = SharedObject.getRemote(
(room + roomNumber + _so) ,_root.clientroom_nc.uri,true);
if(
(room + roomNumber + _so) ).data.seat1 = occupied) {
do this;
}

its actually connecting to flash media server remote shared
object as opposed to the local shared object. The code in question
was actually taken nearly word for word from the macromedia sample
file so I know that that portion is correct.
If I replace the shared object name from
tl["room"+roomNumber+"_so"].connect(_root.clientroom_nc);
and change it to
room1_so.connect(_root.clientroom_nc);
everything works fine and the connection is succesful,
however since I hope to have many many rooms that is just not a
feasible way to write it. I have racked my brain trying to think of
an alternative way of writing it but have come up with nothing. I
am well versed in Basic, PHP, and some C, but this damn
actionscript stuff is throwing me for a loop since it is incredibly
different in a lot of ways.

Similar Messages

  • How could I fix this code

    Hii 2 all
    How could I change this statement for parameters list,, so the client_name can contain spaces ??
    add_parameter(p_id,'p_client_name',TEXT_PARAMETER, '''' || :cntrl.client_name || '''');
    cause it couldn't print and give syntax error when the :cntrl.client_name contains any spaces !!!!
    please help
    thanks:)

    First I must apologize, I asked you to test something that was not needed... for a moment I thought we were talking about web.show_document, that's why I asked you to test with double-quotes..
    Regarding your problem, Manu is right, there is not need to wrap around the parameter in quotes..
    add_parameter(p_id,'p_client_name',TEXT_PARAMETER, :cntrl.client_name);I have to ask you the same question that Manu asked you before, where are you using this parameter?
    In your Report you must be using in a piece of PL/SQL code, we need you to post that code...
    Edited by: Rodolfo Ferrari on Sep 10, 2009 4:44 PM

  • How could I write this in java

    I have to use a parameter in a statement. I am trying but its giving error. I am trying to write it like ....
    fw.write("Object     dir/my.dat\n");I substitute my.dat with a variable dat & write like
    fw.write("Object     dir/+"dat"+\n");dat is a String variable.

    Sam_Fin wrote:
    thanks,welcome
    How could I remove this error.
    Unreported exception java.io.IOException; must be caught or declared to be thrown fw.write("#the number of patterns to be recognized\n");
    Its for every fw.write statement.read the Sun (Oracle?) [tutorial on exceptions,|http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html] and then either throw the exception or wrap in a try / catch block (the tutorial will explain how).

  • How could u write this application?

    write an application to read an unknown number of integer pairs representing binary numbers from a file redirected input from the command line. do not use sentinel value or prompt.
    1. Echo print in colums 1 and 2 the numbers that were read.
    2. Convert each number to decimal for columns 3 and 4.
    3. Count the number of 1's in the numbers for columns 5 and 6.
    4. Find the larger of the decimal versions of the first and second number of each integer pair, and print that number in column 7.
    5. Keep separate cumulative sum of the decimal versions of the first and second number of each integer pair, and print that number below the appropriate column after all numbers have been read.
    Sample output:
    10 11 101 1111 111 10000 101011 0
    thanks for your interest

    > hey young fella, its not a HW or something!! everyone
    talks alot here like they know everthing(which they
    aint gotta clue), i decided to put an easy
    application to c how many people are going to be able
    to write this application??
    That's a little tough to believe. It's far more likely that you need some help on figuring out how to go about writing such an application. There's nothing wrong with that; just know that most folks who volunteer to help here aren't particularly interested in "proving their skills" by way of programming "challenges". They typically get far more satisfaction by helping others learn Java.
    i guess u r one those fellas who dont have a clue about java!!! b/c if u
    were not, this would take ur 5-6 mins of time..
    So, do you have a specific question regarding those requirements? If you do, please ask. If, on the off chance you've got some special insight regarding an implementation, post your idea and get some feedback from the community.
    Also, please make the extra effort to write out words such as "see", "you", "are", "your", and "because". The extra keystrokes won't cost much in the way of time, and the enhanced clarity will be appreciated by those communicating on a forum with international readership. Also, it will give the appearance that you take your question seriously, which will in turn make your question look more interesting to answer.
    Thanks!
    ~

  • How to write this code ?

    I need to write 3 classes that each one can get to the other with the same instance of the class , so how do i write this code ?
    thanks a lot

    try out singleton pattern with all the three classes. following link may help...
    http://www.javareference.com/jrexamples/viewexample.jsp?id=25

  • How do I write this as a loop?

    How do I write this code to function as follows.
    When btn1 is clicked, SenderLoad should be "clay" AND when btn2 is clicked, SenderLoad should be "iron", etc...
    var mgB:Array = [btn1, btn2, btn3, btn4];
    var mgBW:Array = ["clay", "iron", "cotton", "leather"];
    var SenderLoad:LoadVars = new LoadVars();
    var ReceLoad:LoadVars = new LoadVars();
    var mgNum:Number=0;
    for (i=0; i<mgBW.length ; i++){
    mgBW[i].onRelease = function () {
    mgNum++
    SenderLoad.word = mgB[mgNum];
    SenderLoad.sendAndLoad("http://www.web.com/my.php",ReceLoad,"POST");
    ReceLoad.onData = function(src) {
    var messageA:Array = src.split(",,,");
    ldrB2.html=true;
    for(var i:Number=0; i<messageA.length; i++){
               var a:Array=messageA[i].split(",,");
       ldrB1.htmlText +=a[0];
       ldrB2.htmlText +=a[1];

    if you want different words in different colors you can use:
    ldrB1.html=true;
    ldrB1.text = formatF("REJECT",0xff0000,ldrB1)
    ldrB1.text = formatF("ACCEPT",0x000000,ldrB1);
    ldrB1.text = "formatF("BANNED",0xc0c0c0,ldrB1);
    function formatF(s:String, col:Number, tf:TextField):Void {
    if(tf.text.indexOf(s)==-1){
    return;
        tfor.color = col;
        var startindex:Number = 0;
        while (startindex>-1 && startindex<tf.text.length-1) {
            var bindex:Number = tf.text.indexOf(s, startindex);
            var eindex:Number = bindex+s.length;
            tf.setTextFormat(bindex,eindex,tfor);
            startindex = eindex;
    var tfor:TextFormat = new TextFormat();

  • I lost my redemption code to install Lion onto my new computer. Is there a way I could get it again? When I go to the "get the update" page, it says that my serial number already has a code. How do I find this code again?!

    I lost my redemption code to install Lion onto my new computer. Is there a way I could get it again? When I go to the "get the update" page, it says that my serial number already has a code. How do I find this code again?!

    It is probably broken. You can try restoring it using Recovery Mode, but if that fails its time for a new phone. After all, it is 4 generations out of date. See: Recovery Mode

  • How can I write HTML code in this forums

    Sorry but I didn't know where to post this thread.....
    How can I write HTML code in this forums?

    Hello,
    Every piece of code in your post should be wrapped with the forum tags [ code] and [ /code], without the blanks.
    In case of the &lt;a> tag, that is not enough. In this case, you have several options. The most elegant one is to use the entity name for the less-then sign - & lt; - without any spaces. Other options is to add a space between the less-then and the ‘a’ character (and make a note of it) or change the less-then character with a left bracket one.
    When posting code, you should always use the forum preview option, just to make sure the forum software “understood” your code correctly.
    Hope this helps,
    Arie.

  • How can i write this C-Code in G-Code

    hallo
    how can I write this C-Code in LabVIew ,
    for a=0; a=<10; a++
       for b=0; b=5 ; b+2
            X= 3+b;
      Y=1+a;
    please see the attachment and tell me where is the problem
    Attachments:
    Unbenannt 11.vi ‏43 KB

    Well, at least you tried and got some of it right.
    I think this should do what you want, but my C is rusty. Is the increment performed before or after the loop executes? If it's after, then I believe the loop should iterate 11 times, not 10.
    In any case, you should note that for a literal translation, you would need to add a sequence structure to guarantee that Y was written to only after the inner loop finished because of the way data-flow works.. Also, note that controls and indicators in LabVIEW are not equivalent to variables. They can be used as such, but they usually should not be.
    Another point about this is that you probably want to use the correct data type - the orange terminals are floating point indicators (of double precision, in this case) and you want integers.
    To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
    Try to take over the world!
    Attachments:
    C.png ‏4 KB

  • How can i write a code to get sume of value from days.

    Hi,
    how can i write a code to get the sum of value of days(example 1 to 30).
    This is in BPS ...
    i created multi planning area and creted planning function with {keyfigure name,planning area,days}.
    now i want to read all the actual values  from basic planing area(basic cube) and calculate the sum of the value.if you have idea can you share the code.
    ENTRIES = VARC ( 'zvardays' ).     ex(zvardays like 28 days or 29 days or 30 days or 31 days)
    COUNT = ENTRIES.
    *Get the all the days value from actual
    FOREACH PAREA = 'basic planning area'.
      COUNT = 1.
    DO
         SUM = SUM + {amount, count}      (amount is a keyfirgure value)
    ENDDO.
    COUNT = COUNT+1.
       SUMACT =  SUM.
    ENDFOR.
    can you correct the above code ....to read the values and sum of the those value.
    Thanks...

    Hi ..
    That is ok..
    Can you provide sample code for my requirement..
    and also how can i pass the error message (can you help me syntax )
    and if my acutal-total  is not equal to plan-total  then
    i have to pass the error message and then  i have to restrict save the data  how i can i restrict(user can not save the data until the values should be equal) .
    Can you help me it is very urgent..
    thanks.//
    Edited by: Eyda rose on Jun 4, 2008 9:29 PM

  • How can i know how to redeem the code? how can i get this code?

    how can i know how to redeem the code? how can i get this code? please i need you help
    <Email Edited by Host>

    You are trying to create a new Apple ID? You don't have one yet? Is that correct?
    If so, then see this article on how to creat your Apple ID - and make up a password for it. Remember to write it down immediately.
    http://support.apple.com/en-us/HT203993

  • How can I write this short/simple bit of php so it will work?

    Hello!
    I have this code in template.php...
    <?php @ require_once ("$pagename.php"); ?>
    ...to bring content into the template.
    I've got a folder called 'news' for all the news articles so
    how could I edit the code to say 'look for files in the news folder
    as well as the current folder'?
    I guess I would need something like:
    <?php @ require_once ("$pagename.php" or
    "news/$pagename.php"); ?>
    ...but that doesn't work. How would I change it to work?
    Thank you very much and hope to hear from you.
    Mark

    You would need to use the "or" operator in PHP. I'm not too
    sure if that
    will work or not but you can give it a go - I'm currently at
    work now, so I
    can't really test anything at this moment in time.
    This is the operator for "or" in PHP: ||
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    ===============================
    Proud GAWDS Member
    http://www.gawds.org
    Delivering accessible websites to all...
    ===============================
    "Spindrift" <[email protected]> wrote in
    message
    news:e5fhh5$sgv$[email protected]..
    > Hello!
    >
    > I have this code in template.php...
    >
    > <?php @ require_once ("$pagename.php"); ?>
    >
    > ...to bring content into the template.
    >
    > I've got a folder called 'news' for all the news
    articles so how could I
    > edit
    > the code to say 'look for files in the news folder as
    well as the current
    > folder'?
    >
    > I guess I would need something like:
    >
    > <?php @ require_once ("$pagename.php" or
    "news/$pagename.php"); ?>
    >
    > ...but that doesn't work. How would I change it to work?
    >
    > Thank you very much and hope to hear from you.
    >
    > Mark
    >

  • How can i rewrite this code into java?

    How can i rewrite this code into a java that has a return value?
    this code is written in vb6
    Private Function IsOdd(pintNumberIn) As Boolean
        If (pintNumberIn Mod 2) = 0 Then
            IsOdd = False
        Else
            IsOdd = True
        End If
    End Function   
    Private Sub cmdTryIt_Click()
              Dim intNumIn  As Integer
              Dim blnNumIsOdd     As Boolean
              intNumIn = Val(InputBox("Enter a number:", "IsOdd Test"))
              blnNumIsOdd = IsOdd(intNumIn)
              If blnNumIsOdd Then
           Print "The number that you entered is odd."
        Else
           Print "The number that you entered is not odd."
        End If
    End Sub

    873221 wrote:
    I'm sorry I'am New to Java.Are you new to communication? You don't have to know anything at all about Java to know that "I have an error," doesn't say anything useful.
    I'm just trying to get you to think about what your post actually says, and what others will take from it.
    what does this error mean? what code should i replace and add? thanks for all response
    C:\EvenOdd.java:31: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=true;
    ^
    C:\EvenOdd.java:35: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=false;
    ^
    2 errors
    Telling you "what code to change it to" will not help you at all. You need to learn Java, read the error message, and think about what it says.
    It's telling you exactly what is wrong. At line 31 of EvenOdd.java, you're calling isOdd(), with no arguments, but the isOdd() method requires an int argument. If you stop ant think about it, that should make perfect sense. How can you ask "is it odd?" without specifying what "it" is?
    So what is this all about? Is this homework? You googled for even odd, found a solution in some other language, and now you're just trying to translate it to Java rather than actually learning Java well enough to simply write this trivial code yourself?

  • Who can help me? write this code?

    Write java code print prime number like this
    Sample Screen Print:
    Initial matrix with N = 37
    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
    Intermediate results (after 1st iteration)
    2 3 5 7 9
    11 13 15 17 19
    21 23 25 27 29
    31 33 35 37
    Intermediate results (after 2nd iteration)
    2 3 5 7
    11 13 17 19
    23 25 29
    31 35 37
    Intermediate results (after 7th iteration)
    2 3 5 7
    11 13 17 19
    23 29
    31 37
    Final results
    2 3 5 7 11 13 17 19 23 29
    31 37
    How to write this code ?
    Please Help me!
    Thank you so muchhh ?????

    Looks like The Sieve of Eratosthenes.
    A google search for that should help you with some logic.
    Wikipedia has a really nice animation of how it works.
    Post back when you have some source code that you need help with.
    Thanks k???? lullzz???

  • HT1926 when trying to setup itunes on my pc i get the following message: there is a problem with this Windows installer package. A program required for this install to complete could not be run. How could I solve this problem?

    when trying to setup itunes on my pc i get the following message: there is a problem with this Windows installer package. A program required for this install to complete could not be run. How could I solve this problem?

    Repair your Apple software update.
    Go to START/ALL PROGRAMS/Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install
    If you don't find ASU, go to Control Panel:
    START/CONTROL PANEL/Programs n Features/highlight ASU and click REPAIR,

Maybe you are looking for