Is there a way to get a resized element height by ILayoutElement??

Hi all,
I am currently working on a means of layout out dynamic text and want my layout to check the RichText component to determine if it has enough space horizontally to fit in the available real estate.  For example, if the available browser width is 300px, and the RichText is 200px, everything is fine and the component can be placed without modification.
However, if the browser is 300px and the component is 400px, I want to resize the component to fit into the available space and trigger the RichText to present its content in a multi-line format.  I'm really close to a solution, but Ive been unable to find out if there is any means to get the height that the component will be once the width resize is complete.
The crux of this approach relies upon using ILayoutElement within the layout and resizing as follows:
element.setLayoutBoundsSize(target.width-HorizontalGap, NaN)
Now I know that setting the height to NaN causes this method to set the elements height to its preferred height.  I've checked the other available methods such as element.getLayoutBoundsHeight(), element.getPreferredBoundsHeight(), element.getMaxboundsHeight() but these all appear to return the height as if the resize for multi-line didn't exist.
My question is that I would like to find a way to figure out what the new height is GOING to be once the width resize occurs.
Any thoughts?  Thanks in advance!
PS. While stepping through, I noticed there is a protected $height that appears to have the correct height, but there doesn't seem to be a way to access it.  Do I need to subclass ILayoutElement to make this value available or is there something Im not seeing.
Cheers!

ok so as it turns out, the $height in the component appears to only be the height of a single line.  What I really want is the complete height of the component when I allow Flex to resize.  For example:
I have 200px of available space and the RichText has 300px of text.  I want to know the height of the entire component once Flex has resized it to multi-line so that I can tell how far down my next line needs to be.  To accomplish this, I'm doing the following:
if(element.getLayoutBoundsWidth() > target.width)
     element.setLayoutBoundsSize(target.width, NaN);  // I'm not setting the height of the component because Flex is doing that based upon the width
The problem is that even after calling setLayoutBoundsSize(), when I call element.getLayoutBoundsHeight() (or element.getLayoutBoundsHeight(true) ), it's still giving me the height of a single line of text and not the total height with multi-line.  I need a way to tell the entire height of the component after Flex has resized for multi-line.
Thanks so much and I appreciate any help I can get.

