Get the stage.width before including on DisplayList

Hi!
I have a component, that automatically get the stage.width
and stage.height. But the property stage is not valid until I draw
the component with a addChild method. I would like to get the
stage.width and stage.height properties without needing to include
the component on the DisplayList.
So, two questions:
1. Is there a way to get the stage.width and stage.height
without adding it to DisplayList (with a addChild)?
2. What is my component does not extens a DisplayObject, how
do I get the stage.width?
Thank you,
CaioToOn!

So, any suggestions?
CaioToOn!

Similar Messages

  • Is there any way to get the height/width of an image before importing it in the indesign document.

    Hi All,
    I need to obtain an image's attributes such as dimensions (height, width in pixels) without placing image in indesign document.
    I have full path of the image (say abc.jpg is stored at c:\my pic\abc.jpg).
    I have obtained the IDFile for this image, tried getting size using GetFileSize() which correctly return size in bytes.
    Is there any way to get the height/width of image without importing it in the indesign document.
    Please, give me some hints. I have spent quite a lot time digging in CHM. I have searched in FileUtils, IDFile API's but found no method which serves this purpose.
    At this point I am clueless where to search next.
    Any help will be appriciated.
    Just a point to mention, I am able to get image height and width for an image in indesign doc though Its not my requirement.
    Thnx,
    D.

    You might be able to examine the contents of the PlaceGun after calling kImportAndLoadPlaceGunCmdBoss without actually placing the image in a document. Not sure, but would be worth looking at.
    Otherwise you will probably have to write platform specific code, ideally with a generic platform-independant wrapper (see SDKSamples/paneltreeview/PlatformFileSystemIterator).
    For the Mac, look at CGImageGetWidth() etc., not sure what the best option is for windows.
    Perhaps Quicktime could provide you with a platform independant solution.

  • Loading flash 8 SWF in adobe AIR, loses the stage width in flash 8 SWF

    Currently i am using a CS3 IDE to compile AIR application.I
    am trying to load the flash 8 SWF inside my AIR application.After
    loading the SWF, when i try to trace the stage width inside the
    flash 8 SWF , it says undefined.Not sure why..
    Googling few hours not able to get the solution.
    Please help me on this, urgently needed.
    Thanks in advance

    This is a fairly common question on these forums. Basically,
    AS2 and AS3(Flex/AIR) can't communicate directly. You will either
    need to use LocalConnection or use ExternalInterface and javascript
    to pass info between the 2.

  • How can I get the image width and height stored in database?

    Hi!I write s servlet to display images store in database.but how can I get the image width and height?

    Have you tryed using PJA or a similar library?
    I presume you get java.lang.NoClassDefFoundError on the line :
    Toolkit.getDefaultToolkit();?

  • [CS2]How to get the Image Width & Height using JS (ILLUSTRATOR CS2)

    Hi,
    How to get the Image width & height of an Image using javascript .Im using Illustrator CS2.
    Any sample code
    Regards
    MyRiaz

    you can reference the dimensions of a loading image (or swf)
    by referencing the target movieclip's dimensions AFTER loading is
    complete. ie, use preloader code or the onLoadInit() method of a
    moviecliploader listener.

  • Where do i get the qualifying product before installation of the new one

    where do i get the qualifying product before installing the cs6 product

    What product are you trying to install?  It sounds as if you have purchased an upgrade?  If that is the case then you would need to have a qualifying previous product in order to install successfully.  What software are you upgrading from?  Finally what operating system are you using?

  • How do i get the max width and height?

    Hey
    I want to get the max width and height, so my desktoppanes size can be set automatically.
    I know i should use getBounds but i cant find a concrete example on goole, on how to use it.
    Can someone point me in the right direction, with an example?

    Ok, assuming you want to get the screen resolution, i.e. 1024 x 768.
    You will need these imports:
    import java.awt.Dimension;
    import java.awt.Toolkit;and this line of code:
    Dimension myScreen =  Toolkit.getDefaultToolkit().getScreenSize() ;You can now use myScreen.width and myScreen.height to access the height and width of your screen's resolution. (width = 1024, height = 768 in my case)
    Hope this helps,
    Stern
    Edited by: Stern on Apr 13, 2008 6:49 AM

  • Getting the html content before browser displays it

    Hi,
    I have a nagging problem which i am trying hard to solve.
    I have a jsp file which gets hundreds of rows from database. I want to capture the html content before the browser displays that. How can I achieve it. ?
    Please tell us the solution as soon as possible. we have stopped the work.
    Thanks & Regards,
    A S N Murthy
    [email protected]
    [email protected]

    Hi !
    continuing with my previous mail...
    Is it okay with you if you use save the Data to be rendered in an XML ? (if you just need all the data).
    You've written you will have "hundreds of rows from database".
    In case you think of saving the data in an XML format, you can have all that data in a structured manner on the server side. And later you could use the XML file in any way you want. i.e. convert it into an html using xalan, etc. or use the XML file to access the data instead of a DB transaction all over again...
    I guess this might be a better approach than saving the HTML that will be generated by the JSP.
    Anyway, it depends on your requirement.
    regards,
    Rahul C Tiwary

  • Getting the JScrollPane width

    Hi all,
    I have created a JScrollPane into which I have added a JTable. However, I have two issues regarding column size:
    1. When the table is created, the columns do not take up a full row. I have set setAutoResizeMode(JTable.AUTO_RESIZE_OFF]; and instead, run a method that I created that automatically sets the size of each column based on the selected tree node. However, as soon as the columns are resized to my size, they are automatically resized back to their default small size. This only happens the first time when I'm loading the program.
    2. To resize the columns, I need the width of the JScrollPane. I use the following to get the width: messageList.getViewport().getWidth(); However, the width that is returned is a little bit wider than the JScrollPane width. I've tried subtracting the Insets widths from that, but didn't have any luck.
    Can someone suggest anything? My code for creating the JTable and resizing the columns is below.
    Please note that I call resizeMessageListColumns() from the method to which the JScrollPane is returned.
    *** Code that creates the JTable ***
    * Insert the method's description here.
    * Creation date: (8/17/2002 4:22:14 PM)
    * @return javax.swing.JTable
    public JTable createMessageList( String title )
         tableNames = setMessageListHeader(title);
         tableData = setMessageListData(title);
        // Create a model of the data.
         dataModel = new MailTableModel(tableData,tableNames);
        // Create the table
        tableView = new JTable(dataModel);
         // Show colors by rendering them in their own color.
        DefaultTableCellRenderer colorRenderer = new DefaultTableCellRenderer()
              public void setValue(Object value)
                 if (value instanceof Color)
                     Color c = (Color)value;
                     setForeground(c);
                     setText(c.getRed() + ", " + c.getGreen() + ", " + c.getBlue());
        tableView.setRowHeight(12);
        tableView.setBackground(Color.white);
        tableView.setColumnSelectionAllowed(false);
        tableView.setRowSelectionAllowed(true);
        tableView.setCellSelectionEnabled(false);
        tableView.setShowVerticalLines(false);
        // turn off autoresize
         tableView.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        return tableView;
    }*** Resize the Rows ***
    * Insert the method's description here.
    * Creation date: (8/18/2002 11:50:48 AM)
    public void resizeMessageListColumns(String currentNode)
         // The total number of columns in this folder
         int numColumns = 0;
         // Total width available
         int totalWidth = messageList.getViewport().getWidth();
         // Remaining available width
         int remainingWidth = totalWidth;
         // absolute widths
         int[] finalWidths = new int[0];
         // Define Column Widths
         final double[] INBOX_COLUMN_SIZES =          { 20, 20, 0.30, 0.50, 20, 0.10, 0.10 };
    //                                                       {"Pr","Fg","Sender","Subject","At","Date","Size"};
         final double[] SENT_COLUMN_SIZES =          { 20, 0.30, 0.50, 20, 0.10, 0.10 };
    //                                                       {"Pr","Recipient","Subject","At","Date","Size"};
         final double[] DELETE_COLUMN_SIZES =     { 20, 0.30, 0.50, 20, 0.10, 0.10 };
    //                                                       {"Pr","Sender","Subject","At","Date","Size"};
         final double[] DRAFT_COLUMN_SIZES =          { 20, 20, 0.30, 0.50, 20, 0.10, 0.10 };
    //                                                       {"Pr","Fg","Recipient","Subject","At","Date","Size"};
         final double[] DEFAULT_COLUMN_SIZES =     { 20, 20, 0.30, 0.50, 20, 0.10, 0.10 };
    //                                                       {"Pr","Fg","Sender","Subject","At","Date","Size"};
         // now calculate aboslute widths of relative widths
         for (int i=0; i<numColumns; i++)
              if (INBOX_COLUMN_SIZES[i] < 1) // if this is an absolute size
                   finalWidths[i] = (int)(INBOX_COLUMN_SIZES[i] * totalWidth);
                   remainingWidth = (int)(INBOX_COLUMN_SIZES[i] * totalWidth);
         // Calculate Column Widths
         if (currentNode.equals(INBOX_TITLE))
              numColumns = INBOX_COLUMN_SIZES.length;
              // array where final widths are stored
              finalWidths = new int[numColumns];
              // now, start determining the size of the columns
              // this does not yet return the final size of each column
              // but only calculates the remaining width
              for (int i=0; i<numColumns; i++)
                   if (INBOX_COLUMN_SIZES[i] >= 1) // if this is an absolute size
                        remainingWidth -= (int)INBOX_COLUMN_SIZES;
                        finalWidths[i] = (int)INBOX_COLUMN_SIZES[i];
              totalWidth = remainingWidth;
              // now calculate aboslute widths of relative widths
              for (int i=0; i<numColumns; i++)
                   if (i == (numColumns-1))
                        finalWidths[i] = remainingWidth;
                   else if (INBOX_COLUMN_SIZES[i] < 1) // if this is an absolute size
                        finalWidths[i] = (int)(INBOX_COLUMN_SIZES[i] * totalWidth);
                        remainingWidth -= (int)(INBOX_COLUMN_SIZES[i] * totalWidth);
         else if (currentNode.equals(SENT_TITLE))
              numColumns = SENT_COLUMN_SIZES.length;
              // array where final widths are stored
              finalWidths = new int[numColumns];
              // now, start determining the size of the columns
              // this does not yet return the final size of each column
              // but only calculates the remaining width
              for (int i=0; i<numColumns; i++)
                   if (SENT_COLUMN_SIZES[i] >= 1) // if this is an absolute size
                        remainingWidth -= (int)SENT_COLUMN_SIZES[i];
                        finalWidths[i] = (int)SENT_COLUMN_SIZES[i];
              totalWidth = remainingWidth;
              // now calculate aboslute widths of relative widths
              for (int i=0; i<numColumns; i++)
                   if (i == (numColumns-1))
                        finalWidths[i] = remainingWidth;
                   else if (SENT_COLUMN_SIZES[i] < 1) // if this is an absolute size
                        finalWidths[i] = (int)(SENT_COLUMN_SIZES[i] * totalWidth);
                        remainingWidth -= (int)(SENT_COLUMN_SIZES[i] * totalWidth);
         else if (currentNode.equals(DELETE_TITLE))
              numColumns = DELETE_COLUMN_SIZES.length;
              // array where final widths are stored
              finalWidths = new int[numColumns];
              // now, start determining the size of the columns
              // this does not yet return the final size of each column
              // but only calculates the remaining width
              for (int i=0; i<numColumns; i++)
                   if (DELETE_COLUMN_SIZES[i] >= 1) // if this is an absolute size
                        remainingWidth -= (int)DELETE_COLUMN_SIZES[i];
                        finalWidths[i] = (int)DELETE_COLUMN_SIZES[i];
              totalWidth = remainingWidth;
              // now calculate aboslute widths of relative widths
              for (int i=0; i<numColumns; i++)
                   if (i == (numColumns-1))
                        finalWidths[i] = remainingWidth;
                   else if (DELETE_COLUMN_SIZES[i] < 1) // if this is an absolute size
                        finalWidths[i] = (int)(DELETE_COLUMN_SIZES[i] * totalWidth);
                        remainingWidth -= (int)(DELETE_COLUMN_SIZES[i] * totalWidth);
         else if (currentNode.equals(DRAFT_TITLE))
              numColumns = DRAFT_COLUMN_SIZES.length;
              // array where final widths are stored
              finalWidths = new int[numColumns];
              // now, start determining the size of the columns
              // this does not yet return the final size of each column
              // but only calculates the remaining width
              for (int i=0; i<numColumns; i++)
                   if (DRAFT_COLUMN_SIZES[i] >= 1) // if this is an absolute size
                        remainingWidth -= (int)DRAFT_COLUMN_SIZES[i];
                        finalWidths[i] = (int)DRAFT_COLUMN_SIZES[i];
              totalWidth = remainingWidth;
              // now calculate aboslute widths of relative widths
              for (int i=0; i<numColumns; i++)
                   if (i == (numColumns-1))
                        finalWidths[i] = remainingWidth;
                   else if (DRAFT_COLUMN_SIZES[i] < 1) // if this is an absolute size
                        finalWidths[i] = (int)(DRAFT_COLUMN_SIZES[i] * totalWidth);
                        remainingWidth -= (int)(DRAFT_COLUMN_SIZES[i] * totalWidth);
         else
              numColumns = DEFAULT_COLUMN_SIZES.length;
              // array where final widths are stored
              finalWidths = new int[numColumns];
              // now, start determining the size of the columns
              // this does not yet return the final size of each column
              // but only calculates the remaining width
              for (int i=0; i<numColumns; i++)
                   if (DEFAULT_COLUMN_SIZES[i] >= 1) // if this is an absolute size
                        remainingWidth -= (int)DEFAULT_COLUMN_SIZES[i];
                        finalWidths[i] = (int)DEFAULT_COLUMN_SIZES[i];
              totalWidth = remainingWidth;
              // now calculate aboslute widths of relative widths
              for (int i=0; i<numColumns; i++)
                   if (i == (numColumns-1))
                        finalWidths[i] = remainingWidth;
                   else if (DEFAULT_COLUMN_SIZES[i] < 1) // if this is an absolute size
                        finalWidths[i] = (int)(DEFAULT_COLUMN_SIZES[i] * totalWidth);
                        remainingWidth -= (int)(DEFAULT_COLUMN_SIZES[i] * totalWidth);
         // set column widths
         for (int i=0; i<numColumns; i++)
              tableView.getColumnModel().getColumn(i).setMinWidth(finalWidths[i]);
              tableView.getColumnModel().getColumn(i).setPreferredWidth(finalWidths[i]);
              tableView.getColumnModel().getColumn(i).setMaxWidth(finalWidths[i]);
    //     tableView.repaint();

    Hi,
    I solved the second problem. All I did was change the autoresize to      setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);.
    However, I still have the first problem.
    Thanks for your help in advance.

  • I can only open one PDF in session. If I try to open a different one, I get the same as before. The only way to see a different PDF is to close the browser and start over. A bit hassle with sites requiring a password.

    Many web sites have links to multiple PDF files. I have no trouble reading the first PDF file, but if I try to open a different one, I always get the first one I opened. Firefox ignores the other links and goes back to the first one. The only remedy seems to be to close Firefox and start over again. This is a hassle for sites requiring a username and password to enter. What's wrong here?

    Do you have Adobe Reader X or Adobe Reader 9.something?
    I think this is a problem with the newest version of Adobe Reader which came out about 5-6 days ago.

  • Since updating th Ff 4, instead of getting my Google home page, I get the following (Twice) before the Google page

    I get 2 error messages which I have to click OK on before I get to the Google page, then my Norton 360 log-in is no longer there.
    I give up - back to internet explorer, where at least my Norton 360 sign-ins still work.

    I get 2 error messages which I have to click OK on before I get to the Google page, then my Norton 360 log-in is no longer there.
    I give up - back to internet explorer, where at least my Norton 360 sign-ins still work.

  • The Dinosaur is Dieing, How to I get the files over Before it's Extinct?!?

    The hunk-o-junk is on it's death bed (YES!).
    Unfortunately:
    The computer freezes up every time we try to make backup CDs
    The computer is too old (MSFT WINDOWS 98) to send the stuff wirelessly.
    Don't think it has any ethernet connectivity
    We've got too many photos and other files that sending files via email wouldn't be practical.
    I've got a MacBook that I can try and play around with a few things, but as of right now, I need some help.
    D:M

    The computer is so old, that it doesn't even recognize the USB drive.
    Luckily, the old computer has AIM and the MacBook has iChat, so I've started transfering files manually.
    D:M

  • My ipad is saying ipad disabled connect to itunes. so I connected to itunes. i have already done the recovery and am still getting the same message before. Someone please help me!

    I have already tried to recover my ipad but it still keeps coming up that it is disabled and to connect to itunes. When i go to itunes it says that I require to put my passcode in on my ipad but i cant because its still disabled. Please help, I have no clue where to go from here. I though by recovering it that it would work but it didn't. Help! Thanks in advance.

    Did you do this?
    Recovery Mode:
    1. Turn off iPad. Press and hold the Sleep/Wake button for a few seconds until the red slider appears, slide to turn off.
    2. Connect USB cable to computer; leave the other end alone
    3. Press and hold the Home button down and connect the docking end of cable to iPad
    4. Continue holding the Home button until you see the "Connect To iTune" screen
    5. Release the Home button
    6. Open iTune (make sure you have the newest version of iTune)
    7. You should see "iTunes has detected an iPad in recovery mode"
    8. Use iTune to restore iPad
    Note: You need to be patient and repeat the above many times to recover your iPad

  • How to get the record count before fetch

    CREATE PACKAGE demo_cur_pkg AS
    TYPE EmpName IS RECORD (name VARCHAR2(10));
    TYPE cur_type IS REF CURSOR RETURN EmpName;
    PROCEDURE open_emp_cur (
    curs IN OUT cur_type,
    dept_num IN NUMBER);
    END;
    CREATE PACKAGE BODY demo_cur_pkg AS
    CREATE PROCEDURE open_emp_cur (
    curs IN OUT cur_type,
    dept_num IN NUMBER) IS
    BEGIN
    OPEN curs FOR
    SELECT ename FROM emp
    WHERE deptno = dept_num
    ORDER BY ename ASC;
    END;
    END;
    After this package has been stored, you can open the cursor curs by calling the open_emp_cur stored procedure from your Pro*C/C++ program, and FETCH from the cursor in the program. For example:
    sql_cursor emp_cursor;
    char emp_name[11];
    EXEC SQL ALLOCATE :emp_cursor; /* allocate the cursor variable */
    /* Open the cursor on the server side. */
    EXEC SQL EXECUTE
    begin
    demo_cur_pkg.open_emp_cur(:emp_cursor, :dept_num);
    end;
    EXEC SQL WHENEVER NOT FOUND DO break;
    for (;;)
    EXEC SQL FETCH :emp_cursor INTO :emp_name;
    printf("%s\n", emp_name);
    Any solutioon is welcome

    Fail to understand why you want to introduce exception processing - e.g. use methodA for less than 10,000 rows and use methodB for 10,000 and more.
    Why not use methodC - optimal support for fetching, irrespective of whether there are 1 row to fetch, or a 100,000 rows?
    There is no best way for fetching a small number of rows versus a different best way for fetching more rows. There is a single optimal method - and this remains the same irrespective of the number of rows being returned.

  • How do I get the applicationbadge count to include subfolders?

    When I have new email in my root-inbox the application badge shows the count of those. But when new mail is automatically filtered their count disappeares from the application badge, making the number on the application potentially make me miss critical information. For the time being I have rules inactivated to avoid the disaster :)
    Is this possible to achieve?

    Hi,
    Have you clicked the Advanced Button within this dialog and ticked the Drop Down and Expanding text options?
    Regard,
    Dom.

