I can't obtain the stage's sizes

Situation:
I've got 2 swf files, 1 is a preloader which loads the 2nd swf file, my site.
Both of them, if started separately, work correctly.
Problem:
when I put the files together, linking the site's swf to the preloader, I get a  null element error and the site loads not correctly.
What I've understood:
The preloader is ok, because I can remove the error message working on the site's swf AS code.
In the preloader's code I have some lines to center its animation on the stage, I do that like this:
import flash.display.Stage;
var myStage:Stage = this.stage;
then using myStage.stageWidth and myStage.stageHeight I calculate the clip position
Also on the site's code I do the same to center a movieclip using exactly the same code, but it doesn't work and I've found that the problem is the myStage variable, not because it has the same name as the variable on the other file (I've tried to name it myFrame).
It looks that on the site's swf the myStage variable can't be assigned and then results to be null.
Question:
How can I obtain the stage's height and width since
var myStage:Stage = this.stage;
doesn't work?

Hi Kumidan,
As far I have understood, you want to know the stage dimensions in order to center movie clips.
Whether on your preloader or your site SWF.
I am a beginner in AS3 but the way you create a new instance of the stage is weird.
Your movie can only have one stage.
Why dont you add a listener to the stage.
Here is something in AS3  :
stage.addEventListener(Event.RESIZE, resizeHandler);    // adding the listenener
resizeHandler (null);    // initializing value
function resizeHandler (event:Event):void
var sw:Number = stage.stageWidth;
var sh:Number = stage.stageHeight;
blahblahblah   // code that place your clips according to the stage dimensions sh and sw

