When prefWidth() and prefHeight() return the correct results

The functions Node.prefWidth () and Node.prefHeight () return 0 after a node is created (for example after the new Button("xyz"). - then "suddenly" (for example when being positioned in layoutChildren() of a component) they return correct return values.)

That is the trigger to make the knots return a correct result of prefWidth/prefHeight? Is there a way to directly get the correct prefWidth/prefHeight just after creating an instance of the component?

Thanks for any indication on that!



A few examples: an extension component for the simple layoutChildren() method in which the three buttons are added. The prefWidth/prefHeight is output to the console:
public class Test_39_PrefWidth extends Application
{
    public static void main(String[] args) { launch(args); }

    class MyPane extends Pane
    {
        protected void layoutChildren()
        {
            double y = 0;
            sysoutNodePrefSizes("----- doing the layout");
            for (Node child: getChildren())
            {
                double childWidth = child.prefWidth(-1);
                double childHeight = child.prefHeight(-1);
                child.resizeRelocate(0,y,childWidth,childHeight);
                y = y + childHeight;
            }
        }
    }
    
    MyPane m_pane;
    
    public void start(Stage primaryStage)
    {
        final Scene scene = SceneBuilder.create()
             .root
             (
                 m_pane = new MyPane()
             )
             .build();
        for (int i=0; i<3; i++)
        {
            Button b = new Button("Hello " + i);
            m_pane.getChildren().add(b);
        }
        sysoutNodePrefSizes("------ having created and added the buttons");
        primaryStage.setScene(scene);
        sysoutNodePrefSizes("------ having assigned the scene");
        primaryStage.show();
        sysoutNodePrefSizes("------ having called stage.show");
    }
    
    private void sysoutNodePrefSizes(String title)
    {
        System.out.println(title);
        for (Node child: m_pane.getChildren())
            System.out.println(child.prefWidth(-1) +  "/" + child.prefHeight(-1));
    }
}
The result in the console is:
-have created and added the buttons
0.0/0.0
0.0/0.0
0.0/0.0
-have assigned to the scene
0.0/0.0
0.0/0.0
0.0/0.0
-do the page layout
58.0/20.9609375
58.0/20.9609375
58.0/20.9609375
-calling stage.show
58.0/20.9609375
58.0/20.9609375
58.0/20.9609375
-do the page layout
58.0/20.9609375
58.0/20.9609375
58.0/20.9609375

Published by: user10257069 on 09.11.2012 00:48 - reformatted the code...

user10257069 wrote:

That is the trigger to make the knots return a correct result of prefWidth/prefHeight? Is there a way to directly get the correct prefWidth/prefHeight just after creating an instance of the component?

The size of a knot is not known, until it has been laid out. It is not arranged until after it has been added to the scene. Setting in page happens during a pulse, so you add the node to the stage and then is placed on the next pulse.

Because a node could be affected by a CSS style and the styles that apply to a dependent node when the node is in the graphic scene, it is not possible to get prefWidth/prefHeight without adding the node to the graphic scene. This is a problem and there must be a method 'size this node as if it was added to that parent in the scene graph', but it is not one now.

Tags: Java

