Generic function to place a component on the stage in ActionScript-3.0

Hi all,
           I am new to flash and ActionScript 3.0.I am learning ActionScript 3.0.
           My requirement/need  is the AS3 code for placing any type of Component(viz., Button, CheckBox, ComboBox, ListBox, radiobutton, Slider, Scrollbar,Label,TextField, etc.,) on the stage with desired width,height, X and Y parameters(values) which we mention in "Properties" tab of Properties Window in flash.          Hence, What i need is, (say)a generic ActionScript 3.0 method/function, which places any of the components present in "Components Panel" onto the stage.
                i.e., As per my idea, the function prototype or signature may be like this:
                     function addComponent(int <width>, int <height>, int <XPos>, int <YPos>)
           Plzzz... Can anyone help me in this context....  It is a general query i think so. i.e., A basic programmer's task for defining a function for my requirement.           I think,                if I want to add a Button onto the stage at 100,100 pixel position and the button component's width and height are 50,50 respectively, (i.e., button.X=button.Y=100 && button.width=button.height=50).
           So, a button must be placed at 100,100,             then, the sample code looks like this:
                              Button <btn_instance> = new Button();     //creates Button instance
                              <btn_instance>.addComponent(50,50,100,100);// properties of button.
I hope someone will help me.
Thanks in advance..
Srihari.Ch

(OTTOMH) you could have a function similar to:
function placeComponent( container:DisplayObjectContainer, component:UIComponent, w:int, h:int, xpos:int, ypos:int ):void
  container.addChild( component );
  component.move( xpos, ypos );
  component.setSize( w, h );
called with:
var b:Button = new Button();
placeComponent( this, b, 100, 20, 200, 200 );
You were alost there

