# Wowza/Flex AV Chat example

**URL:** <https://community.wowza.com/t/wowza-flex-av-chat-example/234>\
**Category:** Wowza Developer Dojo\
**Created:** [August 15, 2008, 9:10pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234 "2008-08-15T21:10:32Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [April 17, 2010, 9:56pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/21 "2010-04-17T21:56:44Z")

</div>

Sounds like there is an issue with the client-side sync method.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 23, 2010, 9:52pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/22 "2010-07-23T21:52:17Z")

</div>

I don’t think you will be able to do that, because there are sharedObjects and the many to many audio/video streaming.

You could have an application where users watched a live video on one netconnection from edge servers, and synced with sharedObjects using another netconnection connected to a dedicated sharedObject server. But many to many chat, everyone has to connected to the same server, application and application instance per session.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [August 18, 2010, 8:01pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/23 "2010-08-18T20:01:23Z")

</div>

If you connect like this, with a username:

```auto
netconnection.connect("rtmp://[wowza-address]:1935/[appName] "richard");

```

You can extract the username and attach it to the client in a property, like this:

```auto
package com.wowza.wms.example.module;
import com.wowza.wms.amf.*;
import com.wowza.wms.client.*;
import com.wowza.wms.module.*;
import com.wowza.wms.request.*;
public class ModuleTrackUserData extends ModuleBase {
	
	public void onConnect(IClient client, RequestFunction function,
			AMFDataList params) {
		getLogger().info("onConnect: " + client.getClientId());		
		String user = getParamString(params, PARAM1);
		client.getProperties().setProperty("username", user);
	}
	public void onConnectAccept(IClient client) {
		String username = client.getProperties().getPropertyStr("username");
		getLogger().info("onConnectAccept username: " + username + " ID: " + client.getClientId());
		
	}
}

```

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [August 19, 2010, 2:46pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/24 "2010-08-19T14:46:31Z")

</div>

Take a look at this Flex example that does that:

[http://community.wowza.com/t/-/234](http://community.wowza.com/t/-/234)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [August 19, 2010, 2:47pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/25 "2010-08-19T14:47:40Z")

</div>

Oh, sorry, that’s the thread we are in. I’m not sure what to tell you. These are the examples we have. You have to work with this.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [August 19, 2010, 8:00pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/26 "2010-08-19T20:00:03Z")

</div>

No, it’s not doing that. As you can see, the Flash interface has no input for username. On the server-side, clients are distinguished by clientid, the identifier generated by Wowza. You have to modify the Flash interface to accept a username, and the server-side to use it like the example I showed earlier.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [March 21, 2011, 5:00pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/27 "2011-03-21T17:00:10Z")

</div>

The path has changed, but functionally TEA.as is the same. You just have to reconcile the path. You can change it in Flex if you are building the source. Or change it i TEA.as, change this to old path:

```auto
package com.wowza.encryptionAS3 {

```

And you have to change the folder structure to match.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [April 21, 2011, 2:57pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/28 "2011-04-21T14:57:35Z")

</div>

This is a Flex (SDK 3.5) application. The source is [here](http://dotnet.lakesidetechnical.com/wowza/avchat/avchat.zip)

Flex (Flash Builder) uses text files with .as and .mxml extensions for source code. There is no .fla

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [April 26, 2011, 11:58pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/29 "2011-04-26T23:58:16Z")

</div>

You will have to learn how to use Flex.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 5, 2011, 6:02pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/30 "2011-05-05T18:02:18Z")

</div>

I updated this. Re-download the [source](http://dotnet.lakesidetechnical.com/wowza/avchat/avchat.zip)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 12, 2011, 4:58pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/31 "2011-05-12T16:58:23Z")

</div>

Here is Flex version of Wowza TextChat. You can put together easily:

[https://www.wowza.com/forums/showthread.php?1480-textchat-with-Flex#4](https://www.wowza.com/forums/showthread.php?1480-textchat-with-Flex#4)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 13, 2011, 2:55pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/32 "2011-05-13T14:55:08Z")

</div>

Do you want a Flex developer to help with this? We have a list of independent consultants. Send email to support@wowza.com to request if you do.

Combining these two examples should be fairly easy.You could use two NetConnections if that makes it easier.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 25, 2011, 10:17pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/33 "2011-05-25T22:17:13Z")

</div>

I appended clientID in that simple example to avoid name collisions or having a real authentication system. It’s a fairly accessible example, good starting place for Flex and Wowza.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 18, 2011, 2:52pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/34 "2011-07-18T14:52:08Z")

</div>

This example includes a jar file that needs to be copied to Wowza /lib folder, then Wowza must be restarted.

If you running Wowza as a server, stop the service then run Wowza in stand-alone mode: /bin/startup.bat, so you can see Wowza log output while you test. It is very helpful.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 19, 2011, 5:02pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/35 "2011-07-19T17:02:21Z")

</div>

Removed, posted to wrong thread.

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 19, 2011, 8:34pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/36 "2011-07-19T20:34:32Z")

</div>

Previous post was to wrong thread.

This is the issue:

> ERROR server comment - loadModFunctions: java.lang.ClassNotFoundException: com.w
> 
> owza.wms.example.module.AVChat

This means the jar is not in the Wowza lib folder or you didn’t restart Wowza after adding it.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 28, 2011, 11:14am UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/37 "2011-07-28T11:14:04Z")

</div>

You can ignore those Warnings. Or change to:

```auto
for (var p:Number = n-1; p >= 0; p--) 

```

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 29, 2012, 2:17pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/38 "2012-02-29T14:17:16Z")

</div>

Yes, it is at least 75% the VideoChat example that ships with Wowza. Please trace these functions to see what they do. It’s a starting place.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [March 12, 2012, 8:07pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/39 "2012-03-12T20:07:57Z")

</div>

Try setting the project to use SDK 3.5 in the Project Properties, Actionscript Compiler tab.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [June 28, 2012, 2:26pm UTC](https://community.wowza.com/t/wowza-flex-av-chat-example/234/40 "2012-06-28T14:26:37Z")

</div>

There is a .jar file included with this example. Make sure you have have copied that to your Wowza /lib folder, and added the Module to the Application.xml, and re-started Wowza. Then each user should see the stream the other has published.

Richard

[Previous page](https://community.wowza.com/t/wowza-flex-av-chat-example/234.md?page=1)

[Next page](https://community.wowza.com/t/wowza-flex-av-chat-example/234.md?page=3)