Similar Questions

  • CF do not return the correct results

    I have a column that has positive and negative numbers and I'm trying to separate these numbers in a separate column for each. "My code below works if each barcode has both a positive and negative number to compare, but mistakes lifted as"cannot convert"numerical value" if I just all the positive numbers in the colum. Which, in some casees, I get because I import a CSV file. Can someone help with the code? -Thank you.

    <! - SUM POSITVE AMOUNT - >
    < cfquery name = "SumPositiveTemp" datasource = "inventory" >
    SELECT the barcode, Sum (Quantity) as quantitysumPositive
    TEMP
    WHERE quantity > 0
    GROUP BY barcode
    < / cfquery >

    <!--> SUM QUANTITY NEGATIVE
    < cfquery name = "SumNegativeTemp" datasource = "inventory" >
    SELECT the barcode, Sum (Quantity) as quantitysumNegative
    TEMP
    WHERE quantity < 0
    GROUP BY barcode
    < / cfquery >

    <!-SUBTRACT QUANTITY ISSUED LESS QUANTITY RECEIVED IN QUANTITY SOLD-> GET
    < cfset QuanitySold = ' #SumPositiveTemp.quantitysumPositve - SumNegativeTempquantitysumNegative #' >

    <! - INSERT POSITVIE/NEGATIVE NUMBERS INTO TABLE - >
    < cfoutput query = "SumPositiveTemp" >
    < cfquery name = "InsertPositiveIntoCart" datasource = "inventory" >
    INSERT INTO Cart1 (barcode, QuantityOut, QuantityIn, QuantitySold)
    VALUES (#SumPositiveTemp.barcode #, #SumPositiveTemp.quantitysumPositive #, #SumNegativeTemp.quantitysumNegative #, #QuantitySold #)
    < / cfquery >
    < / cfoutput >

    Yes, I found that if the barcode was not POS and NEG numbers it returns a null value. After more research, I found that was the solution to avoid a null value and use in this situation.

  • When I open a saved PDF file it stalls.   After 10 min, I close and try again the same result.

    When I open a PDF - registered Adobe Reader (not answer) and it it stalls stalls.   After 10 min, I close and try again the same result.  Sometimes it works for a few minutes, then it will start in neutral and I get nothing fact.

    What is your operating system?  Version of player?

    Can you open Reader by itself?

  • % ROWCOUNT SQL does not return the expected result

    I have the following function within a package:

    --Update APPERY_JTI_deleted_USERS table:
    FUNCTION fn_updt_app_jti_dlt_usr(
        p_update_co      IN VARCHAR2,
        p_appery_user_id IN APPERY_JTI_deleted_USERS.appery_user_id%TYPE,
        p_outlet_code    IN APPERY_JTI_deleted_USERS.outlet_code%TYPE)
      RETURN NUMBER
    AS
    lv_sql       VARCHAR2(4000);
    lv_rowcount  NUMBER := 0;
    BEGIN
    
    lv_sql := 'UPDATE APPERY_JTI_deleted_USERS SET '||p_update_co||' = 1 WHERE '||p_update_co||' = 0 AND OUTLET_CODE = '''||p_outlet_code||''' AND APPERY_USER_ID = '''||p_appery_user_id||'''';
    
    --EXECUTE IMMEDIATE lv_sql;
    EXECUTE IMMEDIATE 'BEGIN ' || lv_sql || '; :z := sql%rowcount; END; ' USING OUT lv_rowcount ;
    
    RETURN lv_rowcount;
      
    EXCEPTION
    WHEN OTHERS THEN
      RETURN -1;  
    END fn_updt_app_jti_dlt_usr;
    
    

    The function called several times as part of a job. Basically, the main function (Say M), call a few functions (for example A1... A9). Each of these functions is to do something and updated the application using the above function. Therefore, each of the nine functions will call the above function with different parameters.

    The problem that I am facing is:

    First run, invoke only first of all for the above function will return the positive result ($sql rowcount > 0). When I run M the second time, only first and second calls for the above function will be to return positive results and so on.

    How odd, it's that if I change the values again and run a function M, it will start from the beginning. And what strange more, the dynamic update statement is executed correctly and data are updated successfully. It's just sql rowcount % do not return is not the expected results.

    I tried to run execute immediately without (begin, end). I also tried to run it without HELP ON. It's always the same. I'm really confused, what Miss me here.

    I don't know if this is relevant. But for what it's worth, invoking the function above updates the SAME lines in the table appery_jti_deleted_users that the columns are different. So for all the work, the same lines need to be updated. Each function (A1... A9) will call the above function to update a different column of these lines.

    If you REALLY want to help you having US SHOW, not tell us:

    1. WHAT you do

    2. HOW to

    3. WHAT results you get

    4. WHAT results you expect to get

    First run, invoke only first of all for the above function will return the positive result ($sql rowcount > 0). When I run M the second time, only first and second calls for the above function will be to return positive results and so on.

    How odd, it's that if I change the values again and run a function M, it will start from the beginning. And what strange more, the dynamic update statement is executed correctly and data are updated successfully. It's just sql rowcount % do not return is not the expected results.

    Perhaps that the foregoing is true and maybe he's not. We have NO WAY of knowing because you don't SHOW US anything.

    I tried to run execute immediately without (begin, end). I also tried to run it without HELP ON. It's always the same.

    Yet once you showed us NOTHING >

    You do NOT FOLLOW best practices when you use dynamic sql statements: the sql statement real so that you can print:

    1 SEE what's running - make sure there are no syntax errors, and it seems to be what you wanted

    2 EXECUTE/TEST manually - to see if he really runs without error and see what results it really give.

    3. FIX any syntax or other problems and retest it

    Instrument properly your code and you won't have the problems you are having.

    You should know by now what are the parameters are transmitted when you run the function. So, there are at least three sets of these parameters.

    So you should be able to:

    1 run the instrumented manually function three times

    2. see that all three SQL statements are

    3 manually run these instructions

    4. see that the number of lines is after each execution

    We have no idea of what the output of the function is every time you call it. Apparently, you have, if you save the results of the function somewhere, but you didn't post any of this info.

    We need real details to help you - just listen to your story is not enough.

  • Is there a parameter that allows to convert customer vectorized on work type supplied when we do not have the correct fonts in our system?

    Is there a parameter that allows to convert customer vectorized on work type supplied when we do not have the correct fonts in our system?

    Try to place the linked files as an object, and then do > flatten transparency with the appropriate settings.

  • How can I get the installer for my application check the operating system type and then install the correct driver type?

    I have a request that I wrote and have been use and distribute for awhile. The installer I created for this application is an additional installer to install a driver for the USB connection. The USB connection is actually a virtual COM Port. The problem is that the people who drafted modified driver setup the installation program itself. They used to have an installer that would check for 32-bit or 64-bit OS and then install the appropriate driver.

    Now, they have two distinct installation programs: one for the other for 32-bit and 64-bit. They let the user know their OS and install the appropriate driver. I'd rather not have to rely on my users to do. From what I've seen the creater Installer provides that an executable to be run after the application installs.

    Is it possible to have the installer of the application, check the type of OS and then run the correct executable file after installing my application? I think that I could write an Installer 'wrapper' that checks the type of operating system then executes the correct Installer. But I expect a better solution.

    Thank you
    Joe

    So, I make it work!

    The trick is to find a way to determine what type of OS you are using. The method I used was, indeed, read the environment variable. A buddy of mine sent me this link:

    http://StackOverflow.com/questions/2401756/how-to-find-if-the-machine-is-32bit-or-64bit One of the phrases he bibliography the Processor_Architecture environment variable.

    It seemed like a reasonable idea. So I started to research how read LV it environment variables turns out, you do it by reading a registry key. There is an example of LV on how to read a registry key. But I did not know where they are in the registry. So, I searched the Processor_Architecture registry. I found it in HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment.

    According to the article in the link, this value will already be x 86 for a 32 bit OS, or something with 64 inside. I just check the response for x 86 string. If it is, I just run the x 86 version of the driver Installer. Otherwise, I run the x 64 version.

    It turned out to be as simple as that.

    I hope this helps someone.

    Joe

  • Cursor autour breaks and clicks in the Middle words or a page, when you type, selects areas of the document when writing and by typing the following key, all this goes away.

    I have Microsoft Windows Vista Home premium, Version 6.0 (Build 6002: Service Pack 2), was Norton Internet Security. Cursor autour breaks and clicks in the Middle words or a page, when you type, selects areas of the document when writing and by typing the following key, all this goes away. Perhaps because of my attempts to resolve this issue, some of my PC system has had problems, it became unstable, I've had several accidents that I got Norton 360, but it don't did me not the solution and stops working, I re installed Norton Internet Security. Please give some answers and advice on how to solve this problem, thank you.

    Hello

    You use a desktop or laptop computer?

    Is the mouse a mouse wired or wireless?

    What is the brand and model of the computer and the mouse?

    If you are using a laptop, I suggest to change the sensitivity of the mouse pad.

    If this is a wireless mouse it might be interference from another close to the mouse. Make sure that speech recognition is not enabled.

  • When I transfer mail, if I click a recipient and hit return, the name of the recipient is replaced by another name in the address book.

    When I transfer the mail on ICC, if I click a recipient and hit back, the recipient's name is replaced by a different name in the address book.

    It's bug and the bug fixers are working on it as soon as possible.

    The error only occurs if you use the key "TAB" or "Enter".
    So if you physically use the mouse to select recipients, and then click on in the other field, etc. - do not use TAB or Enter, then the fault does not occur.
    As an alternative, I highly recommend that you use the following method in the selection of contacts in new e-mail messages or in the transmission of emails.

    In a new message of Scripture
    Use the "Contacts sidebar". See the image below.
    If you do not see, then activate.
    'View' > "Contacts Sidebar" or toggle the view using the f9 key
    Select the address book
    Select the contacts
    Click on the button 'TO Addto' or one of the other options.

  • How do I type that is sent from Firefox when I press Refresh and then return the information in order to retrieve the text lost in a forum post?

    Hello

    Here is my problem

    I wrote a text message in a forum on the website and send it to press.
    Then a new page is loaded to say there was a mistake and I need to on the back button to reload the previous window.

    I know from experience that if I do that I lose all the info I just wrote. However, if I reload page curent, the info is sent again I get a question asking if I want to return the information. Unfortunately the problem then.

    What I want to do is to take the information that is returned, i.e. my text written, so I can just start over and use it again. The info is somewhere around inside the cache of firefox, history, or anything else.

    How can I extract it?

    Firefox version 19.0.2 on windows 7

    Any help is very appreciated!

    Thanks, Thomas

    TextArea Cache extension is what I use.

    https://addons.Mozilla.org/en-us/Firefox/addon/textarea-cache/

  • Shouldn't be using WITH return the same results as if you would first put the results in a table?

    First of all, here is my version info:

    BANNER

    --------------------------------------------------------------------------------

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production

    PL/SQL Release 11.1.0.7.0 - Production

    CORE Production 11.1.0.7.0

    AMT for HP - UX: 11.1.0.7.0 - Production Version

    NLSRTL Version 11.1.0.7.0 - Production

    I just re-read the documentation of the subquery factoring clause of select again and I saw no restriction that applies.

    Can someone help me understand why I get different results?  I would like to be able to use the statement that creates spades3, but for some reason it does not work.  However, when I break up and store the last subquery TMP in a table (MAT1), I am able to get the expected results in MAT2.

    Sorry if the example seems a bit esoteric.  I tried to put something together to help illustrate another problem, so it was more convenient to use the same instructions to illustrate this problem.

    drop table mat1;
    create table mat1 as
    with skus as (
      select level as sku_id
      from dual
      connect by level <= 1000
      ),
      tran_dates as (
      select to_date('20130731', 'yyyymmdd') + level as tran_date
      from dual
      connect by level <= 31
      ),
      sku_dates as (
      select s.sku_id,
      t.tran_date,
      case when dbms_random.value * 5 < 4
      then 0
      else 1
      end as has_changes,
      round(dbms_random.value * 10000, 2) as unit_cost
      from skus s
      inner join tran_dates t
      on 1 = 1
      )
    select d.sku_id,
      d.tran_date,
      d.unit_cost
      from sku_dates d
      where d.has_changes = 1
    ;
    
    
    drop table mat2;
    create table mat2 as
    select m.sku_id,
      m.tran_date,
      m.unit_cost,
      min(m.tran_date) over (partition by m.sku_id order by m.tran_date rows between 1 following and 1 following) as next_tran_date
      from mat1 m
    ;
    
    
    drop table mat3;
    create table mat3 as
    with skus as (
      select level as sku_id
      from dual
      connect by level <= 1000
      ),
      tran_dates as (
      select to_date('20130731', 'yyyymmdd') + level as tran_date
      from dual
      connect by level <= 31
      ),
      sku_dates as (
      select s.sku_id,
      t.tran_date,
      case when dbms_random.value * 5 < 4
      then 0
      else 1
      end as has_changes,
      round(dbms_random.value * 10000, 2) as unit_cost
      from skus s
      inner join tran_dates t
      on 1 = 1
      ),
      tmp as (
      select d.sku_id,
      d.tran_date,
      d.unit_cost
      from sku_dates d
      where d.has_changes = 1
      )
    select m.sku_id,
      m.tran_date,
      m.unit_cost,
      min(m.tran_date) over (partition by m.sku_id order by m.tran_date rows between 1 following and 1 following) as next_tran_date
      from tmp m
    ;
    
    
    select count(*) from mat2;
    select count(*) from mat3;
    
    
      from tmp m
    ;
    

    select count(*) from mat2;
    select count(*) from mat3;
    

    Select count (*) from mat2;

    COUNT (*)

    ----------

    31000

    Executed in 0,046 seconds

    Select count (*) in spades3;

    COUNT (*)

    ----------

    0

    Executed by 0,031 seconds

    Hello

    Khaled says:

    The problem is with

    -case when dbms_random.value * 5<>

    You can change this

    dbms_random. Value (1,100) * 5<>

    and test

    I don't know that I agree 100% with your police department, work there.

    dbms_random. Value, no arguments, returns a random number between 0 (inclusive) and 1 (exclusive), so

    dbms_random. Value * 5< 4 ="" will="" be="" true="" about="" 80%="" of="" the="">

    dbms_randon. Value (1, 100) returns a random number between 1 (included) and 100 (exclusive), so

    dbms_random. Value (1, 100) * 5< 4="" will="" be="" true="" exactly="" 0%="" of="" the="" time,="" which="" is="" not="" what="" op="" wants="" at="">

    The problem here apparently revolves around the optimizer not really call dbms_random over and over again in sku_dates of the subquery.  Add ROWNUM in the subquery seems to force Oracle to assess dbms_random.value immediately.  I don't really understand myself, but adding 1 element in the SELECT of the sku_dates subquery clause could solve the problem:

    create table spades3 as

    with references like)

    Select the level as sku_id

    of the double

    connect by level<=>

    ),

    tran_dates like)

    Select the level + to_date ('20130731', 'YYYYMMDD') as tran_date

    of the double

    connect by level<=>

    ),

    sku_dates like)

    Select s.sku_id,

    t.tran_date,

    -case when dbms_random.value * 5<>

    then 0

    1 other

    end as has_changes,

    Round (dbms_random.value * 10000, 2) as unit_cost

    ROWNUM AS r-<=== new="" column="" added="" here="" new="" column="" added="">

    s SKUs

    inner join tran_dates t

    1 = 1

    ),

    tmp as)

    Select d.sku_id,

    d.tran_date,

    d.unit_cost

    of sku_dates d

    where d.has_changes = 1

    )

    Select m.sku_id,

    m.tran_date,

    m.unit_cost,

    min (m.tran_date) over (partition by order of m.sku_id by m.tran_date rows between 1 next and 1 suite) as next_tran_date

    of tmp m

    ;

    You do not have to refer to this column anywhere; just having him in the subquery is enough.

    If someone can't understand why, I know it.

  • RealTek HD Audio driver "stdriver64.sys" not digitally signed, and update returns the message "everything is up-to-date.

    Hello

    Recently, I checked my RealTek HD Audio drivers and found that the "stdriver64.sys" driver is not digitally signed.  It can be connected to a crash problem that I have known for two weeks now, so I try to update all the drivers and see if it will solve this problem.  When I click on update drivers for RealTek HD Audio, a message returned quickly saying that all drivers are up-to-date.  But again controlled the pilot "stdriver64.sys" shows that it is not digitally signed.  Is there another way to update this driver or another way to take with this?  Thank you for your help.

    Preston

    * original title - RealTek HD Audio driver "stdriver64.sys" not digitally signed and update returns message "everything is up-to-date. How can I solve this? *

    Go to the website of the manufacturer of your computer/laptop > drivers and downloads Section > key in your model number > look for the latest Vista drivers > download/install them.

    See you soon.

    Mick Murphy - Microsoft partner

  • When I look for a file in Win Explorer, I get a list of files in the search results. But some of the files seem to be missing. I get a message that the directory is not found when I try to open the search results.

    I wonder if what's on my hard drive and if what Win Explorer is on my hard drive are two different things.

    If I do a search in Win Explorer to "purple", I get a number of results.
    (To search for a file, I am in the word "Purple" in the search field in the upper right Win Explorer and pressing the "Enter" button).

    There are a couple of JPG files that I wonder about the search results.
    One example is called "purple_flowers.jpg".
    When I double-click this file in the search results to open it, my paint program opens and gives me a message that the directory is not found. If I use MS Paint to try and open it by double-clicking on the file and selecting "open with...". MS Paint", I get a message that the directory is not valid.

    The location of the directory on the error message is the blue 'Images' folder for my user. But, when I opened this file, I don't have a file with that name in this directory. The same thing happens with another JPG file, called "octopus.jpg" when I search the word 'Octopus '.

    Is this something messed up between what I have on my hard drive and think what Win Explorer is on my hard drive?
    How can I fix?
    Something must be reset in Win Explorer?

    I could have the JPG files with these names at the same time. I had a large library of images for a project, but I deleted it.
    (I tried to turn on the option to show hidden files in this directory, but that did not help).

    Imane:

    I thank very you much for that answer.
    But it seems to have stumbled on the solution:

    Strangely, this worked:

    (Maybe you know why).

    I moved the files in my blue images folder in another folder, delete the folder images blue, emptied the Recycle Bin and rebooted my computer.
     
    When my computer has finished its startup routines, my folder of photos blue was there! And he had the shortcut to the folder 'Sample Pictures' inside.
     
    When I searched "the Octopus" and "purple", I no longer saw these JPG files in the search results.
     
    I don't really know what happened, but I thought that after these results just in case someone else knows this.

    I'll read and watch in your information. I don't want to know more about what is happening in my computer.

    Marz

  • [Win7] How routing metric is determined when wired and connected to the same subnet and enabled both wireless adapter

    We have one under the Network Setup:

    1 Win 7 laptop with the wireless and wired adatper1 card1 enabled and connected to the 192.168.1.0 network.

    WLA1 - 192.168.1.2

    WA1 - 192.168.1.3

    2 Win 7 laptop with the wireless and wired adatper2 card2 enabled and connected to the 192.168.1.0 network.

    WLA2 - 192.168.1.4

    WA2 - 192.168.1.5

    WLA1 and WLA2 are connected by a wireless access point.

    WA1 and WA2 are connected via L2 switch.

    Every time we ping from laptop1 to 192.168.1.4, need the wireless path.

    Similarly, when we ping from laptop1 to 192.168.1.5 only need to access wired road.

    In addition, if we disable WLA1 in laptop1 and laptop1 192.168.1.4 ping, ping does not occur and ping is successful only if the wireless network adapter is enabled. It does not take the cable path.

    I just sub questions:

    -On what basis the route is chosen correctly?

    -Can we expect this happens all the time or roads can vary according to certain parameters?

    -Why it only takes the path wired when we ping from laptop1 to 192.168.1.4 after having turned off the WLA1.

    RB

    You will get a more definitive answer on metrics on Technet

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.msdn.Microsoft.com/forums/en-us/home

  • 2 queries must return the same result (but they are not...)

    Hello
    I have a query:
    select col1,extract(year from datum) yr, COUNT(*)
    from tableA@dblink where
    DATUM between '1-jan-1985' and '31-dec-2012'
    and col2 > 100 and col2 not in ('999999')
    and TRIM(TO_CHAR(col1)) in ('0','1')
    group by col1,extract(year from DATUM);
    the query above returns the number: 143 982 for the year 1991
    However, when I put the filter directly in this year the request returns a different number: 143 917
    select col1,extract(year from datum) yr, COUNT(*)
    from tableA@dblink  where
    DATUM between '1-jan-1991' and '31-dec-1991'
    and col2 > 100 and col2 not in ('999999')
    and TRIM(TO_CHAR(col1)) in ('0','1')
    group by col1,extract(year from DATUM);
    Please can you help me understand why what is happening and why these 2 heads are different?
    ID appreciate any advice
    Thank you very much
    Rgds

    Try these...

    select col1,extract(year from datum) yr, COUNT(*)
    from tableA@dblink where
    trunc(DATUM) between to_date('1-jan-1985','dd-mon-yyyy') and to_date('31-dec-2012','dd-mon-yyyy')
    and col2 > 100 and col2 not in ('999999')
    and TRIM(TO_CHAR(col1)) in ('0','1')
    group by col1,extract(year from DATUM);
    
    select col1,extract(year from datum) yr, COUNT(*)
    from tableA@dblink  where
    trunc(DATUM) between to_date('1-jan-1991','dd-mon-yyyy') and to_date('31-dec-1991','dd-mon-yyyy')
    and col2 > 100 and col2 not in ('999999')
    and TRIM(TO_CHAR(col1)) in ('0','1')
    group by col1,extract(year from DATUM);
    
  • Function does not return the correct value

    Hi, I'm having a strange problem and hope someone knows how to solve this problem...

    I try to send a string to a function in another class and do return to a textfield, so I can add it to a movieclip and on the stage. I use it for several buttons. The problem is when I put that a string in it value returns a string for the previous call to the function that is not the string value that I want to use. Here's the function:

    public void replaceMCTxt (mcString:String, xPos:Number,

    yPos:Number, rolloverText:Boolean, newFontSize:uint, height: uint, width: uint = false): {TextField

    var newMCTxt:TextField = new TextField();

    newMCTxt.x = xPos;

    newMCTxt.y = yPos;

    newMCTxt.width = width;

    newMCTxt.height = Height;

    var textFormat:TextFormat = new TextFormat();

    textFormat.align = _gameModel.screenFontAlign;

    textFormat.size = newFontSize;

    textFormat.font = _gameModel.screenFont;

    textFormat.color = _gameModel.screenFontColor;

    newMCTxt.defaultTextFormat = textFormat;

    newMCTxt.text = _languageClass.getTranslation (mcString);

    newMCTxt.selectable = false;

    Return newMCTxt;

    }

    I try to call with this statement in another class:

    _moreGamesTxtField = _updateLanguageClass.

    ("MORE GAMES", _gameModel.moreGamesTxtXPos, replaceMCTxt

    _gameModel.moreGamesTxtYPos, _gameModel.moreGamesTxtWidth,

    (_gameModel.moreGamesTxtHeight, _gameModel.moreGamesTxtFontSize);

    Instead of giving me a movieclip "MORE GAMES", it gives me a 'PLAY' movieclip, which is what the previous call to the function used. I also had a similar problem in another function where he did the same thing with filtering of different buttons, so I think the problem is in the service, but I'm not programmer to know that it's good enough. If anyone has an idea please let me know. Thank you...

    Start the survey using the trace() function to see what value is passed to and returned by some _languageClass.getTranslation ().

Maybe you are looking for

  • How can I make my nightly in the modern user interface? its already my default browser

    Hello im trying to make my night in the metro style, any body can help me?Ive already made my default browser how ever that did not make it work! waiting for an answer, thank you Karim

  • Safari can't open some websites

    When I tried to browse Internet sites like overflow.com battery and etc from safari and chrome, it shows me that the message safari can't connect to the server stack overflow. I am able to access other web sites like Facebook.com, google.com, what wo

  • Non-genuine Windows 7 Home Premium review

    So I downloaded Internet Explorer 9 beta, and before you can download the site is a real testing or whatever and my computer (as he should, his play). So, after downloading, I started the installation and like halfway through installing my screen fla

  • RVS4000 / WRVS4400 VPN routing issue.

    I would like to simplify my installation a bit, but unfortunately I do not know how to do this. I have a triangle of CSB RVS, 2 RVS4000, 1 WRVS4400 devices each router has a VPN gateway to gateway with 2 others, to any one of the 3 sites, you can acc

  • Regexp_substr

    How to get the output below using regexp_substr with t as( select 'APP_CONTACT_INFO' s from dual union select 'APP_CONTACT' from dual union select 'APP_CONTACT_TYPE_100200' from dual ) select s, REGEXP_SUBSTR( S,'_[A-Z]{3}',1) from t; CON CONINF CONT