Determine the size of the container when using SizeUnit.PERCENT

Hello

How can I determine the width and height of a container, when I use the percentage of the size of the container?

I have the following code, but this.width and this.height are both 0, causing the background sprite is not to demonstrate:

   public class HeaderContainer extends Container
    {
        private var _imgCategory:Image = new Image();
        private var _lblTitle:Label = new Label();
        private var _matrix:Matrix = new Matrix();
        private var _sprBackgroundColor:Sprite = new Sprite();
        private var _tfmtTitle:TextFormat = new TextFormat();

        public function HeaderContainer()
        {
            margins = Vector.([5,5,5,5]);
            debugColor = 0xCCCCCC; // grey
            flow = ContainerFlow.HORIZONTAL;
            align = ContainerAlign.NEAR;
            size = MyConstants.HEADER_SIZE;
            sizeUnit = SizeUnit.PERCENT;
            initializeUI();
        }

        public function initializeUI() : void
        {
            with (_sprBackgroundColor)
            {
                x = y = 0;
                graphics.beginFill(0x0000FF, 1);
                graphics.drawRect(0, 0, this.width, this.height);
                graphics.endFill();
            }
            ...
        }

Have you tried to call the initializeUI method after the container has been added to the scene? You can easily register a handler to do this.

Tags: BlackBerry Developers

Similar Questions

  • Strange glitch Visual on the taskbar when using Firefox

    Hello

    I feel a strange glitch Visual on the taskbar when using firefox.

    Please take a look at this short video because it shows the problem, it's almost impossible to show in pictures.

    https://DL.dropboxusercontent.com/u/12595174/VIDEO0016.3gp

    I use firefox on Windows 7 Pro 64 bit v36.0.1. Video card is an ASUS R9 280 X using the latest drivers from AMD 14.12 Catalyst Omega Software.

    Motherboard is an ASUS M5A88 with 16 GB of ram and a processor of 6300 FX.

    It is a new construction that I have implemented in the last 24 hours, and this behavior was not present on the system using the same version of windows, firefox and even map chart and drivers. But on another card mother and CPU. Previous Board of Directors has been
    M4A79XTD EVO with a Phenom II X 4 955BE.

    The glitching does not occur when it is on the desktop and firefox is closed. It will not occur when you use IE - 64 nor does it when I am using the steam software or any Explorer windows/opening files.

    All the motherboard drivers are installed correctly, the integrated graphics card is disabled in the BIOS. I disabled the settings of firefox for hardware acceleration, smooth scrolling and text... to see if it was the question. It wasn't.

    I'd appreciate any help to solve this... Really, I don't want to use a different browser but it's bad enough and quite distracting to really annoy me, and I don't see any alternative.

    Thank you very much.
    H

    Hi jscher2000

    I was about to post a reply, because a friend suggested that maybe that's a rendering of issue rather than a firefox one video card even if it's strange how it affected firefox only. I didn't have a chance to test it on Chrome as it is a new construction and I don't want to install the software, I do not use.

    I went to the Manager of catalyst and had a glance to the settings. I changed something, but no help... I then started to make a simple change and test until I found that the activation "gpu up-scaling" in the properties of digital flat screens has solved the problem.

    I am now free twinkle

    Thanks for your quick response however.

  • Why doesn't a USB drive I have previously used with AirPort extreme appear in the finder when used locally with my Mac?

    Why doesn't a USB drive I have previously used with AirPort extreme appear in the finder when used locally with my Mac?

    I tried to plug it into my mac to transfer files locally but will not be displayed in the finder or disk utility. Anyone know why?

    MacBook Pro (2015 retina) OS X 10.11.2 El Capitan

    Have you shut down / turning your Mac off... power off the USB drive... Connect the drive to the Mac... start up the Mac... then, turn on the USB drive?

    If no help, there are a number of posts to the thread in the forum El Capitan of support from users who have problems on their Mac USB.  You can post there to see if anyone has the answers.

    OS X El Capitan

  • disable the touchpad when using the mouse?

    How to disable the touchpad when using the mouse?

    Hello

    Please contact Microsoft Community.

    Most laptops have a function key (FN) which can be used in combination with other keys for example FN + F2 or FN + F7 to disable or enable the touchpad.

    You can also disable the touchpad in Device Manager.

    To disable the touchpad in Device Manager, follow these steps:

    1. Click Start.
    2. In the start search box type devmgmt.msc, and then on enter.
    3. In Device Manager, expand mice and other pointing devices and locate the touchpad.
    4. Right click on the touchpad and click on the disable option.

    Following the steps above should help you disable the touchpad.

  • Problems installing drivers for printer EPSON L110. Error message "Windows could not determine the language to use for the installation: CODE of ERROR: 0x80004005.»

    Original title: trouble installing the drivers for my printer.

    Hello

    I am trying to install an EPSON L110 and eveytime I try to run the CD, it appears this error message.

    Windows could not determine the language to use for the installation: CODE of ERROR: 0x80004005.

    I have windows 7 32 bit OS. What I'm doing. A quick response will be very useful.

    TKS

    Gerard

    Hi, Germain,.

    This problem could occur due to corrupted files. We will try to download and install the latest printer driver on the site of the manufacturer of the printer. Check if it helps.

    http://www.Epson.co.in/epson_india/ink_tank_system_printers/product.page?product_name=Epson_L110&tab_index=4

    See the articles for more information.

    Install a printer

    Find and install printer drivers in Windows 7

    Hope this information helps. Answer the post with an up-to-date issue report to help you further.

  • One of the pages of my site moves to the right when using anchors to scroll. I checked for Ghost off the page boxes and checked that all my 100% width images are actually 100%. I discovered that this problem is in Chrome and do not hap

    One of the pages of my site moves to the right when using anchors to scroll. I checked for Ghost off the page boxes and checked that all my 100% width images are actually 100%. I discovered that this problem is chrome and does not happen in Firefox. Any suggestions?

    Thank you Brad, my ankles were lined up however they were in the Center. I am proposing to-100 and it solved the problem. Thanks for your help.

  • Determine the NIF port used by the HEART when it is configured in a port channel

    I recently saw an excellent video of live Cisco UCS troubleshooting performance that showed how to track traffic network within Cisco UCS. The speaker made a comment however, to determine that NIF is used by a high HEAT when port-channels are used between the FEX and FI there are different commands to run. You will need to determine the outcome of hash-load balancing. Unfortunately, he never entered what were these commands.

    Then when we have pinned port-channel instead of HIFs and NIFs veths, what commands will indicate which way is used?

    Matt,

    You can use this command:

    B (nxos) # sh port-channel - balance load< this="" will="" tell="" you="" the="" load="" balance="" method="">

    If you use source-dest-ip as in my case, you can use this command:

    B (nxos) # sh port-channel - the balance of the charge-transfer interface port-channel ID vlan ID x.x.x.x y.y.y.y dst - ip, src - ip and it will show you something like this:

    Lack of params will be substituted by 0.

    Algorithm to balance the load on the switch: source-dest-ip
    crc8_hash: 109 port id coming out: EthernetX / Y  < this="" is="" what="" you="" are="" looking="" for="">
    Param (s) used to balance the load to calculate:
    DST - ip: y.y.y.y
    SRC - ip: x.x.x.x
    DST - mac: 0000.0000.0000
    CBC - mac: 0000.0000.0000

    For the blade, depends on which the active vNIC is, for the FEX, depends on pinning, based on the server is located in the blade slot.  Strange servers go through odd links and same servers through the same ports.

    Remember to rate helpful answers.

    -Kenny

  • Distortions of the screen when using Firefox on Android

    Hi, a recurring problem - when using Firefox on my Android Web site, are often distorted. If I try to zoom before to increase the size of police or image during playback, the screen breaks and distorts, with different sections of text and images disappear (black sections of the screen appear) or overlapping, often in a different font sizes. The Web site displayed on the screen as "jumps around." The same thing happens if I try to select text for copy - it is impossible to select all or selection is distorted. I have not had this problem before and noticed only recently. Almost impossible to use the browser now! What is the result of an automatic update of the software? Help, please! Thank you.

    Please try to update to Firefox 38.

  • Get the error when using remove child

    Hi try to use remove the child I get the following error in the output panel

    Hide videos and learn the buttons
    video removed
    ArgumentError: Error #2025: the supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at DSE_MAIN_dizzy3_fla::MainTimeline/removeMedia()
    at DSE_MAIN_dizzy3_fla::MainTimeline/setNewMedia()
    at DSE_MAIN_dizzy3_fla::MainTimeline/onIntroClick()

    I think that the function that generated the error is called removeMedia()

    This function is called from another function that is called by a buttonpress

    function removeMedia() {}
    If (myVideo! = null) {//Check that a video is on the scene
    myVideo.stop (); / / stop the video so don't continue to play sound
    this.removeChild (myVideo); / / deletion of the video being step
    trace ("video deleted");
    }
    If (myLearn! = null) {//Check that an element of learning is on stage
    removeChild (myLearn); / / Remove swf of the stadium's current learning
    trace ("learning removed swf");
    }
    }

    I tried to parent.removeChild (myVideo);

    and parent.removeChild (myVideo);

    but I got the same error

    Don't know how to fix it or why? its probably something simple I'm missing, any help would be appreciated

    Heres the code in its entirety if you need


    / / Code witten by [email protected]

    Stop(); / / Stop to this framework

    Add the Classes required for the application-
    import fl.containers.UILoader;// import uiLoader class to display the elements of learning
    import flash.display.LoaderInfo;// import (required to load flash Vars) class loaderInfo
    import import the FLVPlayback class fl.video.*;// (required for playback of flv)
    FlashVars are passed to this application since the html/php page
    myFolder is the name of the FlashVar and contains the path to the flv file
    and learning of the swf file


    Configure the application variables-
    var mySection:String; / / define a variable to hold the current section, we
    MySection = "intro"; / / because it is the first picture on the variable intro MySection
    var myFlv:String; / / define a variable to hold the name of the current flv to play
    myFlv = "loaded dse_introvideo.flv";// like this just to put the variable myFlv for intro.flv.
    var mySwf:String; / / define a variable to hold the name of the element of swf of learning to play
    no need to name mySwf yet as we are in the intro of the article
    var mySecType:String; / / set a variable to contain the type of section 'video' or 'learning '.
    mySecType = 'video '; / / We start playing the videos in order to define us the type of section to the video

    // VIDEO STUFF --------------------------------------------------------------------
    var myVideo:FLVPlayback = new FLVPlayback(); / / create a new FLVPlayback object to contain the video
    myVideo.width = 544;             Set the width of the video
    myVideo.height = 304;           adjust the height of the video
    myVideo.x = 200;                  set the horizontal position of the video
    myVideo.y = 88;                    set the vertical position of the video
    set the skin to control videos
    We read the variable called myFolder that is passed to us from the web page
    my file contains path information to the customers on the Web site directory
    If (this.loaderInfo.parameters.myFolder! = undefined) {/ / check if all flashvars passed through}
    If flashvars adopted include myFolder the path to the external file of the skin
    myVideo.skin = (this.loaderInfo.parameters.myFolder + "SkinUnderPlayStopSeekMuteVol.swf");
    } else {}
    If no flashvars are passed through the skin without the additional path value
    myVideo.skin = "SkinUnderPlayStopSeekMuteVol.swf";
    }
    myVideo.source = myFlv; / / set the video source to the current video stored in the variable myFlv
    addChild (myVideo); / / put the video on the stage
    // END VIDEO STUFF-----------------------------------------------------------------

    // LEARNING STUFF ---------------------------------------------------------------
    var myLearn:UILoader = new UILoader(); / / create a new UIloader to contain the element learing
    myLearn.width = 544;                          Set the width of the element of learning
    myLearn.height = 304;                         define learning points height
    myLearn.x = 200;                              set the horizontal position of the element of learning
    myLearn.y = 88;                              set the vertical position of the element of learning

    We need hide the video and the buttons of learning that they must not be shown again
    This function called viewButtons that will
    to call the function, we use viewButtons ("show"); to show them
    and viewButtons ("hide"); to hide
    function viewButtons(mySwitch:String) {}
    If (mySwitch == 'view') {}
    This.vid_btn. Visible = true;                              show the button of the vid
    This.learn_btn. Visible = true;                              See him learn button
    This.button_bkg. Visible = true;                         show the button background
    trace ("see the video and discover the buttons");          hide the button background
    }
    If (mySwitch == 'Hide') {}
    This.vid_btn. Visible = false;               Hide button vid
    This.learn_btn. Visible = false;               Learn how to hide the button
    background of the This.button_bkg button. Visible = false //hide
    trace ("Hide videos and learn the buttons");
    }
    }
    viewButtons ("hide");               turn the video and learning off because buttons are not necessary
    //END LEARNING STUFF------------------------------------------------------------

    MEDIA FUNCTIONS
    function to delete the current item of the scene.
    function removeMedia() {}
    If (myVideo! = null) {//Check that a video is on the scene
    myVideo.stop ();                    stop the video so don't continue to play sound
    this.removeChild (myVideo);     delete the video being step
    trace ("video deleted");
    }
    If (myLearn! = null) {//Check that an element of learning is on stage
    removeChild (myLearn);               Remove swf of the stadium's current learning
    trace ("learning removed swf");
    }
    }

    function setNewMedia() {/ / function to play the swf or flv files media}
    removeMedia (); call the function removeMedia to stop and remove no matter what media on the scene
    If (mySecType == "video") {//if we're in the video section
    myVideo.source = myFlv;               load and play the new video
    addChild (myVideo);                    put video on stage
    trace ("added videos");
    }
    If (mySecType == "learn") {//if we're in the learning section
    myLearn.source = mySwf;               Load point learning
    addChild (myLearn);                    the point of learning on stage
    trace ("added learning item");
    }
    }

    SET UP THE BUTTONS ON THE STAGE-
    INTRO BUTTON
    function onIntroClick(event:MouseEvent):void {}
    myFlv = "dse_introVideo.flv";                    put the video to load
    viewButtons ("hide");                         hide the video and learning buttons
    setNewMedia();                              load in the media
    }
    set the function to the button intro
    intro_btn.addEventListener (MouseEvent.CLICK, onIntroClick);


    VIDEO BUTTON
    function onVideoClick(event:MouseEvent):void {}
    mySecType = 'video ';                    section under video
    setNewMedia();                              load in the media
    }
    set the function to the button intro
    vid_btn.addEventListener (MouseEvent.CLICK, onVideoClick);


    TEACH BUTTON
    function onLearnClick(event:MouseEvent):void {}
    mySecType = "learn."
    setNewMedia(); / / load in the media
    }
    set the function to the learn button
    learn_btn.addEventListener (MouseEvent.CLICK, onLearnClick);


    COMPUTER BUTTON
    function onComputerClick(event:MouseEvent):void {}
    myFlv = "dse_computerVideo.flv";//set the video to load.
    viewButtons ("show"); show the video buttons and learning
    setNewMedia(); / / load in the media

    }
    set the function to the computer button
    computer_btn.addEventListener (MouseEvent.CLICK, onComputerClick);

    BUTTON OF POSTURE
    function onPostureClick(event:MouseEvent):void {}
    myFlv="dse_postureVideo.flv";//set the video to load
    viewButtons ("show"); show the video buttons and learning
    setNewMedia(); / / load in the media
    }

    posture_btn.addEventListener (MouseEvent.CLICK, onPostureClick);

    Ah, looked carefully at the code, and I think I found the problem.

    You call removeChild for BOTH myVideo and myLearn - when the only one of them is on the display list.

    The if() statement could catch it, BUT you check if they are null, not if they are on the display list.  An object can be non-null and not be on the display list.

    The simplest method (also somewhat sloppy method) to get rid of this would be to add a try/catch around two of these calls removeChild.

    try {}

    removeChild (myVideo);

    } catch (e) {}

    try {}

    removeChild (myLearn);

    } catch (e) {}

    It's messy, it triggers the error again, but it immediately masks because you caught and did nothing, but the error is no longer displayed.

  • Presenter PowerPoint on Mac mini mode displayed on the screen and the projector when using HDMI splitter

    We have a Mac mini connected to a screen and a projector via HDMI using a HDMI splitter.

    It works fine for most applications, but during presentations PowerPoint, presenter is displayed on the monitor and the projector.

    When I disconnected the mini Mac's HDMI cable and put it in a MacBook, the presenter appeared on the MacBook screen (as it should) and only the slide appears on the screen and on the projection screen.

    Of course if we have to use the MacBook for presentations instead of the Mac mini, you would need to have seen the presenter on both the screen and on the screen of the MacBook.

    In the Mac mini display preferences there is no button to "Gather Windows" when the Mac mini is attached to the screen and the projector via HDMI splitter is a tab "setting."

    But these two things appear on the MacBook when it is connected.

    Any help would be greatly appreciated.

    Thank you!

    Mike

    I'm confused. When you use a video separator the same screen will appear on the two monitors connected to the separator. This is how works a separator

  • iMac screen plunges into the black when using Safari

    When you use Safari on my end 2014 27 "iMac, the screen will often randomly, fade to black.  Pressing the space bar will revive it, but it will sometimes immediately repeat the same thing.  When he exhibit this behavior, the Console message is:

    8:50:52.295 AM WindowServer [185]: device_generate_lock_screen_screenshot: authw 0x0 (0) [inf, inf, 0, 0] shield 0x7f9be085d600 (2001), dev [2048,1152]

    It's the second machine that to happen, the first was a late 2009 27 "iMac.  He can't get on my laptop. The system is:

    iMac (retina 5K, 27 inches, end of 2014)

    3.5 GHz Intel Core i5

    32 GB 1600 MHz DDR3

    AMD Radeon R9 M290X 2048 MB

    Any help you can offer with this deeply frustrating problem is appreciated gratefully.

    Hello captainlarrydart,

    Thank you for using communities of Apple Support.

    If I understand your message that your Mac is apparently going to sleep on his own, sometimes immediately after waking up.  To help solve this problem, please follow the steps below.

    If your Mac goes to sleep in an unexpected way

    Make sure that this energy saver is set up as you wish: choose the Apple menu > System Preferences, and then click energy saver. Adjust one or more of the following affect when controls your Mac goes to sleep. Some of these controls are not available on your Mac model.

    • Cursor 'turn off display after.
    • Cursor "display sleep".
    • Slider 'the computer sleep.
      If a slider is set to 'Never', sleep is disabled for this feature.
    • Schedule button

    Make sure you that you do not put your Mac to sleep accidentally:

    • Pressing on the button / stop can put your Mac to sleep.
    • Move your mouse pointer into a hot corner can put your Mac to sleep, depending on your settings from Mission control. Choose the Apple menu > System Preferences, and then click Mission control. Click on the button active corners, then see if any of the corners are set to "Display Put sleep."
    • Using magnets near your Mac laptop can put your Mac to sleep.

    If the previous steps do not work

    These additional steps can help identify or resolve the problem:

    • Reset the SMC.
    • Reset the NVRAM.
    • Disconnect external devices other than your Apple keyboard, mouse, and screen. If that solves the problem, gradually reconnect your devices, testing each time until you find the device that interferes with sleep. And then check the documentation that came with the device or contact the manufacturer of the device.
    • Start in Safe Mode to see if the problem is related to startup items not Apple, login items or kernel extensions.
    • Try to isolate the problem by using a different user account.

    If your Mac does not sleep or wake up when expected

    Have a good.

  • Is there a delay in the signal when using Bluetooth on any iDevice and, in particular, on an iPad Pro?

    I am using Bluetooth involved in the use of music made a software with sounds of digital instruments using a musical keyboard hardware connected via the USB cable to Lightning to play sounds from the app on my iPad Pro.

    When I try to use a Bluetooth speaker source, there's a 1-2 second delay when I play a chord in the app and when the sound is played through the Bluetooth speaker.

    This delay IS NOT the case when I use just the iPad Pro speaker on when I am attaching some small travel speakers to the headphone jack of my iPad.

    Only when I try to use my Bluetooth speakers sounds better.

    I use a keyboard master Korg MicroKey Air uses the USB port play their own Korg music make its app module.

    Someone who makes music on an iPad with this problem at all?

    Is this a problem question Bluetooth and/or iOS?

    My iPad Pro isn't very strong using these apps do and travel speakers I use plugged into the headset jack music are a little better on the volume, but tend to deform when I try to increase the overall volume level.

    I intend to put this issue on the web forums for Korg, but want some answers from anyone who has been playing and recording music on their iPad using an external keyboard to play and record music in an app to do the music.

    Also, (and I intend to ask this in the GarageBand for iOS forums) can the iOS version of Garageband output sound on a Bluetooth speaker and quietly delay, too, that I can not get the iOS version of GarageBand to sound output via Bluetooth to a Bluetooth speaker.

    Hi, MichelPM

    According to the used speaker, he will always be * some * delay when using Bluetooth to stream audio from an iOS device (or practically any device BT also) through a Bluetooth speaker. I have a Bluetooth speakers system cheaper that I use with my iPad mini 4... I pretty much use it only to listen to sound. If I try and use it for Pinball iOS games I play, there is a delay of environ.5 second anywhere, I'm the speaker. Exactly same phenomenon occurs with the keyclicks when you type it on the iPad keyboard... 5 second delay & even with some applications of synthesizer iOS that I use (Animoog & Arturia iSEM). I think it's just the nature of the beast of Bluetooth.

    Higher quality speakers would be better, but I'm not spending more money to find out.

    If you want an immediate response with zero real audio keypress delay, I fear, the only way to do this is to use a wired speaker.

  • Random number 3 appears in the display when using the touchpad

    I have a problem when you use the touch pad or keyboard the number 3 appears randomly and the number 3 continues to fill the area to explore text word or office. I restarted the laptop to factory settings but still have the problem.

    could someone help.

    Hi lennybytes,

    Looks like the 3 key is suspended. You may notice the same behavior using an external keyboard?

    In General, if certain keys n t work properly, you must replace the entire keyboard because there is no unique key that you can exchange. An ASP can order a new keyboard for you.

  • HX850 - no adjustment of the image when using netflix

    Hello

    Is it possible to adjust the picture settings when using netflix? All the buttons on the remote seem to be blocked when netflix is running. It is very annoying because I can't disable cinemotion making all movies look like they were saved by a kid with some * camcorder.

    Adjustment of image quality with 'common' setting also does not affect the settings of the image when the netflix app is running.

    THX!

    Hello FA5_FLIP.
    Welcome to the community of Sony and thanks for the post.

    Setings photo on TV are not accessible when you watch Internet channels.

    Fact the image appears in poor quality when the various videos of Netflix streaming and streaming of various videos like YouTube, Amazon etc. Internet services?

    Are the same Netflix videos appear fine when transmitted in an another TV or computer?
    Check if the speed of the Internet meets the requirements of 2.5 Mbps for SD videos streaming and 10 Mbps for streaming HD videos.

    Try to update the Firmware of the TV to the latest version.

    Try to separate the TV from Netflix account and even add a link to it.
    Follow the steps below to remove the TV has Netflix.

    https://us.en.KB.Sony.com/app/answers/detail/A_ID/32176

    Thank you.

  • USB mouse will not be in service to initialize the top when used through Dynadock on Satellite Pro U200

    The USB mouse not is won't boot on initialize top when used through Dynadock on Satellite Pro U200. If the mouse is reinstalled on the Dynadock it works fine. I use a Kensington Valuoptical USB mouse. I tried the alternative kensington mouse and had the same problem. Can someone tell how to fix this?

    Hi Jeremy

    Unfortunately I don't have a solution to your problem, but it can also be a technical limitation. I'm also interesting to buy this docking station and I would like to know if there is the same problem with memory external HDD or USB sticks.

Maybe you are looking for