Maybe you are looking for

  • Windows 8.1 fails to boot

    HP ENVY dv7t-7200 CTO Notebook PC - Unable to boot Win8. Error: "0xc0000098". "The boot configuration data file doesn't contain valid information for an operating system". I had installed easyBCD 2.1.2 to dual boot win 7 and win 8.1

  • Applications stuck loading.

    Four applications on my iPod Touch are stuck "loading." What I mean is that I downloaded them off of the app store through the iPod a day ago, and since then they've just sat there with their loading bars empty, with "Waiting" underneath them. I can'

  • Making a component to view my Own Map !!

    Dear all, I am developing a website with jsf and richfaces, but now, I'm in a state that I need to show a detailed map of my city to the user. I looked around to find a component that make it work, but I couldn't find one! Is there anyway to show my

  • INDEX GETTING UNUSABLE

    Hello everybody, I'm using Oracle 9i and I'm getting below error when I execute a anonymous block which runs through the cursor and updates the table. ORA-01502: index 'ASAP.PK_STATUS_NO' or partition of such index is in unusable state select query o

  • Clip info lost on import

    I'm shooting XDCAM EX 720p50 footage with EX1R. I've been trimming the inevitable rubbish from the beginning and end of my clips as well as adding notes and changing the Index Picture with Sony Clip Browser but when I import to FCP with Log and Trans