Skip to main content
Participant
Nov 3, 2006 3:28 PM UTC
Question

Dynamically create AVPresence

Hey gang,

I am trying to dynamically create AVPresence instances as people log into the server on each client. Basically trying to re-implement the VideoConference component.

Unfortunately when I try and create 2 AVPresence it seems they override each other even if I use different X/Y positions and use seperate Instance names and setUsername().

If someone could spot out my error that would be great.
This is what I am doing:

var instanceName = "presence_" + username;
_root.attachMovie("FCAVPresenceSymbol", instanceName, 1, {_x:150, _y:150});
_root[instanceName].setUsername(username);
_root[instanceName].connect(connection);

Any help please?
    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    DuderrAuthor
    Participant
    Nov 3, 2006 9:20 PM UTC
    Thanks so much for the reply!

    I did not know you couldn't use a depth twice. What if the X/Y is totally different though?

    Also I started incrementing the depth, the new AVPresence appears, but then dissapears right away. I only get to see the video its streaming for a quick second then its gone again.

    I am doing this in a button click event, is that a problem? Do I have to instanciate this into an array of AVPresence outside of the button event?

    Thanks so much.
    Translate
    Nov 3, 2006 6:34 PM UTC
    Not sure without seeing the rest of your code, but something in the attachMovie argument looks to be a likely culprit.

    In this line:

    _root.attachMovie("FCAVPresenceSymbol", instanceName, 1, {_x:150, _y:150});

    You're defining the depth as 1. If there is already an object at that depth (like another avpresence), it gets removed from the stage.

    Try incrementing the depth.
    Translate