Similar Messages

  • Is there a way to get the filename only on iOS using CameraRoll?

    This post is a sidetrack from this post: http://forums.adobe.com/thread/848761?tstart=0
    The method used in that post works perfect on both Android and iOS for selecting and uploading files.... BUT is there a way to get the filename of the file from the mediaPromise cross-plattform?
    If you let the user select an image it's not very nice to have the image be called "temp.jpg" after uploading - you want the user to know which image he/her have uploaded
    Any ideas? The "mediaPromise.file.relativePath()" works on Android but not on iOS. Not "mediaPromise["file"].url/relativePath/nativePath" either.
    Thank you

    Hey Joe what do you think of this solution.
    1. Let the user select the image
    2. Store the mediaPromise object in an array (event.data) for later use
    3. Load in the object using loadMediaPremise
    4. Add the loaded image into a movieclip (not visible from the scene)
    5. Resize that movieclip to let's say 100x100
    6. Use the BitmapData class to create a new bitmap from that movieclip and save it to storage
    7. Use the saved file within the app as a thumbail
    8. Use the mediaPromise object stored in the array later when the user wants to upload the images (then go through mediaPromise.open() on each image -> save to storage -> upload -> clear from storage -> loop).
    I haven't tried it yet (will do this week) but should that be a acceptable solution to the problem(?)
    I'm unsure if by just keeping the mediaPromise object within Flash will make the memory run wild though?

  • Is there a way of getting a "schedule view" in iCal on a mac and on iPad in the same way you can get one on iPhone?

    IS there a way to get a schedule view of events on a busy day in iCal on the iPad 2 Air and on the Macbook Pro?  I can get this view on an iPhone.

    I am paranoid that some untrusted technician is going to make a copy of my music (11,000 tracks) or share some of my personal information (scanned copies of my birth certificate, passport, certificates, photos, etc.) on the web.
    If you put your info into the computer and hand it to another, you have to assume they will copy everything.
    Why are you putting scanned copies of valuable identity information into a computer than can be hacked, stolen, lost or compromised by a dirty tech?
    Have you lost your mind?
    Is there a way of finding out what activity has taken place whilst they've had it in their possession?
    No. The tech would just deny it if he did, or tell the truth which the answer would be "NO" in either case.
    The employer won't ask that sort of questions without solid proof, less they make a enemy of the employee and/or risk being sued for defamation of character.
    It's not like they bother to have a team of people watching over his shoulder that he doesn't stick a USB thumb drive of your data into his pocket to take home.
    I am paranoid that some untrusted technician is going to make a copy of my music (11,000 tracks)
    If it's iTunes music, it has your personal ID embedded into the song files. Most IT techs know this though.
    I appreciate any advice you guys can offer.
    Too late now, all you can do is not worry about it.
    Take your personal info out of the machine and if you need it, burn cd/dvd copies, a few USB thumb drives, Iron Keys or self encrypting external storage drives with key and/or keypad.

  • Can I put more than one user under one Apple ID account. I want to let other family members use imessage on their own Apple device. Or is there another way to get this end result?

    Can I put more than one user under one Apple ID account. I want to let other family members use imessage on their own Apple device. Or is there another way to get this end result?

    You can seach the net for solutions like this one http://appletvvpn.com/how-to-connect-apple-tv-2-to-vpn/ another idea is to use a PC as the control and fit that with a wireless card and set up a ad hoc wireless network that the Apple TV uses. 

  • Is there a way to get a log of the bluetooth devices my iphone has been connected to?   My Bluetooth car speaker phone was recently stolen from my car and appears to be on Craigslist.

    Is there any way to get a log of the bluetooth devices my Iphone has been connected to?  I recenly had my Bluetooth Jabra stolen from my car and now a simliar one is on Craigslist.  I'd like to give my connection log to the police before I go and see if my Iphone recognizes the device in question.  Any way to get any type of bluetooth device connection log out of my iphone?

    Your contacts should still be on whatever program you sync your iphone to (i.e. Outlook, address book).
    The iphone is not a stand alone device. It is designed to be synced with a computer. If you have not been syncing with a compatible program, then you are out of luck. Your contacts are not included in the back-up because it is meant to be synced with your computer.
    "Although iTunes backs up most of your iPhone and iPod touch settings, downloaded applications, and other information (Contacts, calendars, notes, images in the Camera Roll), your audio, video, and photo content are not included in the backup."
    http://support.apple.com/kb/HT1414

  • In previous versions of i Tunes you could highlight a song in your library and there would be a genious list on the right side of the screen showing songs like the one highlighted in the library. Now I do not get that list. Is there a way to get this back

    In previous versions of i Tunes I could highlight a song in my library and a genious list would show on the right side of the screen listing songs that were like the one highlighted. Now I do not get that list. Is there a way to get that back?

    Hi again Bob,
    I believe I've found the feature you were speaking about now. Information on the "In the Store" feature of iTunes can be found here:
    Apple - iTunes - Inside iTunes - Using In the Store from within your iTunes Library.
    http://www.apple.com/itunes/inside-itunes/2013/01/using-in-the-store-from-within -your-itunes-library.html
    Thanks for using the Apple Support Communities. Have a good one!
    -Braden

  • Is there a way to get a version of the Garage Band app that runs on version 5.1.1?  I have an iPad 1 and can't get any higher iOS.  The App store is telling me that Garage Band only runs on iOS 7.

    Is there a way to get a version of the Garage Band app that runs on version 5.1.1?  I have an iPad 1 and can't get any higher iOS.  The App store is telling me that Garage Band only runs on iOS 7.

    Unfortunately the answer is still no.

  • Is there a way to get iCal to put the time of each event on Monthly view without going in and editing each event?

    When I enter a new event on iCal with the time, it leaves the time off of the Monthly view and in order for me to glance at the times of the day's events I have to click on each event or go into the event and edit it again putting the time on, for it to show.  Is there a way to get it to show without doing this?

    Sorry.  Only after posting did I see that this question has been asked already and the answer given.  Please ignore this post.

  • Is there another way of getting apps from the appstore without putting your credit card number in, ive heard about the itunes gift card thing can anybody just give me more info about that and how i can buy free things free things from the appstorepls help

    Is there another way of getting apps from the appstore without putting your credit card number in, ive heard about the itunes gift card thing can anybody just give me more info about that and how i can buy free things free things from the appstore...pls help as im only a teenager and have no credit credit and my parents dont trust me with theres and they dont care about the fact that you can set up a password/.... PLEASE SOMEONE HELP I WILL BE SO GRATEFUL... And i would really like to get the iphone 4 but if there is no way of etting apps without your credit number then i would have to get a samsung galaxy s3 maybe ...

    You can set up an Apple ID without a credit card.
    Create iTunes Store account without credit card - Support - Apple - http://support.apple.com/kb/ht2534

  • Probably asked and answered a million times but my laptop died and my boyfriend and i are now sharing a computer when i went to back up my contacts i ended up with all of his! Is there a way to get them off and how do i prevent this from happening again?

    probably asked and answered a million times but laptop died and my boyfriend and i are now sharing a computer when i went to back up my contacts i ended up with all of his? Is there a way to get them off without deleting each one? Also how do i prevent this from happening again? can someone direct me to some info on multiple phones on one itunes i am lost.

    Hey there 79usma79!
    I have a couple of articles for you that can help you troubleshoot the issues you are seeing with iTunes on Windows XP. The first is a general troubleshooting article, which can be found right here:
    iTunes for Windows XP: Troubleshooting unexpected quits, freezes, or launch issues
    http://support.apple.com/kb/TS1421
    This article can help you find out if there are any conflicts between your copy of Windows XP and iTunes, and can tell you what to do if there are. Before going down the troubleshooting route though, you should take a look at this article, which can help you back up your entire iTunes library to an external hard drive, so if this issue is recurring, you will be able to restore from that backup and will not have to worry about losing your playlists or music again:
    iTunes: Back up your iTunes library by copying to an external hard drive
    http://support.apple.com/kb/HT1751
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • Is there a way to get the voice memos from my iPhone on to my pc?

    Is there a way to get the voice memos from my iPhone on to my pc?

    See http://www.tech-recipes.com/rx/6403/iphone-transfer-voice-memos-from-iphone-to-c omputer/.

  • 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.

  • Is there any way to get the appStore link for my application

    Hi everyone , i am developing an app which has a feature of sharing its appstore link with the friends through mail,so that they can see my appplication in appstore and buy it directly on click of a button. For that i need to use the app store link of my application for sending it . is there any way to get that and using it dynamically in my app immediately after releasing it.

    Your best bet would be to create a web page of your own for the app. Design that page so that it uses 'META REFRESH' to redirect the visitor straight to the App Store link.
    That way you can hard-wire your own web page address into your app.
    This has the advantage that it can work well even before you've noticed that your app has arrived on the App Store. Create a real web page, describing the app and telling people to search for it in the App Store by name - then replace it with the auto-redirect page when you've discovered your application's App Store address.

  • HT1386 i am trying to restore a backup og my iphone 4 from itunes on my macbook, it asks me for a password which i do not recall setting up, is there any way of getting this password.

    i am trying to restore a backup og my iphone 4 from itunes on my macbook, it asks me for a password which i do not recall setting up, is there any way of getting this password.

    No there's not.  Otherwise that wouldn't be very secure, would it?

  • Is there a way to get the songs back after you do a sync and erase? I no longer have them stored on my harddrive.

    Thanks to a wonderful geeksquad agent all my songs have been deleted from my ipod. They had to restore my computer so the ones I downloaded are no longer on my harddrive or in itunes. Is there a way to get the songs back after you do a sync and erase?

    If they are on the iPod there are third-party programs that will transfer then to  a computer. See:
    Copy music from Ipod to new computer...: Apple Support Communities
    If they ae not on either the iPOd or the computer they are gone.

Maybe you are looking for