Similar Messages

  • How Can I obtain the tables of one schema and the record size???

    How Can I obtain the tables of one schema and the record size???
    Example:
    TableName Record Size
    Tabla1 12500
    Tabla2 7800
    Tabla3 2046

    This is not an OWB question, but you can obtain bda-type information on tables by using the system view dba_tables.
    Regards:
    Igor

  • How can I expand the stage (in one direction) on rollover? Or click?

    Hello,
    I'm looking to create an expanding/collapsing HTML5 banner using Edge Animate.
    For example, say I start with a 728x90 banner. How can I make the stage expand (from the bottom edge) to 728x270?
    At the moment I'm looking to expand on rollover then collapse back to original stage size on rollout - but in the future I know I'll want the same functionality using a button.
    All help is appreciated, thank you!

    I am on the go for the day but here is a quick routine, using the toggle() method.
    In your case you can't collapse the etage to 0, otherwise you have no way of getting to the second click.
    In my exmple, click anywhere on the stage, it collapses to the minHeight value of 15.
    Click it again and it restores to the predefined height of the stage.
    var minHeight = 15;
    var myStageHeight = sym.$("Stage").css("height");
    sym.$("Stage").toggle(function(){                    // run on first click of Stage
        sym.$("Stage").animate({height: minHeight}, 500 );
    }, function() {                                                   // run the second click of Stage
        sym.$("Stage").animate({height: myStageHeight}, 500 );
    If you are going to apply to an element, say a button, then its going to require you to move (flow) the button to the collapsed position.
    I'll play with that notion later, when I get back.
    Try the above
    hth
    Darrell

  • FAQ: UI - How can I change the color theme, size of the text, or turn off the application frame?

    CHANGING THE INTERFACE COLOR SCHEME:
    The Photoshop CS6 default interface is dark, but if you prefer the lighter interface you are used to from earlier versions,
    you can change it back in the appearance area. There are 4 default color themes.
    Mac          Photoshop > Preferences > Interface
    Windows   Edit > Preferences > Interface
    CONFIGURING LARGER FONTS:
    For those who need larger fonts, you can also change the UI Font Size down in the type area.
    Be sure to restart Photoshop to see the changes.
    TURNING OFF THE APPLICATION FRAME
    CS6 opens now by default in "Application Frame". You can go Window>Application Frame in the main meu and uncheck this

    Select the title / text and then click on the "i" (inspector). A colored pin wheel shows up after you click on the square box directly below the font settings inside the inspector window. Then simply drag the dot to the color you want. Like this:
    click here
    Message was edited by: SDMacuser

  • If I have my product code and cd for Adobe Creative Suite 5 can I obtain the serial number?

    If I have my product code and cd for Adobe Creative Suite 5 can I obtain the serial number? I had the serial number on my college email which I can't access now that I've graduated.

    adobe support might be able to help you,
    contact adobe support, https://helpx.adobe.com/contact.html

  • How can I obtain the primary key of a table for an entity relation?

    hello everybody
    I am doing a consultation to a table in my data base, good this table has alone two fields, the first one is the code or pk and the second one is the description, to be presisos they are names of city and code.
    From the beginning!!: This method this one in another class that is a Dialog that is going to call to the class SelecPlace ();
      SelecPlace sl = new SelecPlace();
    public void capturarLugar(){  //  Simple void method in the mentioned class
            String place = txtProcedencia.getText() ;  //  a JTextField
            sl.executeStatement(place) ;                  
        }ok, now we see part of the code of the class SelectPlace
    public class SelecPlace extends AbstractTableModel{
        Connection con = null;
        Statement sentencia = null ;
        ResultSet rs = null;
        ResultSetMetaData rsmd = null ;
        String[] nameColum = {} ;
        Vector datos = new Vector() ;
        public SelecPlace() { }
        public void executeStatement(String query){
          try{
             con = DBManager.getConnection() ;
             sentencia = con.createStatement(rs.TYPE_SCROLL_INSENSITIVE,
                                                                          rs.CONCUR_UPDATABLE) ;
             String sql = "select * from Place where descripcion like %"+query+"%'";
              rs = sentencia.executeQuery(sql) ;
              rsmd = rs.getMetaData();
              int nroColumnas = rsmd.getColumnCount() ;
              nameColum = new String[nroColumnas] ;
              //obtengo los nombres de columnas en cache
               for(int colum = 0; colum < nroColumnas; columna++){
                    nameColum[colum] = rsmd.getColumnLabel(columna + 1) ;
               datos = new Vector();
                while(rs.next()){
                    Vector newRow = new Vector();
                    for(int i = 0; i < getColumnCount(); i++){
                    newRow.addElement(rs.getObject("place_ID"));
                    newRow.addElement(rs.getObject("description"));
                    datos.addElement(nuevaFila);
                fireTableChanged(null);
            }catch(SQLException e){
                System.err.println(e);
                e.printStackTrace(System.err);
                System.out.println("error in statement");
            }catch(ClassNotFoundException cnfe){
                System.err.println(cnfe);
        }Ok, this code me works and I obtain in this case the field description of the table Place
    Now my question is, how can I obtain the primary field of my table?
    I need this value of this field that in the base of information in a bigint, and to take it to the first class before mentioned, for that I am working with a data base related

    Certain duffymo and everyone!!, good I give you my scheme:
    And generalizing my question, I want to obtain the value of the primary key of a table in the database, I obtain more values of the same row, but I need the primary key, and you see one with the primary key I want to turn a Long and it to insert with code java in foreign clave in another table of the database
    Good of this form I believe that it would not be breaking the integrity relacional of the tables

  • Trying to install Acrobate 8 Standard on PC with Windows 7, 64 bit. During the installation I was asked to provide "File Adobe PDF.dll for Windows Vista. How can I obtain the required file?

    Trying to install Acrobate 8 Standard on PC with Windows 7, 64 bit. During the installation I was asked to provide "File Adobe PDF.dll for Windows Vista. How can I obtain the required file?

    Nothing in the Acrobat 8.x product family is compatible with Windows 7 (or any contemporary OS).
    The Acrobat 8.x product family passed into End of Support way back -- (November 2011).
    The current release of Acrobat (XI) is compatible in Windows 7.
    Be well...

  • How can I obtain the value of a database column in a JSP variable ?

    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

    Try something like
    String cnt = c1.getRowSet().getCurrentRow().getAttribute("Cont").toString();
    -A
    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

  • Hi,  I lost my serial number for PS Elements11 following computer crash. Os is W7. I have the cd installation disc but there is no serial number with it or in the envelope  ..  How can I obtain the serial number please?     Thanks

    I lost my seriel number for PS Elements 11 following computer crash. Os is W7
    Peter Jones Aug 27, 2014 5:36 AM   
    Hi,
    I lost my serial number for PS Elements 11 following computer crash. Os is W7. I have the cd installation disc but there is no serial number with it or in the envelope
    How can I obtain the serial number please?
    Thanks

    If you registered the software you should be able to find the serial number thru your Adobe account online.
    To locate the serial number:
    http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • How can I know the output Image Size of any image with a variable

    I'm having problems with a filter I am writing because I can't enter the output image size(x and y) in a filter without doing it manually with a parameter

    yes, that is currently the only way, but we do realize that it is an issue and are working on solutions.
    thanks!

  • How can I determine the number and sizes of redologs?

    Dear all,
    How can I determine the number and sizes of redologs are sufficient to allow redo log switching while hot backup is in progress?
    Please advice,
    Amy

    Two questions here - what the OP put as the subject title and what was asked in the thread, which are different questions.
    I would interpret the question in the thread to mean "how to avoid hanging due to archiving waiting for a redo log group to become available." Alert log, wait events, and user complaints would be the source of information here.

  • How can i change the position and size of the applet

    dear fellows,
    how can i change the position and size of the applet in which form is running over the web.
    thanx
    Mochoo

    Yes, you can add the following line to your formsweb.cfg section :
    HTMLbodyAttrs=onLoad='javascript:self.moveTo(100,100)'
    if you are in SEPERATEFRAME = FALSE
    Or Set_Window_Property( FORMS_MDI_WINDOW, POSITION, X, Y ) ;
    if you are in SEPERATEFRAME = TRUE

  • Can we change the initial extent size of tablespaces

    Hi All,
    Can we change the initial extent size of tablespaces.
    Oracle version-11.2.0.1
    OS - IBM AIX
    Please suggest.
    Thanks and Regards,

    There is no way to redefine the initial extent but by dropping/recreating it. But you can try to deallocate the unused space beyond the High Water Mark (alter table table_name deallocate unused keep 0;), as shown on the next demo:
    Madrid @ Re: Resizing initial extent
    Regards
    Girish Sharma

  • HOW CAN I VIEW THE PHOTOS FULL SIZE

    HOW CAN I VIEW THE PHOTOS FULL SIZE,I click on view slide show but only stay in that mode for 5 seconds

    Hi Sandy,
    The slideshow in Starter Edition has very basic functionality. To be able to create a slideshow with music and other advanced options, you would need to use Photoshop Elements Software.
    ~Vibha~

  • How can I obtain the resources in jar?

    How can I obtain the resources in jar if the class that to want this resource is static?
    I don't succeed use like:
    getClass().getResourceAsStream("/" + name)
    because my class is static.
    Thaks

    You could do this
    new Object().getClass().getResourceAsStream("/" + name)
    or
    Object.class.getResourceAsStream("/" + name)

Maybe you are looking for