When do display objects get a size?

I am testing parts of an application as actionscript-only and then merge them into a flash project.
Now, when testing, this works fine
var s1:Sprite = new Something1();
addChild(s1);
var s2:Sprite = new Something2();
s2.y = s.y + s1.height;
addChild(s2);
things align perfectly. When I do the same in flash, s1.height is 0 and objects sit on top of each other ....?

some components or children of components are not rendered as soon as they're instantiated.
in that situation, you can use the render event or one enterframe loop or a time delay (of less than 100ms) to access display properites like width and height of your object:
var whatever:Whatever=new Whatever();
whatever.addEventListner(Event.RENDER,f);
stage.invalidate();
function f(e:Event):void{
trace(whatever.width,whatever,height);
if you have a custom class, the object may not be drawn in your class until much later than the next stage render event.  in that situation, you should dispatch an event from your class and use a listener for that event.

Similar Messages

  • Is there a way to detect redraw regions or at the very least when a display object is redrawn?

    I have a layered window system that produces Windows 7 Aero Glass effect in Flash.
    It consists of nested display objects, with overlays as so.
    Root [
        GlassWindowTop [
           RenderedEffectBackground
         BackgroundForGlassWindowTop [
             GlassWindowMiddle [
               RenderedEffectBackground
            BackgroundForGlassWindowMiddle [
                 GlassWindowBottom [
                    RenderedEffectBackground
                 BackgroundForGlassWindowBottom (e.g. the DesktopBackground)
    Windows can be raised and lowered by changing their order in the hierarchy and adding new levels.
    Each glass window has a designated background (containing all lower windows) .  It draws to an off-screen Bitmap the region of the background that is under the window, and applies a blur filter, tint, and parallax effects to it, and then displays that as it's own background as RenderedEffectBackground.
    The problem is that "RenderedEffectBackground" is a static rendering of the window background, so in order to update it in real time, I need to detect when it's background display object (e.g. BackgroudnForGlassWindowTop) or any nested display objects are rendered.
    I could simply update all RenderedEffectBackgrounds from the bottom up each frame, but that would be inefficient.   Ideally, I could detect when a particular background changes (e.g. when a textfield cursor is flashing, or a MovieClip changes frames), and then only render from that object up.  The rendering of course always has to take place from back to front, starting with the lowest window that has changed.  If I could detect the redraw regions of the Flash Player (e.g. when a textfield cursor is flashing, or a MovieClip is playing), I could optimize this system even further by checking for layer overlaps and only rendering layers whose windows intersect the redraw regions, but obtaining that level of information would probably not be possible or logical since this this essentially needs to happen during some kind of pre render phase, which Flash may not support.  Such a pre-render phase would itself be causing new redraw regions, but as long as it is processed from the bottom up, it could work.
    Is there any AS3 function of the flash player that allows my code to obtain information about the display list as far as which display objects are due to be rendered, and then intercept some kind of "onRenderComplete" event for them right before rendering takes place so that I can render the higher display objects.
    I originally tried to implement this as a filter, but pixel bender shaders in AS3 don't seem to allow sampling of an underlying object that would allow for blurring (i.e. the shader can access only the current point being rendered, coordinates passed to the sampling methods are ignored (this is documented behavior).
    Any ideas?

    The feature that shows the link you are mousing over hasn't been removed in 29. Maybe the add-on you are using to restore the add-on bar is covering it. I've tested the Classic Theme Restorer and it seems to work correctly in this situation - https://addons.mozilla.org/firefox/addon/classicthemerestorer/

  • When does an object gets refreshed, if its state has changed in the cache?

    Do I have to use transactional reads for an object to get the changes done
    by another web application ?
    Thanks
    Wolfgang

    Hi Marc,
    I have a shop system comprised of two web applications where one is for
    maintaining the shop and the other for using the shop. When I do changes
    to the shop from the one webapp they do not show up in the second, unless
    I call refresh. Also, I have to switch off the cache, it seems and do a
    flush on the changed objects. There are some questions now:
    a) when I call refresh, is the complete state reread regardless whether
    there have been changes or not or does it know, when the state has not
    changed in the DB ? it is a performance question, I guess.
    b) can I use transactional reads to do the refresh automatically ?
    c) I noticed that refresh does not do a deep refresh of all the objects
    referenced by the one to be refreshed. Is there a way to do this or do I
    have to go thru all the objects ?
    I asked some questions some time ago in another thread, which might refer
    to. I am sorry, if I am not clear enough.
    Best regards
    Wolfgang
    Marc Prud'hommeaux wrote:
    Wolfgang-
    I take the question to mean that you are wondering how you can refresh
    the state of a persistent instance to reflect changes in the data store.
    If that is the case, then you can just call
    PersistenceManager.refresh(ob) on the object, and the newer values will
    be obtained.
    If that doesn't help, can you clarify the question a little?
    In article <cj7ris$mhr$[email protected]>, Wolfgang Kundrus wrote:
    Do I have to use transactional reads for an object to get the changes done
    by another web application ?
    Thanks
    Wolfgang
    Marc Prud'hommeaux
    SolarMetric Inc.

  • When do PageFlowScope objects get released?

    I think that when a task flow has been exited normally(normal in the sense that the taskflow finalizer is called), adf is letting go of the objects belonging to that task flow's page flow scope.
    But how about if the user just kills the browser? When will the pageflowscope objects be released? When the session times out and is invalidated?
    My guess is that the page flow scope is implemented as a special form of session scope object but that is purely a guess. What I am quite sure of is that some long lived object must be keeping reference to it.

    There is a cache of PageFlowScopes, which is stored in the HTTP session. The size of this cache is controlled by the Trinidad's configuration parameter <tt>page-flow-scope-lifetime</tt>:
    The <page-flow-scope-lifetime> element controls the maximum number of pageFlowScope instances that will be kept active at any one time. The default is 15. Unlike other <trinidad-config> elements, <page-flow-scope> lifetime does not support EL expressions - it must be configured statically.You may need more that a single active PageFlowScope instances if you have a page with regions, or open multiple browser tabs, or use ADF Faces dialog framework, etc. This cache is used also if you use the browser's Back button to navigate back (if the previous page was from another taskflow, so its PageFlowScope has to be reused again). In my opinion PageFlowScope instances are never released explicitly, but their lifetime is contriolled by the size of the PageFlowScope cache (i.e. by the page-flow-scope-lifetime parameter).
    Dimitar

  • How do I compensate for display objects jumping when screen scaling

    I am building an application that is to run at 2 difference stage sizes. 960x640 and 1024x768 (for those paying attention, you may note that those are the high res settings for the iPhone and iPad2)
    The app was designed and build to run on a stage of 960x640 and when running at this size, there are no problems.
    When the app loads in the 1024x768 window, it "strechs" the stage to fill the window, but keeps the aspect ratio. Everything looks good and the application runs without any problems expect for one thing.
    Sometimes, display objects on the stage "jitter" when moving or animating. I have discovered that this is because the stage is "scaling" the x and y values, and is not pixel snapping the objects on the screen, even though the x and y values of the display object are indeed whole numbers.
    A prime example of this is I have 2 bitmapData images. bmData_s and bmData_h.
    bmData_s is 192x388 in size.
    bmData_h is created from a copy of bmData_s with a glow filter stroke on it, resulting in a image that is 198x394 (6 pixels bigger due to a 3 pixel stroke)
    I place it on the screen using the following code:
    (Background is a bitmap object that is 960x480 and places at 0,0)
    (ObjOffset is a point in my app data to position the object, it's a point set to 53,195)
    MyObj.x = Background.x + ObjOffset.x + (bmData_s.width/2);
    MyObj.y = Background.y + ObjOffset.y + (bmData_s.height/2);
    now, when the mouse rolls over the object, I have an event listener to change MyObj.bitmapData to bmData_h
    MyObj.bitmapData = bmData_h;
    MyObj.x = Background.x + ObjOffset.x + Math.floor(bmData_h.width/2);
    MyObj.y = Background.y + ObjOffset.y + Math.floor(bmData_h.height/2);
    and back to the _s image on mouse out.
    Now, when the app runs on the iPhone which is a 960x640 screen size, or on the PC which is using a window of similiar size, the image doesn't appear to move at all... the "stroke" appears and disappears exactly as it is suppose to
    However, when I run it in a window that is 1024x768, the _h image appears to "jump" one pixel up.
    I have encountered many other similiar things that only occure when the stage is scaled. There is a spot in the app where I am animating a bitmap by manipulating it's scrollrect x and width (have it's do a wipe in from right to left like a peice of paper unrolling on a table) and due to the scaling, the right edge of the image jumps left and right 1 pixel... but on 960x640 screens, it looks perfect.
    Does anyone know how I can compensate for this effect so that this jumping doesn't occur when the stage is stretched to fit the window it's running in?

    Sounds like a x-browser rendering problem
    my guess would be to scale down the inner div's so they add up to less than 100%.
    If you floated div's and gave them a %, give one of the div's a smaller.
    ie: 2 divs floated in a Header, give one 50% and the other 49.5%

  • After aborted rebuild in Mail: I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up

    I have searched quite a bit to find a resolution to this problem, with no success. Any help would be appreciated.
    I decided to rebuild my inboxes by following this advice: http://support.apple.com/kb/PH11704. The rebuild took several hours and at 96% (4 minutes remaining apparently), the indexing froze (that is, after 8 hours, the message was still telling me "4 minutes left"). I forced quit mail, restored the previous Envelope files from the trash, and everything seemed fine.
    However, since this failed attempt, I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up. All messages in my various inboxes have the reloading problem, EXCEPT messages that I downloaded since the aborted rebuild (in other words, there are about 40 messages that I downloaded since I tried the rebuild and I have no problem with these). The other 70,000 messages however wont load, even though I can see them in the centre pane and spotlight has no problem finding them and showing me their contents (when I hover the mouse over the message). When I click on the message in spotlight, mail opens and the loading problem re-occurs.
    Since then, based on various suggestions I found for similar issues, I have used Disk Utility to verify and repair permissions and the drive. I used Onix to rebuild the Mail index (that only took about a minute - I am not sure how to interpret this when compared to the hours the rebuild took with Mail). No joy, I still have the same problem. I even restored one of my inboxes via Time Machine and the same issue with loading continues.
    I am using ML 10.8.2. I have a combination of IMAP accounts (work) and POP accounts (personal). The issue of loading occurs irrespective of the account.
    I am baffled and am now considering migrating to either Thunderbird or Postbox 3 to try and solve my problem. I prefer to stay with Mail. I should note also that I am using MailTags with Mail (http://www.indev.ca/MailTags.html), although I have not used any of the features. I upgraded to ML from SL about 2 weeks ago. It was very smooth and there appear to be no issues (not sure how helpful this is and probably not at all related to this issue).
    Any suggestions much appreciated!

    Maybe these will help:
    https://discussions.apple.com/message/17677533#17677533
    https://discussions.apple.com/message/18324129#18324129
    https://discussions.apple.com/message/18203126#18203126

  • HT1338 When trying to update getting (error surle error domain error-1100). It started yesterday, any help would be great. I have Mountain Lion 10.8.1 on a new macbook pro with retina display.

    When trying to update getting (error surle error domain error-1100). It started yesterday, any help would be great. I have Mountain Lion 10.8.1 on a new macbook pro with retina display.

    There are many people suffering from this problem right now (including me). It appears to be a server issue. Just wait and try checking for updates again tomorrow.
    Some things I have heard indicate that this may be a regional problem, though what parts of the world are affected I don't know yet. A few people have been helped by deleting the following preference file (paste the path into the Go -> Go to Folder window in the Finder to locate it), though most have not:
    ~/Library/Preferences/com.apple.SoftwareUpdate.plist
    Note that if you are trying to download iTunes 10.7, that can be found here:
    http://support.apple.com/kb/DL1576
    Also, note that there is no reason to be anxious to get it, as the only thing added in iTunes 10.7 is compatibility with iOS 6, which will not be available until the 19th, and the new iPhone, which will not be available until later as well. The new iTunes that was announced is iTunes 11, which is also not yet available.

  • IMac display getting yellow when external display is attached?

    Hi,
    I have a problem with my IMac (27'' Mid 2010):
    I have an external TV attached via MDP->DVI->HDMI cable. When I turn on the TV, the iMac recognizes it and the iMac display turns blue shortly, then the desktop returns and my TV is ready.
    What I noticed: After the desktop returns, the iMac sometimes suddenly becomes "more yellow". Don't know exactly how to describe it, but I can clearly see how the desktop returns and then suddenly the imac display turns a little yellow, could also be that the display just gets a little darker (although the display brightness is the same as before). it's nothing that really disturbs me, and although I never saw the color return to normal it does (but I think only after rebooting the iMac)
    anything on this? anyone else noticed that?
    Message was edited by: nachdenki

    Hi nachdenki
    I've used both TV's and Monitors with my iMac over the years and that default iMac Profile has always looked yellow in comparison. Try one of those other sRGB, RGB Profiles or create a new Color Profile for the iMac's display.
    http://www.computer-darkroom.com/colorsync-display/colorsync_1.htm
    Dennis

  • Grey scale objects get lighter when Outer Glow assigned to text

    I have a grey scale object on one layer and text on another. When I apply an Outer Glow to the text, the grey scale object gets 10% lighter. If I have a 2 page spread and apply an Outer Glow to text on one page, the grey scale objects on both pages get lighter. Is there some way to prevent this or at least an explanation as to why?

    Your transparency blend space (probably working cmyk) is different than the grayscale space of the image. Your grayscale image profile is "dot gain 10".
    Take a look at
    Adobe's guide to transparency.
    J

  • I cannot open files attached to an excel spreadsheet. I am using office for mac 2011. when double clicking object I only get the picture modifier windows.

    I cannot open files attached to an excel spreadsheet. I am using office for mac 2011. when double clicking object I only get the picture modifier windows.

    Preventing Microsoft Office to open recent documents at startup in Mac OS, Please see:
    http://www.frenchguys.com/wordpress/preventing-microsoft-office-open-documents-startup-mac-os-lion/
    It seems that the solution works for most people.
    In a terminal, enter the following:
     defaults write com.microsoft.Excel NSQuitAlwaysKeepsWindows -bool false

  • When I try to print a photo downloaded from Facebook in iPhoto, I can't get the size I specify to print correctly. Example: 5x7 prints smaller than 5x7. What do I do to solve this problem?

    When I try to print a photo downloaded from Facebook in iPhoto, I can't get the size I specify to print correctly. Example: 5x7 prints smaller than 5x7. What do I do to solve this problem?

    Those pixel dimemsions have aspect ratios that are not the same as a 5 x7 print:
    1360 x 1360 = 1.0
    790 x 640 = 1.23
    2048 x 1366 = 1.5
    An 7 x 5 image = 1.4.
    So you'll need to crop the images to 5 x 7 before printing.  The first two images are a little light in the pixels to produce a high resolution 5 x 7 print. 
    Happy Holidays

  • How to get event when any library object added to indesign doc?

    I want to do some operation when any library object is added to doc. So please tell me how to get event when any library object is added to the doc. better provide some code snippet.

    Daves61,
    I need to clarify what kind of event you're interested in.
    1. When you click once on page/spead widget in the Pages panel and only widget becomes selected. The layout window remains unchanged. OR
    2. When you doubleclick on page/spread widget the selected master spread appears in the layout window.
    In the first case you work with Pages panel.
    Have a look to file PageTransitionsPanelObserver.cpp from SDK. 
    PageTransitionsPanelObserver::LazyUpdate()
    In the second case you work with Layout window.

  • HT1430 My iPhone display sometimes getting bigger than normal size. So big sometimes  that I can't use it and I must turn it off. Anyone know what happened ?

    My iPhone display sometimes getting bigger than normal size. So big sometimes  that I can't use it and I must turn it off. Anyone know what happened ?

    You most likely have zoom on. Double tap with THREE fingers to turn zoom off, if it is on, then: Settings>General>Accessibility...turn it off for good.

  • Actual 3d display object size

    Suppose I have display object on the stage. I give it a z=500 for example. How do I know it's actual size now? I mean the size that I am seeing now. I want to be able to deal with this error by cropping my display object:
    Warning: 3D DisplayObject will not render.  Its dimensions (5166, 3508) are too large to be drawn
    how do I calculate the dimensions of the 3d displayobject? thanks.

    I saw this blog post online after posting the question above:
    http://blog.formatlos.de/2009/02/16/masking-a-3d-container-in-as3-fp1/
    Someone replied to it on that page with a workaround but I am not sure this workaround will work.  I don't quite know how to apply it to my scene just yet but will give it a shot.  Nowhere are they actually using a mask object in their example which is what is confusing me.

  • HT204266 When I want to get to app store doesn't use my primary app id(current email address) displays old account. Went to manage accts and thought I set all to current and canceled old. Still displaying old acct to sign in. Help?

    When I want to get in app store always displays old app I'd. I went to manage acct and reset everything to use current primary email address. How to change apple id when signing in to app store?

    Go to the app store ( or I tunes). At the bottom of the screen, look and see what account it thinks you are using.  If it is the wrong one, just sign out, then sign in with the new one.
    It thinks you are whatever account downloaded or updated the last app.  You may have some apps on your machine purchased under the old account, and that is what it is seeing.

Maybe you are looking for

  • How do I Apply a Quartz Filter Automatically to PDF Scan Using Preview

    Hi, Question: is there a 1-step process to scan to PDF and create reasonable file sizes. I've found discussions on this, but no conclusive answer that someone has actually tested and used. PROBLEM: Scanned PDFs are large SOLUTION: use a quartz filter

  • Why can't I enlarge and view my horizontal pictures?

    When I double click a pic in iphoto, a square with dashed lines and an exclamation point in the middle pops up instead of the enlarged photo. What is weird is that every photo that I had previously rotated and is vertical will show. All the horizonta

  • Not able to see elements to design the screen.

    I have ECC 6.0 in our company. I started learning ABAP Webdynpro. When I opened the screen to design the first screen of my application with the  elements like label, input field, button etc...left hand side under favourites, only lines are there ins

  • Skype will not sign in

    I installed skype from the amd64 multilib section.  It starts up fine; however, when I try to sign in, it just sits indefinitely.  The program is not frozen; it continues to show the spinning gray arrows, and Etherape shows some outgoing network traf

  • EP Insttalation Problem

    I am trying to re-install the EP on my machine. While I am clicking on sapinst.exe i am getting the below mentioned error. 1. guiengine: call to bind() for socket 1828 failed. No such file or directory ERROR      2006-04-10 19:58:01 [iaxxgenimp.cpp:5