Similar Messages

  • Error when I put a component in the stage and I change any property

    Hello
    I'm using Flash CS4, as3 and adobe air file. I have an application with 3 scenes, first scene to login, second to set up, and third to see an video.
    The problem is that, when I put a component in the second or third scene, if a change any property in the component inspector, any property it gives me error. So put the component and I change property by code in as3.
    But I'm doing things with FLVPlayback component, and now before enter the scene gives me error, the solution will be to get the original properties, but I don't remember, I could install other time Flash CS4, but I can do that for any componet, better know the solution.
    For example, I have an as file who is the class named p.e. MyMainclass, and in the scene3, I put FLVPlayback, who default values it's the last I used (I don't remember default after instalation), if any code in as3, it gives me this error:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at com.program::MyMainClass/__setProp___id2__scene3_myvideo1_1()[com.program.MyMainClass::__ setProp___id2__scene3_myvideo1_1:7]
    I remove this component, I put another one I never used, it doesn't give me error, I change any property in the object inspector, p.e. color, it gives me error, I change to original property again, and then NO ERROR.
    Thanks in advance

    I would reccomend that you not use scenes for that purpose, not exactly sure why  but scenes are unreliable. Try putting all of your content in one scene, one timeline and just add a few stop() 's at the end of each "scene", then in your code remove scene2 and scene3 three references, and you'll possibly need to change frame anchors/targets also if you have them.
    The error indctates that you have called an object that does not exist at the time the code is run, check where you placed your code, should be frame one, scene1, and also check if you have objects entering the stage down the timeline, that do not enter in frame 1, possibly the movieClip? if so add another keyframe on your actions layer on the same frame as the object and enter the call function for it there.

  • IPod function looses place when playing in the background

    I have an iPhone 3g and since getting it I've been able to cause the iPod to loose its place if I run an application and let it play in the background. If one song is playing and I start any other application in the phone (even built-in ones like the browser) that doesn't cause the iPod to stop playing music the iPod will keep playing and if I use the browser or other apps long enough for the ipod to move to the next song and I return to the iPod app the time and track information will reflect the time and song that was playing when I started the other app! This is particularly noticeable in long files like audio books where you are listening to chapter 5 when you start the browser and go back to the ipod sometime during chapter 6 and the ipod still shows you at some point in chapter 5. Anyone else noticed this? I've also had it not remove the 'new' (blue dot) from podcasts unless I pause it then resume playing.

    I've seen both these issues when listening to podcasts. also, i've noticed that when this issue is occurring, fast forward sounds like it's seeking forward but when you let go of the button it resumes in the exact same spot from where you were before you push fast forward.

  • Is it possible to call a function in a parent component from a child component in Flex 3?

    This is probably a very basic question but have been wondering this for a while.
    I need to call a function located in a parent component and make the call from its child component in Flex 3. Is there a way to access functions in a parent component from the child component? I know I can dispatch an event in the child and add a listener in the parent to call the function, but just wanted to know if could also directly call a parent function from a child (similar to how you can call a function in the main mxml file using Application.application). Thanks

    There are no performance issues, but it is ok if you are using the child component in only one class. Suppose if you want to use the same component as a child to some bunch of parents then i would do like the following
    public interface IParentImplementation{
         function callParentMethod();
    and the parent class should implement this 'IParentImplementation'
    usually like the following line
    public class parentClass extends Canvas implements IParentImplementation{
              public function callParentMethod():void{
         //code
    in the child  you should do something like this.
    (this.parent as IParentImplementation).callParentMethod();
    Here using the Interfaces, we re decoupling the parent and the child
    If this post answers your question or helps, please mark it as such.

  • JSON content - click to show another symbol on the stage

    Hi,
    Thanks to Zaxist I have a working code like the one below:
    $.getJSON("content.json",
              function(data){
                        for(var i=0; i<data.length; i++){
                        var s = sym.createChildSymbol("template","content");
                        s.$("title").html(data[i].title);
                        s.$("description").html(data[i].description);
                        s.$("seira").html(data[i].seira);
                        s.$("imageholder").css({"background-image":"url('"+data[i]. image+"')"});
                        s.$("imageholder").data('Large', data[i].largeimage);
                        s.$("imageholder").click("click", function(e){
                                                                sym.getComposition().getStage().$("finte").css({"background-image":"url("+$(this).data('L arge')+")"});
    Now, I am trying on the click function to show specific symbol on the stage, for example when click on the first item the symbol red will appear, if cliked the second item the (previous symbols that was appeared will be hided) and the new symbol blue will appear. An so on with all the other ellements that JSON files has.
    I tried this on the code, but nothing:
    $.getJSON("content.json",
              function(data){
                        for(var i=0; i<data.length; i++){
                        var s = sym.createChildSymbol("template","content");
                        s.$("title").html(data[i].title);
                        s.$("description").html(data[i].description);
                        s.$("seira").html(data[i].seira);
                        s.$("imageholder").css({"background-image":"url('"+data[i]. image+"')"});
                        s.$("imageholder").data('Large', data[i].largeimage);
                        s.$("imageholder").click("click", function(e){
                                                                sym.getComposition().getStage().$("finte").css({"background-image":"url("+$(this).data('L arge')+")"});
                                                                if (data[i]=3) {
                                                                                                                                                                                                                                                                sym.getComposition().getStage().$("red").show();
                                                                else {
                                                                sym.getComposition().getStage().$("red").hide();
                                                                if (data[i]=5) {
                                                                                                                                                                                                                                                                                                                             sym.getComposition().getStage().$("blue").show();
                                                                else {
                                                                sym.getComposition().getStage().$("blue").hide();
    Could you help me?
    Thanks in advanced!

    Zaxist please I need your help again.
    I have this:
    $.getJSON("images1.json",
              function(data){
                        for(var i=0; i<data.length; i++){
                        var s = sym.getSymbol("base").createChildSymbol("template", "content");
                        s.element.attr('id', 'basara'+i)
                                            s.getSymbolElement().css({"background-size":"contain",
                                               "float": "left",
    "margin": "100 125px 125px 100",
    "clearboth":"{ clear: both; }"
                        s.$("description").html(data[i].description);
                        s.$("code").html(data[i].code);
                        s.$("imageholder").css({"background-image":"url('"+data[i]. image+"')",
                                                                                                                                                                     "background-size":"cover"
                        s.$("imageholder").data('myIndex', i);
                                                                          s.$("imageholder").data('Large', data[i].image);
                         s.$("imageholder").click("click", function(e){
                                                                     if ($(this).data("myIndex") == 0){
    sym.getComposition().getStage().getSymbol('holders').$("holder1").css({"background-image": "url("+$(this).data('Large')+")"});
                            else if ($(this).data("myIndex") == 1) {
    sym.getComposition().getStage().getSymbol('holders').$("holder1").css({"background-image": "url("+$(this).data('Large')+")"});
                            else if ($(this).data("myIndex") == 2) {
    sym.getComposition().getStage().getSymbol('holders').$("holder1").css({"background-image": "url("+$(this).data('Large')+")"});
    $.getJSON("images2.json",
              function(data){
                        for(var i=0; i<data.length; i++){
                       var s = sym.getSymbol("podia").createChildSymbol("template", "contentpodia");
                                           s.getSymbolElement().css({"background-size":"contain",
                                               "float": "left"});
                        s.$("description").html(data[i].description);
                        s.$("code").html(data[i].code);
                        s.$("imageholder").css({"background-image":"url('"+data[i]. image+"')",
                                                                                                                                                                     "background-size":"cover"
                        s.$("imageholder").data('myIndex', i);
                                                                          s.$("imageholder").data('Large', data[i].image);
                         s.$("imageholder").click("click", function(e){
                                                                     if ($(this).data("myIndex") == 0){
    sym.getComposition().getStage().getSymbol('holders').$("holder2").css({"background-image": "url("+$(this).data('Large')+")"});
                            else if ($(this).data("myIndex") == 1) {
    sym.getComposition().getStage().getSymbol('holders').$("holder2").css({"background-image": "url("+$(this).data('Large')+")"});
                            else if ($(this).data("myIndex") == 2) {
    sym.getComposition().getStage().getSymbol('holders').$("holder2").css({"background-image": "url("+$(this).data('Large')+")"});
    I want to import symbol podia inside to base to handle it by content2.
    I am writing this:
    var basewithpodia = sym.getSymbol("base").createChildSymbol("podia", "content2");
    it places the symbol inside, without the data of the JSON file.
    How can I make it to work?

  • Controlling properties on items added to the stage in a loop

    Hi there,
    I have a loop that adds xml elements to the stage (10). Once added, I need to control the items (checkbox = do something).
    Here is where I add them to the stage.
              private function createLayout():void {
                   container = new VBox();
                   for(var i:int=0; i<10; i++) {
                        vBox = new VBox();
                        hBox = new HBox();
                        titleText = new LinkButton();
                        itemInfo = new Text();
                        abstract = new Text();
                        archive = new CheckBox();
                        rateItem = new ComboBox();
                        category = new ComboBox();
                        var categoryLabels:Array = new Array("Food & Ag","News","Health","People","General","What's Coming","Biofuel","Environment");
                        var rateLabels:Array = new Array("Excellent","Good","Bad","Neutral","Controversial");
                        titleText.label = listCollection.getItemAt(i).title;
                        titleText.width = 400;
                        itemInfo.text = listCollection.getItemAt(i).source + " | " + listCollection.getItemAt(i).date;
                        abstract.text = listCollection.getItemAt(i).abstract;
                        abstract.width = 400;
                        archive.label = "Archive";
                        category.prompt = "Category";
                        category.dataProvider = categoryLabels;
                        category.rowCount = categoryLabels.length;
                        rateItem.prompt = "Rate";
                        rateItem.dataProvider = rateLabels;
                        vBox.addChild(titleText);
                        vBox.addChild(itemInfo);
                        vBox.addChild(abstract);
                        vBox.addChild(hBox);
                        hBox.addChild(archive);     
                        hBox.percentWidth = 80;
                        hBox.percentHeight = 80;
                        archive.addEventListener(Event.CHANGE, toggleArchive);                    
                        container.addChild(vBox);
                   addChild(container);
    I listen for a checkbox (change event) and when clicked, call a function that adds two comboboxes to the stage.
    archive.addEventListener(Event.CHANGE, toggleArchive);     
    I then call the function that will handle the event.
              public function toggleArchive(e:Event):void {
                   if(archive.selected == true){
                        hBox.addChild(category);
                        hBox.addChild(rateItem);                    
                   else {
                        hBox.removeChild(category);
                        hBox.removeChild(rateItem);
    When I have one item it works fine.
    for(var i:int=0; i<1; i++) {
    When I add 10 nothing happens. I feel like i should be doing something to identify what item I'm referring to. Any thoughts/reccomendations would br great!

    My apologies, but I am somewhat confused. Thanks for taking the time to help me (first off)!
    I changed the createLayout function to add name, visible, and includeInLayout propertiesfor each comboBox. I then changes the scope of "i" so that I can reference it from the function called upon the Event.CHANGE event.
              private var i:Number;
              private function createLayout():void {
                   container = new VBox();
                   for(var i=0; i<listCollection.length; i++) {
                        vBox = new VBox();
                        hBox = new HBox();
                        titleText = new LinkButton();
                        itemInfo = new Text();
                        abstract = new Text();
                        archive = new CheckBox();
                        rateItem = new ComboBox();
                        category = new ComboBox();
                        var categoryLabels:Array = new Array("Food & Ag","News","Health","People","General","What's Coming","Biofuel","Environment");
                        var rateLabels:Array = new Array("Excellent","Good","Bad","Neutral","Controversial");
                        titleText.label = listCollection.getItemAt(i).title;
                        titleText.width = 400;
                        itemInfo.text = listCollection.getItemAt(i).source + " | " + listCollection.getItemAt(i).date;
                        abstract.text = listCollection.getItemAt(i).abstract;
                        abstract.width = 400;
                        archive.label = "Archive";
                        category.prompt = "Category";
                        category.name = "category";
                        category.dataProvider = categoryLabels;
                        category.rowCount = categoryLabels.length;
                        category.visible = false;
                        category.includeInLayout = false;
                        rateItem.prompt = "Rate";
                        rateItem.name = "rateItem";
                        rateItem.dataProvider = rateLabels;
                        rateItem.visible = false;
                        rateItem.includeInLayout = false;
                        vBox.addChild(titleText);
                        vBox.addChild(itemInfo);
                        vBox.addChild(abstract);
                        vBox.addChild(hBox);
                        hBox.addChild(archive);    
                        hBox.addChild(category);
                        hBox.addChild(rateItem);
                        hBox.percentWidth = 80;
                        hBox.percentHeight = 80;
                        archive.addEventListener(Event.CHANGE, toggleArchive);                   
                        container.addChild(vBox);
                   addChild(container);
    now I have to modify these items by name from the toggleArchive method.
              public function toggleArchive(e:Event):void {
                   if(archive.selected == true){
                        var cb:ComboBox = hBox.getChildAt(i).getChildByName(category);
                        cb.visible = true;
                        cb.includeInLayout = true;
                   else {
    Two things, 1) i get an error saying...
    Severity and Description    Path    Resource    Location    Creation Time    Id
    1061: Call to a possibly undefined method getChildByName through a reference with static type flash.display:DisplayObject.    mediaTrap/src/components    listItems.mxml    line 132    1242667335601    643
    2) shouldnt it be something like this
              public function toggleArchive(e:Event):void {
                   if(hBox.getChildAt(i).archive.selected == true){
                        var cb:ComboBox = hBox.getChildAt(i).getChildByName(category);
                        cb.visible = true;
                        cb.includeInLayout = true;
                   else {

  • I am looking for an app that can unmute my iphone after a preset time, eg 1 or 2 hours. Does anybody know an app with this feature?? The apps I have found are linked to a calendar or a place, I just need the timer function..

    I am looking for an app that can unmute my iphone after a preset time, eg 1 or 2 hours. Does anybody know an app with this feature?? The apps I have found are linked to a calendar or a place, I just need the timer function..

    thanks. yes i am aware of the VoiceOver feature but it is NOT the solution to my problem. as you said, it is a solution to a different set of issues. i want the text to speech ability because i there are books i need to read but do not have the time to sit down and read them and have become used to listening to them read to me either by a professional human reader or with the text to speech software on the Kindle.
    I think Apple makes the best audio devices but i am really disappointed in this inexplainable shortcoming. if apple can give us siri they ought to be able to design a nice little button that i can push to turn on text to speech while i am in a document, book, magazine or webpage. clearly it is possible as apple has added the "reader" button in safari to have web pages dropped into the reader format.
    thanks for your suggestion though, it is what everyone suggests but it does not address the issue.

  • Calling functions in a component before the component UI is used?

    I know this has been asked before, in fact I'm sure I've had this problem and resolved it in the past. However, I can't recall the solution off hand.
    I have a component, which contains a publich function and data. The component has a UI which can be loaded by another function call. Loading the UI works fine, and after its been loaded (and close) calling the first function works fine. However, before hte UI has been loaded calling the function does nothing.
    Any thoughts?

    Load the UI earlier but set the visible and includeInLayout properties to the component to false.
    Then in the function call that used to load the UI, just set those properties to true.
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • Component visibility getting delay while drop the component in the Panel

    Hi,
    In my project I have used drag and drop functionality to drop the Icon from 1st panel to 2nd panel. The 1st panel contains three buttons with different icons and the 2nd panel is added as the destination (Drop place) in the desktop pane. While drag and drop I have used a panel and label to place the icon in the 2nd panel. The icon which is available in the label visibility getting delay(nearly 5 - 10 sec) at the first time drag and drop. After that there is no time delay for the drag and drop. This happens all the time while start my project. I have tried repaint() and revalidate() for all the panels still the delay is there. Kindly suggest any idea to reduce the delay.
    Thanks in advance...

    Component visiblity getting delay while drop the component in the panel in java swing with comment "Kindly suggest any idea to reduce the delay" - A SSCCE  by @MadProgrammer

  • Various ways to place a File in the Application Server.

    Hi all,
       What are the various ways to place a file in the application Server.
          Please classify them as shown below.
          1. Use of ABAP Code.
           2. Without the use of ABAP code.
    Regards

    Hi
    <b>1. Use of ABAP Code.</b>
    by writing code like this
    REPORT  ZSD_EXCEL_INT_APP.
    parameter: file_nm type localfile.
    types : begin of it_tab1,
            f1(20),
            f2(40),
            f3(20),
           end of it_tab1.
    data : it_tab type table of ALSMEX_TABLINE with header line,
           file type rlgrap-filename.
    data : it_tab2 type it_tab1 occurs 1,
           wa_tab2 type it_tab1,
           w_message(100)  TYPE c.
    at selection-screen on value-request for file_nm.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    *   PROGRAM_NAME        = SYST-REPID
    *   DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
       STATIC              = 'X'
    *   MASK                = ' '
      CHANGING
       file_name           = file_nm
    EXCEPTIONS
       MASK_TOO_LONG       = 1
       OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    refresh it_tab2[].clear wa_tab2.
    file = file_nm.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file
        i_begin_col                   = '1'
        i_begin_row                   =  '1'
        i_end_col                     = '10'
        i_end_row                     = '35'
      tables
        intern                        = it_tab
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    loop at it_tab.
      case it_tab-col.
       when '002'.
        wa_tab2-f1 = it_tab-value.
       when '004'.
        wa_tab2-f2 = it_tab-value.
      when '008'.
        wa_tab2-f3 = it_tab-value.
    endcase.
    at end of row.
      append wa_tab2 to it_tab2.
    clear wa_tab2.
      endat.
    endloop.
    data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *--- Display error messages if any.
      IF sy-subrc NE 0.
        MESSAGE e001(zsd_mes).
        EXIT.
      ELSE.
    *---Data is downloaded to the application server file path
        LOOP AT it_tab2 INTO wa_tab2.
          TRANSFER wa_tab2 TO p_file.
        ENDLOOP.
      ENDIF.
    *--Close the Application server file (Mandatory).
      CLOSE DATASET p_file.
    loop at it_tab2 into wa_tab2.
      write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
    endloop.
    Here is a pseudo code for what you are looking for-
    OPEN DATASET P_FLPTH FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF SY-SUBRC eq 0.
    LOOP AT LT_TAB INTO LS_TAB.
    TRANSFER LS_TAB TO P_FLPTH.
    ENDLOOP.
    CLOSE DATASET P_FLPTH.
    if sy-batch = 'X'.
    write:/ 'File uploaded successfully'.
    else.
    message sXXX with 'File uploaded successfully'.
    endif.
    Else.
    if sy-batch = 'X'.
    write:/ 'Error in File upload'.
    else.
    message sxxx with 'Error in File upload'.
    endif.
    LEAVE PROGRAM.
    ENDIF.
    <b>2. Without the use of ABAP code.</b>
    CG3Y -
    Appl to Presentation server
    <b>Reward if useful</b>

  • New WIN7 System, FFox gives error "Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory" - will not go to any site.

    New Windows 7 computer. After installing Firefox, every time I bring it up I get the following message:
    "Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and fix the problem. If you continue to use this session, you might see incorrect application behaviour when accessing security features."
    Then Firefox comes up, but will not function at all - can enter url address, but will not respond to ANY clicks, so can not go to any site.

    This link shows how to fix this - https://support.mozilla.com/kb/Could+not+initialize+the+browser+security+component

  • Alv grid control toolbar exclude generic functions

    Hi,
    I'm attempting to exclude certain functions from the toolbar of an (editable) alv grid (of class cl_gui_alv_grid).
    The problem is that the  buttons still show on the toolbar.
    My program is based on the SAP example program 'BCALV_EDIT_03'. It would seem that even this example doesn't work as expected.
    This is an extract of my code:
    -[EXTRACT <b></b>BEGIN]--
    *---Restrict generic functions to 'change only'.
    *   (i.e The user should not be able to add new lines).
      DATA ls_exclude TYPE ui_func.
      DATA: lt_exclude TYPE ui_functions.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      APPEND ls_exclude TO lt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      APPEND ls_exclude TO lt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      APPEND ls_exclude TO lt_exclude.
    *...initialize alv grid
        CALL METHOD g_grid->set_table_for_first_display
          EXPORTING
            is_layout            = ps_layout
            it_toolbar_excluding = lt_exclude
          CHANGING
            it_fieldcatalog      = pt_fieldcat
            it_outtab            = pt_outtab.
    -[EX<b></b>TRACT END]--
    Thank You In Advance,
    Nhlanhla

    Hi,
    i've done similar one, i am able to exclude.
    DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
    PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
    FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
    * Only allow to change data not to create new entries (exclude
    * generic functions).
      DATA LS_EXCLUDE TYPE UI_FUNC.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    "can you check the LT_EXCLUDE in debug mode.
    regards
    vijay

  • How to position the Stage at the first available place on the screen

    Im creating a Stage,
    but for any reason when I dont define x,y it shows in different places on the screen, and sometimes outside of the screen
    if I set x=0 and y=0 I have problems, because some user, like me, use the taskbar on the top of the screen,
    anybody knows how do workaround this ?
    this is the code of my Stage
    public class Game extends Stage {
        public var tick: Timeline = Timeline {
            repeatCount: Timeline.INDEFINITE
            keyFrames: [
                KeyFrame {
                    time: 0.01s
                    action: function() {
                        mainLoop();
        // main game loop
        public function mainLoop(){
            for (node in scene.content) {
                if( node instanceof Updatable){
                    (node as Updatable).update();
        public function play(){
            tick.play();
    }and this is how I'm using it
    var game: Game = Game {
        title: "Cabecudinhos, episódio 1 o ataque dos mosquitos"
        x: 0
        y: 0
        width: 800
        height: 600
        scene: Scene {
            content: [
                background
                littleBox
    function run(__ARGS__ : String[]) {
        game.play();
        soundtrack.play();
    }

    You can ask Java for that.
    You can just center the stage on screen, that's quite easy given the screen dimensions:
    import java.awt.*;
    var dim: Dimension = Toolkit.getDefaultToolkit().getScreenSize();
    println("Screen is {dim.getWidth()}x{dim.getHeight()}");I suppose it works for main screen, there is code to get the info for all screens (if several are connected).
    If you need to know the placements of the taskbar and other bars, you need to get the insets, which is a bit more convoluted.
    var ge: GraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    var gsl: GraphicsDevice[] = ge.getScreenDevices();
    var gcl: GraphicsConfiguration[] = gsl[0].getConfigurations();
    var ins: Insets = Toolkit.getDefaultToolkit().getScreenInsets(gcl[0]);
    println("Insets are T {ins.top}, L {ins.left}, B {ins.bottom}, R {ins.right}");It shows B 34 for my setting and T 34 if Windows' taskbar is on top, etc.

  • A Generic Function

    Hello , everybody
    I want to create a generic function which will accept :
    - one , two or three group by columns
    - one , two , or three columns which will consist the where column of the select statement. These columns may be in varchar2 or date datatype.
    The function will use the execute immediate command and will return a number.
    How can I write this function as more generic as it can be?
    I want to avoid the structures such as:
    if where_column2_var is null then .... and
    if where_column3_var is null then ....
    Simon

    You could use collections to accept as many parameters you need
    example:
    SQL> create or replace type NVPair as object
    2 (name varchar2(100)
    3 ,value varchar2(100)
    4 ) ;
    5 /
    Type created.
    SQL> create or replace type select_columns as table of NVPair ;
    2 /
    Type created.
    SQL> create or replace type group_by_columns as table of varchar2(30)
    2 /
    Type created.
    SQL> create or replace function getNumber(p_select in select_columns
    2 ,p_group_by in group_by_columns
    3 ) return number
    4 is
    5 begin
    6 dbms_output.put_line ('Looping select_columns') ;
    7 for i in 1..p_select.count
    8 loop
    9 -- do something
    10 dbms_output.put_line(p_select(i).name) ;
    11 dbms_output.put_line(p_select(i).value) ;
    12 end loop ;
    13 dbms_output.put_line ('Looping group_by_columns') ;
    14 for i in 1..p_group_by.count
    15 loop
    16 -- do something
    17 dbms_output.put_line(p_group_by(i)) ;
    19 end loop ;
    20 return 1 ; -- return the result from the actual query ... for this example, return 1
    21* end ;
    SQL> /
    Function created.
    SQL> set serveroutput on
    SQL> declare
    2 sel select_columns := select_columns() ;
    3 grp group_by_columns := group_by_columns() ;
    4 nv NVPair ;
    5 i number ;
    6 begin
    7 nv := NVPair('col1', 'varchar2') ;
    8 sel.extend ;
    9 sel(1) := nv ;
    10 nv := NVPair('col2', 'date') ;
    11 sel.extend ;
    12 sel(2) := nv ;
    13 grp.extend ;
    14 grp(1) := 'col1' ;
    15 i := getNumber(sel,grp) ;
    16 end ;
    17 /
    Looping select_columns
    col1
    varchar2
    col2
    date
    Looping group_by_columns
    col1
    PL/SQL procedure successfully completed.
    Or you can do the same thing using pl/sql tables ...
    Of course, you need to do type casting in your function if that's needed

  • Function Module in a Generic Function Module Extractor

    I want to use a generic function module (ZFM_CONNECTION_DETAIL) in a Generic Function Module based Extractor.
    After Creating, I have checked it in RSA3... Data is showing properly on the Extractor Check.
    And replicated on BW side, after triggering the extractor using infopackageu2026 only one record is coming on the target side (BW).
    And one job is running endless on the source system.
    Generic extractor on the normal code is working properly on both sides.
    But problem occurs while I was using Function Module in the Generic function Module extractor.
    Waiting for a Reply with solution...........
    Hi Siegfried Szameitat,
    I have searched a lot to find out the solution of my Question (Problem). But there is no solution for the problem I have.
    Please let me to find out a proper solution of my issue....
    Thanks

    FUNCTION zcrm_questionnaire.
    Its a full Load...
    Codes are as followed..........
      DATA:lv_times     TYPE i.
      DATA:lv_datapakid TYPE numc4.
      CLEAR:lv_datapakid,lv_times .
      STATICS: s_s_if TYPE srsc_s_if_simple,
               sd_no_more_data  TYPE flag.
      DATA: l_s_select TYPE srsc_s_select.
      DATA :  s_counter_datapakid LIKE sy-tabix,
              s_cursor TYPE cursor.
      RANGES :  date  FOR  zresult_lt-date.
      DATA: lv_count TYPE i VALUE 1.
      IF i_initflag = sbiwa_c_flag_on.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    Check InfoSource validity
        CASE i_dsource.
          WHEN 'ZCRM_QUESTIONNAIRE'.
          WHEN OTHERS.
            IF 1 = 2. MESSAGE e009(r3). ENDIF.
            log_write 'E'                  "message type
                      'R3'                 "message class
                      '009'                "message number
                      i_dsource            "message variable 1
                      ' '.                 "message variable 2
            RAISE error_passed_to_mess_handler.
        ENDCASE.
        APPEND LINES OF i_t_select TO s_s_if-t_select.
        s_s_if-requnr    = i_requnr.
        s_s_if-dsource   = i_dsource.
        s_s_if-maxsize   = i_maxsize.
        APPEND LINES OF i_t_fields TO s_s_if-t_fields.
      ELSE.                 "Initialization mode or data extraction
        IF NOT sd_no_more_data IS INITIAL.
          RAISE no_more_data.
        ENDIF.
        LOOP AT s_s_if-t_select INTO l_s_select .
          MOVE-CORRESPONDING l_s_select TO date.
        ENDLOOP.
        DATA : v_questionire  TYPE  crm_svy_db_sid.
        DATA : itab_questionire TYPE zsurveyid.
        DATA : e_tt_data_get TYPE  zresult_lt OCCURS 10.
        v_questionire = 'CALL CENTER'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'METER INSTALLATION TEAM'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'METER READING & BILLING'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'NO SUPPLY'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'CASH COLLECTION CENTER'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'STREET LIGHT'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'CONSUMER CARE CENTER'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'WEBSITE'.
        APPEND v_questionire TO itab_questionire.
        DATA : counter TYPE i,
              high  LIKE sy-datum,
               low LIKE sy-datum.
        CONCATENATE
        l_s_select-high+6(4)
        l_s_select-high+3(2)
        l_s_select-high+0(2)
        INTO
        high.
        CONCATENATE
        l_s_select-low+6(4)
        l_s_select-low+3(2)
        l_s_select-low+0(2)
        INTO
        low.
        BREAK-POINT.
       do i_maxsize times.
        CALL FUNCTION 'ZCRM_SURVEY_REPORTING'
          EXPORTING
            e_date_frm    = low
            e_date_to     = high
            e_questionire = itab_questionire
          CHANGING
            it_result     = e_tt_data_get.
        IF sy-subrc IS INITIAL.
          e_t_data[] = e_tt_data_get[].
          APPEND e_t_data.
        ELSE.
          EXIT.
        ENDIF.
         sd_no_more_data = 'X'.
      ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.
    lk

Maybe you are looking for

  • Oracle returning incorrect day of the week

    Hi there, I have a table named Performance, which includes a date field named PDATE, some other attributes such as title, etc, and a field named WEEKDAY, which includes the numerical value for the day of the week. Here is an example: PER# P# THEATRE#

  • Email alert to Vendors

    Hi All, I have a situation where I would like to send email alert to vendors everytime a liability entry is posted to the vendor account - email ID would be maintained in the vendor master. Wanted to know if this is possible in standard SAP - if yes,

  • To close the unclosed production orders without imbalancing with invoice

    Hi MRP Experts, I want solution for following situation. Mrp was not implemeted during software implementation. Now we need to implement. But since manual production entry was not done according to invoice there is no link between them. At present i

  • DW CS4 will not Open in OS X

    I have successfully used DW CS4 since it came out on my iMAC and on OS X Snow Leopard since it came out.  Recently I was starting a new project and tried to open DW and it crashed.  Tried rebooting, closing background applications, closing all open a

  • Maintaining Products

    Hi members II'm having a problem in maintaining products in CRM. If i create a material(say laptop) and i want to give service to that saying monthly service and I also want to give warranty for 1 yr. then should i create- 1)a product type MATERIAL(l