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

  • SEARCH
  • Home
  • 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 8286289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:41:40+00:00 2026-06-08T11:41:40+00:00

this is a chat application in openlaszlo. i write in the inputtext area. and

  • 0

this is a chat application in openlaszlo. i write in the inputtext area. and receive the sent text in the text area. after sometime i can not see the texts in the text field. so, i want to add a scroll bar in the text area. but i cannot make it work. any ideas? thanks in advance!!

<canvas height="100%" width="100%" bgcolor="white" allowfullscreen="true" debug="true">

<class name="chatSender">
<attribute name="_netConnection" />
<attribute name="_sharedObject" />

<handler name="oninit">
this._netConnection = new NetConnection();
this._netConnection.connect("rtmp://115.187.37.167/oflaDemo/room1");

this._sharedObject = SharedObject.getRemote("chat", this._netConnection.uri, true);
this._sharedObject.connect(this._netConnection);
Debug.write("ChatSender initiated");
</handler>

<method name="sendMessage" args="mensaje">
Debug.write("SendMessage: " + mensaje )
this._sharedObject.send("messageHandler",mensaje);
</method>
</class>

<class name="chatReceiver">
<attribute name="_netConnection" />
<attribute name="_sharedObject" />

<handler name="oninit"><![CDATA[

this._netConnection = new NetConnection();
this._netConnection.connect("rtmp://115.187.37.167/oflaDemo/room1");


this._sharedObject = SharedObject.getRemote("chat", this._netConnection.uri, true);
this._sharedObject.connect(this._netConnection);


this._sharedObject.messageHandler = function(str) {

var textoAnterior = texto.text;
Debug.write( textoAnterior + "<br/>" + str);
texto.setAttribute("text", textoAnterior + "<br/>" + str);
};
Debug.write ("chatReceiver initiated");
]]>
</handler>
</class>

<chatReceiver name="chatRec"/>
<chatSender name="chatSen"/>

<simplelayout/>
<view width="100%" height="80%" bgcolor="white" clip="true">
<text id="texto" width="100%" height="90%" multiline="true" clip="true">
</text>
</view>

<view bgcolor="blue" width="70%">
<simplelayout axis="x"/>
<inputtext bgcolor="cyan" width="100%" id="mensajeAEnviar"/>
<button width="50" onclick="canvas.chatRec._cajaChat=texto; canvas.enviarTexto(mensajeAEnviar.text);">Send</button>
</view>

<method name="enviarTexto" args="texto">
Debug.write("enviarTexto:" + mensajeAEnviar.text);
canvas.chatSen.sendMessage(mensajeAEnviar.text);
mensajeAEnviar.setAttribute("text","");
</method>

</canvas>
  • 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-06-08T11:41:41+00:00Added an answer on June 8, 2026 at 11:41 am

    I’ve removed the Red5/chat specific code, to make it clear to you how you can use a scrollbar in OpenLaszlo. For the inputtext you want to scroll, don’t set a height. The parent view has to clip the content, and then when the inputtext grows in size larger than the parent view, the scrollbar will activate.

    <canvas height="100%" width="100%" bgcolor="white" allowfullscreen="true" debug="true">
    
        <method name="addLineOfText" args="line"><![CDATA[
            var newText = texto.text;
            if (newText != '')
              newText += '<br/>';
            newText += line;
            texto.setAttribute("text", newText);
        ]]>
        </method>
    
        <simplelayout/>
        <view width="200" height="150" bgcolor="#eeffee" clip="true">
            <text id="texto" width="100%" multiline="true" clip="true">
                Here are just a few lines of text for testing...<br/>
                Here are just a few lines of text for testing...<br/>
                Here are just a few lines of text for testing...<br/>
                Here are just a few lines of text for testing...<br/>
                Here are just a few lines of text for testing...
            </text>
            <scrollbar axis="y" />
        </view>
    
        <view bgcolor="blue" width="300">
            <simplelayout axis="x"/>
            <inputtext id="mensajeAEnviar"
                       bgcolor="cyan"
                       width="100%" />
            <button id="but1"
                    width="50"
                    onclick="canvas.addLineOfText(mensajeAEnviar.text)"
                    text="Send" />
        </view>
    >
    
    </canvas>
    

    Here is a blog post with more details on scrollbars in OpenLaszlo:
    http://www.antunkarlovac.com/blog/2006/11/16/using-a-scrollbar/

    I’ve tested this code with OpenLaszlo 5.0 (trunk) in both SWF10 and DHTML runtime.

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

Sidebar

Related Questions

can somebody please tell me where i m wrong why this RMI chat application
I am developing chat application using xmpp client. I can send and receive message
I am creating a chat application. In this chat application, I have to use
For a simple chat application, I thought of using this simple layout: *----------------------------------* |<div>
I'm folowing this tutorial to create php/jquery based chat application. In short, this code
i'm building an android application which have a chat. in this chat i each
I'll try to explain this with an example. I'm writing a chat application. There
i did one chat application , in the my chat pings area am displaying
I making a simple chat application, and I need to write a claas that
I write a little Chat Application. To save some infos like Username and Password

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.