Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 199815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:03:23+00:00 2026-05-11T17:03:23+00:00

The following code is a combination of samples taken from red5. Basically I am

  • 0

The following code is a combination of samples taken from red5. Basically I am trying to combine a live stream subscriber with a chat box based on shared objects. I’m not a flash developer and have a very limited understanding of what is going on here.

// ** AUTO-UI IMPORT STATEMENTS **
import org.red5.utils.Connector;
import org.red5.samples.simplechat.BasicChat;
// ** END AUTO-UI IMPORT STATEMENTS **
import com.neoarchaic.ui.Tooltip;
import org.red5.net.Stream;
//import org.red5.utils.Delegate;
import com.blitzagency.xray.util.XrayLoader;

class org.red5.samples.livestream.subscriber.Main extends MovieClip {
// Constants:
    public static var CLASS_REF = org.red5.samples.livestream.subscriber.Main;
    public static var LINKAGE_ID:String =     "org.red5.samples.livestream.subscriber.Main";
// Public Properties:
// Private Properties:
private var stream:Stream;
private var cam:Camera;
// UI Elements:

// ** AUTO-UI ELEMENTS **
    private var connector:Connector;
    private var publish_video:Video;
    private var chat:BasicChat;
// ** END AUTO-UI ELEMENTS **
    private var uri:String = "rtmpt://localhost/oflaDemo";

// Initialization:
    private function Main() {XrayLoader.loadConnector("xray.swf");}
    private function onLoad():Void { configUI(); }

// Public Methods:
// Semi-Private Methods:
// Private Methods:
    private function configUI():Void 
    {
        // setup the tooltip defaults
    Tooltip.options = {size:10, font:"_sans", corner:0};
    // setup cam
    cam = Camera.get();
    // get notified of connection changes
    connector.addEventListener("connectionChange", this);

    // set the uri
    Connector.red5URI = uri;

    // initialize the connector
    connector.configUI();
    connector.makeConnection();
}

private function connectionChange(evtObj:Object):Void
{       

    if(evtObj.connected) 
    {
        // setup stream
        // XXX: odd hack needed for flashIDE.
        var conn = evtObj.connection; 
        var x = new Stream(conn);
        stream = x;
        stream.play("red5StreamDemo", -1);
        publish_video.attachVideo(stream);
        trace(chat);
        // register the NetConnection that GlobalObject will need
        chat.registerConnection(conn);

        // connect the shared object
        chat.connectSO();
    }
}

}

I don’t think that var chat is being initialized anywhere as trace(chat) prints ‘undefined’. However var connector and var publish_video seem to collect their instances from the stage.

This sample code included those two and worked fine, but I can’t make my additions behave the same way.

I have added an instance of BasicChat to the stage (I’m using Flash CS4) and have spent the past many hours playing with it’s various properties, layers and groupings, but to no avail.

Can anyone suggest why my var chat isn’t collecting its instance from the stage?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:03:23+00:00Added an answer on May 11, 2026 at 5:03 pm

    Have you set the instance name of your BasicChat stage instance? It should be set to “chat”. To set it, click the stage instance and find the instance name field in the Properties panel (first/top visible field).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to download attachments from Gmail, using a combination of pieces of code
The following code should find the appropriate project tag and remove it from the
I am trying to compile following code in C#: String[] words = {Hello, Worlds};
I am trying to port some C++ code from Windows to Solaris(Unix). There are
I am trying to integrate the following code into my project. it is held
I get the following compilation error with the following source code: Compilation Error: Type
I get the following compilation error: error: expected `;' before 'it' Here's my code:
Following code, when compiled and run with g++, prints '1' twice, whereas I expect
The following code works great in IE, but not in FF or Safari. I
The following code doesn't compile with gcc, but does with Visual Studio: template <typename

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.