Can't get stage from a constructor method. Why?

Hi,
I'm making a kind of image showcase, what has a fluid width and height, depending on browser window dimensions. Everything is okay, I have other kind of issue: in constructor function in this gallery class I can't use stage property, I have to get it from main class.
Why Flash treats me this way and how I can avoid this currentStage variable?
Main code:
package dev {
     import flash.display.Sprite;
     import flash.display.StageScaleMode;
     import flash.display.StageAlign;
     import flash.display.MovieClip;
     import flash.events.Event;
     import UI.BackgroundImageRotator;
     public class Application extends Sprite {
          public function Application():void {
               stage.scaleMode = StageScaleMode.NO_SCALE;
               stage.align = StageAlign.TOP_LEFT;
               trace("Start.");
               var BIR = new BackgroundImageRotator(stage);
               stage.addChild(BIR);
BackgroundImageRotator class:
package UI {
     import flash.display.MovieClip;
     import flash.events.Event;
     import flash.display.Stage;
     public class BackgroundImageRotator extends MovieClip {
          protected var currentStage:Stage;
          public function BackgroundImageRotator(currentStage:Stage):void {
               this.x = 0;
               this.y = 0;
               this.currentStage = currentStage;
               currentStage.addEventListener(Event.RESIZE, onStageResize);
          protected function onStageResize(evt:Event):void {
               trace(stage.stageWidth + ' ' + stage.stageHeight);

if you have a display object that will be added to the display list, you need to wait until it is added before you can reference its stage property.  ie, use the Event.ADDED_TO_STAGE event.
otherwise, you must pass a stage reference to your class.

Similar Messages

  • Found an error related to "can't get video from Camera"

    So, I am back with the same issue: it is now 3-4 months I can't Video chat because iChat AV tells me "can't get video from camera". I disable the firewall (for the test), I forwarded nearly ALL the TCP and UDP packets from my router to the mac, I stopped any application such as PostgreSQL or others which might interfeer. I checked I didn't have any strange firewall rules still on even when switched of from UserPreferences (sudo ipfw list)...
    Well, I can see myself with the camera but it won't get the image of the party I am connecting to. So... I looked in the console and:
    2006-03-04 19:09:14.926 iChat[9245] WARNING: Freeze-frame failed: couldn't get local buffer for layer Local!
    Each time, this is the message.
    I did the downgrade Quicktime test I also reinstalled the combined update... nothing worked.
    It seems CRAZY that nobody at Apple can at least tell me WHERE to have a look. After all the message is not very clear. Where is the problem? My mac, my router, iChat?
    I filed a bug BTW... because it DID work in the past and now stoped working, so my netgear router can't be in fault (I also checked the logs of the router and of the firewall... nothing seemed to be stoped)
    Alex

    Hi Alexander,
    Defcom aslo has a Netgear And I will let him come back on that side.
    On the error front iChat has about 4 standard messages.
    1) User did not Respond.
    2) Insufficient Bandwidth.
    3) Can not get Video from Camera
    4) Did not get data for 10 secs
    Unfortunately the causes can overlap, hence the lack of Ahaa !!
    The most common feature of all of them is something to do with the way the routing devices are set up.
    This leads us to start with the LAN set up,
    The ports that are open,
    the method used to open them,
    Whether DHCP is being used with Port Forwarding as the IP can change to your computer and the Port Forwarding point to the "wrong" IP
    How many devices are in the link to the Internet ?
    IF you are doing NAT (Port Forwarding or Port Triggering) ?
    Whether your ISP has started dong NAT to your service
    Whether they offer a SIP based Service like VoIP phones.
    11:29 PM Monday; March 6, 2006

  • Can we get data from business views  in CR 2008/XI?

    Hi All,
    Can we get data from business views  in CR 2008/XI?
    If its possible, pls let us know how to get connect with Business View in both of these versions and what is the tool that we have to use to create Business Views.
    Thank you,
    Krishna Pingali

    Hi Krishna,
    Crystal Reports/BusinessObjects Enterprise ( BOE ) Business Views can only be created using the BV build which comes with BOE and installed using the Work Station installer for BOE. for both XI and 2008.
    You cannot mix these two versions on the same PC not can one talk to the other, the BV designer must match the same version as BOE. XI ( version 11.0 ) is no longer available but if you mean XI R2 ( version 11.5 ) then it still is.
    It's not completely clear which Business View you are referring to? BOE has a Business View Designer so not sure if this is just a naming problem or not? If you are referring to the BOE Business View Designer then the above is true. If your reference is about some other BV designer or data source then you need to clarify.
    Contact our Sales department for pricing and availability.
    Thank you
    Don

  • How can I get values from listbox?

    Hi all,
    I need to get price values from Price List (Inventory -> Item Master Data screen). It's important to get values from field 'Price' BEFORE item will be added/updated.
    How can I get values from Pricelist listbox?
    Thanks for any suggestions or short sample code.
    Best regards,
    Andy

    Hi Andy
    Here is som sample code that will get the description of the price list and also the price that is displaying at the time. The item master must be open for this snippet of code
      Public Sub GetItemPriceFromOpenWindow()
            'this is assuming item master is open
            Dim oEdit As SAPbouiCOM.EditText
            oEdit = SBO_Application.Forms.GetForm("150", 1).Items.Item("34").Specific
            SBO_Application.MessageBox(oEdit.Value)
            Dim oCmb As SAPbouiCOM.ComboBox
            oCmb = SBO_Application.Forms.GetForm("150", 1).Items.Item("24").Specific
            SBO_Application.MessageBox(oCmb.Selected.Description)
        End Sub
    Hope it helps

  • HT203167 lost my hard drive how can i get songs from ipod back to new computer

    I lost my hard drive and want to get my music back on my new computer. How can I get songs from my ipod to my computer? I am afraid to sync it and losing what is on my ipod. Any help would be appreciated.

    It has always been very basic to always maintain a backup copy of your computer for this very occasion.
    Use your backup copy to put everything back.
    If for some reason you have failed to maintain a backup, not good, then you can transfer itunes purchases from your ipod:  File>Transfer Purchases

  • How can I get Data from the Sound cart in Labview? Does a VI exist?

    How can I get Data from the Sound cart in Labview? Does a VI exist?

    Yes, there are VIs for acquiring data from Sound cards. And examples too. If you don't have LabVIEW yet, do a search on NI's site for example VIs.
    Khalid

  • Can't get playlists from one one computer to another.  Confident Home Sharing is turned on correctly.  Have imac and macbook Air and Lion.  Using smart lists.

    Can't get playlists from one one computer to another.  Confident Home Sharing is turned on correctly.  Have imac and macbook Air and Lion.  Using smart lists.

    Using Ethernet, I am attempting to stream the movies on my computer to my girlfriends computer through iTunes home sharing. I want to watch the movies that are on one computer on another.

  • Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

  • How can i get contacts from my old Nokia phone to iphone 4S

    how can i get contacts from my old Nokia phone to iphone 4S?

    Appreciate the reply thank you
    Issue being is I don't have the lead for the samsung any longer but have the memory card?
    An yes I know I need to get them onto my MAC but how is what i'm struggling with?
    Any help would be appreciated.
    Many thanks

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • How can I get music from old mac to new mac?

    How can I get music from old mac to new mac please?
    Can't seem to make Migration Assistant work. Doesn't ask about or transfer files.

    I just migrated into a new MBP from an old one.
    It did not bring the music over.  Apple's instructions are to use the Home Sharing feature of iTunes.
    Open iTunes on your old Mac.  Select Home Sharing under the Advanced menu.  Sign in.  Do the same on your new computer.  Then when the library appears under Home Sharing on the left-hand panel on your new computer's iTunes, you can select all and Add To Library.
    That's what Apple says, anyway.

  • How can I get sound from tv or stereo when watching netflix on MacBook Air?

    I have my macbook air hooked up to my tv and want to watch netflix but the only sound is from my macbook.  How can I get sound from other sources ie tv or stereo?

    Check with Netflix for their system requirements.

  • Can I get warrantee from apple store on my iphone that was bought from Apple in China?

    Can I get warrantee from apple store on my iphone that was bought from Apple in China?  It's still under warrantee, and it's unlocked version. May I get another unlocked one if the phone has to be replaced?

    See Here...
    iTunes: How to move your music to a new computer
    Or...
    From your OLD computer...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    See Here  >  Move iTunes Library from PC to MAC
    http://www.macworld.com/article/146958/2010/03/move_itunes_windows_mac.html
    Also... Have a look at these 2 Videos...
    http://macmost.com/moving-your-itunes-library.html
    http://macmost.com/moving-your-itunes-media-to-an-external-drive.html

  • How can i get data from a maintance view?

    Hi all.
        Can you give me some suggestion about 'How can i get data from a maintance view?'?
         Thanks
         Best regard

    hi
    good
    go through this link
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ecdf446011d189700000e8322d00/content.htm
    thanks
    mrutyun^

  • Hi, just updated hubby's iPhone 4 and all of his music has disappeared from the iPhone and from the iTunes library! He does have music still stored on his iPod, but can't get it from the library on his iPod back to phone or itunes. technophobe help pls!

    and all of his music has disappeared from the iPhone and from the iTunes library! Luckily he does have music still stored on his iPod, but I can't get it from the library on his iPod back to the phone or to itunes.Please help, but technophobe so put it in simple english please!

    Sounds like the music you had on your phone was not the same music on his computer. The iPhone/iPod touch is not designed to be a storage device. When you sync with a computer that doesn't have your music, it deletes your music from your phone.
    Was this music you purchased from iTunes? if so, and you are in the US, tap on itunes app, tap updates, tap purchased and tap on the cloud icon to get each song back. If you're not int he us, get iOS5 update later this week and do the same.
    But you need to move your itunes library to his computer. Create a user account on his macbook pro for you. From your external drive backup, load your itunes library on it. Then sync as usual! (Don't tell me you don't have a backup for your computer!)

Maybe you are looking for

  • Transfering music from media player to itunes

    I am having trouble transfering music playlists from my media player to itunes. I have tried the 'add a folder' and 'add a file' options and when I click it nothing happens. I have also tried moving the playlists to different files and tryig to add t

  • Using List Selection Listeners....Please GUIDE

    Hello I am using Java Swing and am displaying elements using JList. Each element of the List performs a certain function. On press of the Key,the function is invoked. Now,I am using the ListSelectionListener for moving up and down the list and the Ke

  • FDMEE API

    Hello Experts, The API functions available in FDMEE seems to be a subset of what was available in FDM. For instance, to import mappings we used to have API.IntBlockMgr.InterfaceMgr.fImpTRx in FDM. This is not working in FDMEE (Even after initializing

  • Joining two Tables

    Hi I am beginner in Oracle. I want some help in joining two tables and adding a new attribute to the resulting table For xample: Table Name: Texas* Ename   Enumber  Sal John 1 10 Akl 2 20 Renka 3 25 Table Name: California_ Ename     Enumber     Sal R

  • RAW update not working

    I installed the new update so I can open my RAW files from my Canon 7D.  Last night the files opened without a problem, but today they will not.  I can see the files in Bridge as a preview, but when I try to open them from there in PS CS4, it keeps t