Displaying text dynamically

Hi
I want to display text dynamically on the stage
e.g
When I click mouse first time its should display " this is
the first click" and second time " this is the second clik" and so
on.
Can someone help me with the code here.

Hi Sarawinder,
Depending on which ActionScript version you're using the
code will
differ. For ActionScript 2.0, it will look something like
this:
_root.createTextField('mouseText',_root.getNextHighestDepth,0,0,100,20);
_root.mouseText.autoSize='left';
_root.clickCounter=0;
Mouse.addListener(this);
function onMouseDown() {
switch (_root.clickCounter) {
case 1 : _root.mouseText.text="this is the first click";
break;
case 2 : _root.mouseText.text="this is the second click";
break;
case 3 : _root.mouseText.text="this is the third click";
break;
_root.clickCounter++;
For ActionScript 3.0, there's more possibility of mucking
things up.
More power=more opportunity for errors. But if you feel you
have enough
experience then give it a try. Here's the same code for Flash
CS3:
import flash.text.*;
import flash.events.*;
var mouseText:TextField=new TextField();
mouseText.autoSize='left';
this.addChild(mouseText);
var clickCounter:uint=0;
stage.addEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown);
function onMouseDown(eventObj:MouseEvent) {
switch (_this.clickCounter) {
case 1 : this.mouseText.text="this is the first click";
break;
case 2 : this.mouseText.text="this is the second click";
break;
case 3 : this.mouseText.text="this is the third click";
break;
this.clickCounter++;
}//onMouseDown
Good luck,
Patrick
http://www.baynewmedia.com
Faster, easier, better...ActionScript development taken to
new heights.
Download the BNMAPI today. You'll wonder how you ever did
without it!
Available for ActionScript 2.0/3.0.
Sarawinder wrote:
> Hi
>
> I want to display text dynamically on the stage
>
> e.g
>
> When I click mouse first time its should display " this
is the first click"
> and second time " this is the second clik" and so on.
>
> Can someone help me with the code here.
>
>
>

Similar Messages

  • How to display text dynamically

    hello,
                                  i am working in dialog programing i need to display text which is save in a file and i want that whenever each new call screen i should display a text message from my flat file on the new screen ..... is there is a funda of xml?

    If the text is same for all the screens then copy it into a string or variable type c and write it on all the screens

  • How to display the dynamic text in the selection screen

    Hi All,
    I want to display the dynamic text in the selection screen .... ( I searched in forums , didnt get the any answer fot this sort of qustion ).....
    EX: If i have the date of today 31st  it has to show message like " today date is 31 like some thing "  when i execute the report .
    Could any one face this sort of requirment, Please let me know.
    Thanks in advance.
    Reagrds,
    Bharani

    Where would you like this dynamic text being displayed? As an "message" or in some parameter field?
    If first
    parameters date type d.
    data: text type string.
    at selection-screen.
       concatenate 'Today is' date into text.
       message text type 'I'.
    If second
    parameters pa_text type c length 50.
    at selection-screen on date.
      if date is not initial.
        concatenate 'Today is' date into  pa_text.
      enidf.
    at selection-screen output.
       "show it as read only
       loop at screen.
        if screen-name = 'PA_TEXT'.
               screen-input = abap_false.
              modify screen.
        endif.
       endloop.
    Regards
    Marcin

  • How to add text dynamically in  Tree view list box

    CS3/WIN<br />hi,<br />I am new in plugin development.<br />I have a Tree View List box on a dialog.<br />b I don't want to display text when i load the plugin.<br />b I want to insert text data when i click on "Insert" button on dialog. <br />I have defined  Adapter,Mgr,Observer for list box.it is working fine when i want to display data at loading time itself.but not when i click on insert button.<br />b In dialog observer i have defined this but it is not working<br /><br />b Dialog Observer::Update<br /><br />InterfacePtr<IPanelControlData> panelControlData(this, UseDefaultIID());<br />IControlView* Grid = panelControlData->FindWidget(kESSGridTVWidgetID);<br />InterfacePtr<IStringListControlData> listControlData(Grid,UseDefaultIID());<br />if (theSelectedWidget == kESSInsertButtonWidgetID && theChange == kTrueStateMessage) <br />{<br />listControlData->AddString(strText,kESSListBoxTextWidgetID); <br />}<br /><br />b it is showing error  <br />b operator new returning nil for an allocation size of 486022320 bytes<br />(..\..\..\source\components\memoryallocator\PMNew.cpp (552))<br />b Memory allocation failure<br />(c:\development\cobalt\source\public\includes\K2Allocator.h (131))<br />can any one help to get this..<br />Thanks.

    How to populate list in tree view  dynamically
    Hi,
    I am new to  Indesign Plugin creation.
    I want to create list in tree view dynamically.
    I tried wlistboxcomposite sdk sample in indesign cs4.
    I have some doubts in this.
    1. Can i write my own method in  WLBCmpTreeViewAdapter class because it's implements ListTreeViewAdapter
    If it's possible how can i call this method.
    2. In this example they populating static string in constructor like this
    WLBCmpTreeViewAdapter::WLBCmpTreeViewAdapter(IPMUnknown* boss):ListTreeViewAdapter(boss){
    K2Vector<PMString> lists;
    for (int32 i = 0; i< 12; i++){
    PMString name(kWLBCmpItemBaseKey);name.AppendNumber(i+1);name.Translate();lists.push_bac k(name);}
    InterfacePtr<IStringListData> iListData(
    this, IID_ISTRINGLISTDATA);}
    and this list is populating on loading time but my requirement is i have one button "get list" after clicking this button i have to populate the list, how can
    i achieve this.
    Pls do needful.
    Thanks
    Arun

  • Displaying Text as HTML in the UIscrollbar component

    Greetings.
    I have a window on my Flash stage that has some scrollable copy in it.  The problem is, I can't seem to have any formatting for the text ... if I select a word or two to make bold, it all turns bold.  I gather I need to use the "Display Text as HTML" checkbox and then paste in some HTML formatted text but this doesn't seem to work.  I searched this forum and found that others were designating "htmlText" in Actionscript instead of just "text" ... that didn't work either.  I probably just did it wrong, or maybe it's becuase I'm using the UI component "UIscrollBar" for it's scrolling of the text.
    Is there anything else I need to do to be able to format some text with strong tags and maybe some href links?
    I have my properties inspector with the following check marks:
    Display as HTML
    Multiline
    Dynamic Text
    selectable
    Thanks everyone.

    Shamelss bump

  • Displaying text based on variable

    I have a variable defined as brushSize.  Depending on the value of brushSize, I want to display text in a dynamic text field that relates to its value.
    For brushSize values of 3, 13, 23, 33, and 43 I'd like to  display 1, 2, 3, 4, and 5 respectively.  I'm not really sure where to begin here, but I have tried and failed with something like this:
    if( brushSize == 3) {
        brushSizeDisplay("1")
    Any suggestions?

    When I open up a new flash document and start from scratch, it works fine.  But when I try to apply it to my existing project it isn't translating.  Here is the code for the variable that I wish to determine what specific text to display:
    var brushSize:Number = 23;
    var brushSizeMax:Number = 43;
    var brushSizeMin:Number = 3;
    function changeValue(pHow:Number){
        brushSize += pHow;
        if(brushSize > brushSizeMax){
            brushSize = brushSizeMax;
        if(brushSize < brushSizeMin){
            brushSize = brushSizeMin;
        brushSizeText.text = brushSize;
    brushUp.onPress = function(){
        changeValue(10);
    brushDown.onPress = function(){
        changeValue(-10);
    when I try
    if( brushSize == 3) {
         brushSizeDisp.text=1;
    I get no results.  brushSize is my variable, and brushSizeDisp is the instance name of a dynamic text field that I placed on the stage.

  • Display module dynamically

    Hey guys,
        I have tried this in the past but it hasn't worked for me, so I moved on with states.  Now with Flex 4, I hoping I will have better luck.  I haven't be able to find any examples so far, so I am wondering if any here has come across a similar UI issue, and perhaps implemented it.
         Base of my application is an Application NavBar and a ViewStack, each component in my view stack is displayed with wipeup/down effect.  One component of a view stack is search, which displays a form and an empty panel next to it, when user submits the form, panel is populated with a DataGrid with results of the search.
         What I want to do now is if user clicks on one of the rows in the DataGrid, a module be loaded, pass an ID of the row, and populate some details in the module, and have the display the module with wipeup/down effect in the view stack.  If user clicks on browser back button, the module in unloaded and search page is displayed again as it was before. (I hope  get the picture of what I am trying to accomplish)
         I can load a module, pass an ID and get detail from db, but I can't seem to get it to display correctly, and I haven't tried the browser behavior, although I have deep linking already setup.  If I add the module to my view stack then and empty button is displayed on my NavBar (which is undesirable).  In the past I had created a state, but that gets really messy considering all the subcomponents that are displayed in my detail state. 
         Any pointers? an example would really help.  Thanks for you help
    Jay

    Hi,
    you cannot change button text dynamically in a dynpro itself.
    But you can place each button that may be shown on a different subscreen (if there are not too many). In PBO you choose the fitting subscreen in accordance to your needs.
    Good luck!
    Jo
    Edited by: Joachim Ardelt on May 13, 2008 9:39 AM

  • Display Listviewwebpart dynamically using jQuery

    I want to show different list/library view (LVWP) dynamically on button click.
    The solution Display List dynamically is
    not working for SharePoint 2013.Seems that it is only for MOSS 2007
    Please help
    Thanks

    Hi,
    From your description, my understanding is that you want to change the List view web part dynamically with a button.
    The solution you provided works fine, but, as you know there are some UI changes between SharePoint 2007 and SharePoint 2013, so you should do some changes with those codes. You could refer to code below:
    <!-- Paste the URL of your source list below: -->
    <iframe id="SourceList" style="display:none;" src="http://sp/sites/sharepoint2013/Lists/customlist/AllItems.aspx"></iframe>
    <input type="button" id="btnClick" onclick="DisplayThisList()" value="Click me"/>
    <script type="text/javascript">
    function DisplayThisList()
    //"WebPartWPQ2" is the webpart's id, the default id is "WebPartWPQ2", if you customize your list, please check it
    var defaultWebPart = document.getElementById("WebPartWPQ2");
    var displaylist = null;
    var sourcelist = document.getElementById("SourceList");
    try {
    if(sourcelist.contentDocument)
    // Firefox, Opera
    {displaylist = sourcelist.contentDocument.getElementById("WebPartWPQ2") ;}
    else if(sourcelist.contentWindow)
    // Internet Explorer
    {displaylist = sourcelist.contentWindow.document.getElementById("WebPartWPQ2") ;}
    else if(sourcelist.document)
    // Others?
    {displaylist = sourcelist.document.getElementById("WebPartWPQ2") ;}
    catch(err) { alert ("Loading failed");}
    defaultWebPart.innerHTML = displaylist.innerHTML;
    </script>
    And the screenshot below is my result:
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to display a dynamic image file from url?

    Hey,I want to display a dynamic image file from url in applet.For example,a jpg file which from one video camera server,store one frame pictur for ever.My java file looks like here:
    //PlayJpg.java:
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    public class PlayJpg extends Applet implements Runnable {
    public static void main(String args[]) {
    Frame F=new Frame("My Applet/Application Window");
    F.setSize(480, 240);
    PlayJpg A = new PlayJpg();
    F.add(A);
    A.start(); // Web browser calls start() automatically
    // A.init(); - we skip calling it this time
    // because it contains only Applet specific tasks.
    F.setVisible(true);
    Thread count = null;
    String urlStr = null;
    int sleepTime = 0;
    Image image = null;
    // called only for an applet - unless called explicitely by an appliaction
    public void init() {
                   sleepTime = Integer.parseInt(getParameter("refreshTime"));
              urlStr = getParameter("jpgFile");
    // called only for an applet - unless called explicitely by an appliaction
    public void start() {
    count=(new Thread(this));
    count.start();
    // called only for applet when the browser leaves the web page
    public void stop() {
    count=null;
    public void paint(Graphics g) {
    try{
    URL location=new URL(urlStr);
    image = getToolkit().getImage(location);
    }catch (MalformedURLException mue) {
                   showStatus (mue.toString());
              }catch(Exception e){
              System.out.println("Sorry. System Caught Exception in paint().");
              System.out.println("e.getMessage():" + e.getMessage());
              System.out.println("e.toString():" + e.toString());
              System.out.println("e.printStackTrace():" );
              e.printStackTrace();
    if (image!=null) g.drawImage(image,1,1,320,240,this);
    // called each time the display needs to be repainted
    public void run() {
    while (count==Thread.currentThread()) {
    try {
    Thread.currentThread().sleep(sleepTime*1000);
    } catch(Exception e) {}
    repaint(); // forces update of the screen
    // end of PlayJpg.java
    My Html file looks like here:
    <html>
    <applet code="PlayJpg.class" width=320 height=240>
    <param name=jpgFile value="http://Localhost/playjpg/snapshot0.jpg">
    <param name=refreshTime value="1">
    </applet>
    </html>
    I only get the first frame picture for ever by my html.But the jpg file is dynamic.
    Why?
    Can you help me?
    Thanks.
    Joe

    Hi,
    Add this line inside your run() method, right before your call to repaint():
    if (image != null) {image.flush();}Hope this helps,
    Kurt.

  • Displaying text more than 256 in ALV report

    Hi experts,
                     I have problem while displaying text field in ALV report which has more than 256 characters.
    I'm using CL_SALV_TABLE for displaying alv.while concatenating my internal table holding all the text.but at the time of displying the report it's only displaying 256 characters.
               Can anyone guide me how to display more than 256 characters in ALV output using CL_SALV_TABLE.

    Hi,
    Please find the below code.
    TRY.
          gr_column ?= gr_columns->get_column( columnname = 'MATNR' ).
          gr_column->set_output_length( '300' ).
        CATCH cx_salv_not_found.
        Message : Column definition problem
          MESSAGE e075().
      ENDTRY.
    Edited by: Archana.T on Jun 16, 2010 1:24 PM

  • Is it possible to display only dynamically selected fields in the out put?

    Is it possible to display only dynamically selected fields in the out put? i need to display set of columns in the selection criteria, but in the output i have display only input given fields. because i need to convert it into .csv file. So i have to display selected fields from internal table. In oracle they are using"execute immediate". is there any equivalent in SAP?
    thanks in advance.

    Hi Remya,
    Are you talking about dynamic programming in ABAP ?
    If yes, there are concepts like RTTS which facilitates it.
    Yes, the select query also supports dynamic selection of fields. ( Please care about ( ) in dynamic sql ).
    Do more research on Field Symbols and statements like ASSIGN COMPONENT OF.
    Regards,
    Philip.

  • How to display text on last but one page in SAPSCRIPTS

    how to display text on last but one page in SAPSCRIPTS

    u have create one Foooter window , this has to be called in  only One Page.So hardcode /assign this window to only one PAGE number.
    regards
    Prabhu

  • When I click on - View - Page Source, I want to edit with NotePad - note just display text in fancy colors

    I like to edit my web pages easily,
    - click to see html, edit it, (file name already there), save it
    - hit restore on browser - see what I did -
    Just changed from IE
    which gave me NotePad, which is just fine for me
    Just changed to FireFox
    and it displays text in a non-editor,
    can't edit and save easily
    What to do??
    Even worst - after installing FireFox
    IE no longer clicks to NotePad
    but that fancy non-editor :-(((

    ViewSourceWith: https://addons.mozilla.org/firefox/addon/394
    See also:
    http://kb.mozillazine.org/view_source.editor.external
    http://kb.mozillazine.org/view_source.editor.path

  • Display Text in a query as a symbol

    Hi everyone,
    I have a query (BI 7) that displays runtimes of BI applications (generated from technical content -0TCT_MC01 multiprovider).
    In the rows there is 0TCTBIOTYPE (type of BI application) which usually displays texts as below:
    query
    Web Template
    I would like to show in the report the symbol (image) instead of the key/text of this infoobject.
    Any idea?

    Hi Reuvel,
    Nice requirement.
    Not sure 100% but from my memory i guess we can display the image for characteristic, instead of text or key by using Analysis web item Using parameter modification in WAD .
    Kindly check for Modifcation parameter Display image Module (com.sap.ip.bi.*.Documentcontent) in WAD, it might solve your purpose.
    Regards,
    Ashish

  • How to translate the text dynamically in the program?

    Hi All,
    I have a requirement where I need to translate the text dynamically in the program based on the Language Key retrieved.
    Let's say that the Login language is 'EN' and in the logic has retrieved the language 'IT'(based on some conditions). I have to transate the text(which is maintained using the text elements) to ITALIAN(IT) Language and send the same as an email.
    Could you please tell me if any Function Module is available in SAP which translates the text Dynamically in the program. or is there any other way to translate the text dynamically in the program.
    Could you please share your valuable inputs? Thank you in advance.
    Thanks & regards,
    Paddu.

    you could use SET LOCALE LANGUAGE myLanguage - so you can switch to the desired language and all texts will selected from that language.

Maybe you are looking for