Getting the height to read back properly is something I've had trouble with in the past. I came up with a few hacks that worked but were definitely not the proper way to fix the problem. One was to use a timer set to 200ms with a callback function that adjusted the height of the component. So I would add everything to it and then kick off the timer. Since it was only 200ms there was no visible indication that the user could see. Just in case I added a 500ms or 1sec fade in effect to it as well. From what you are describing using a zoom effect might look nice. Again, not the proper way to fix it but it might work for you until you can get the issue resolved the correct way.
As for the scoping issue... that is another fun one. You can save off a component in a global variable that you can call the addChild method on it from within the event listener callback function. Not ideal but it will work. Sorry for the hack suggestions instead of real fixes but I'm fairly new to it all myself so I end up hacking a lot of things together to get demo's working ASAP and then getting things right for version 2. :) On Dec 21, 7:35 pm, KC <[email protected]> wrote: > Thanks for the suggestion, Terry. > > Unfortunately, I have tried validateNow() in a couple different places > without any change. I'm filling the main container with a couple of > other containers, the largest of which is an HBox containing a couple > of text fields. If I create an addEventListener > (FlexEvent.CREATION_COMPLETE) on the largest HBox and then look at > that height property, I can at least set the height for that container > correctly and then access that value for the infoWindow. BUT, that > doesn't really work because the final addChild will happen without > waiting for the CREATION_COMPLETE, and I can't seem to get the scope > correctly set to be able to addChild from within the CREATIOn- > COMPLETE, so I'm back at square one. > > Also, if it helps, I'm creating a Sprite to hold the infoWindow > content like this: > > var infoBoxContent:Sprite = new Sprite(); > // Call the InfoWindowLocationContent Class > infoBoxContent = new InfoWindowLocationContent(content); > > And InfoWindowLocationContent extends UIComponent. > > Thanks again for any and all help! > > KC > > On Dec 21, 4:25 pm, Terry Reinert <[email protected]> wrote: > > > Have you tried calling validateNow() on the container that goes into > > the info window before trying to read its height? The validateNow() > > method validates and updates the properties and layout of the > > container and then redraws it if necessary. This process must be done > > before trying to read its height or you'll just get 0 since it hasn't > > been laid out yet. > > > On Dec 21, 4:16 pm, KC <[email protected]> wrote: > > > > Hi - > > > > I've created a class to populate an infoWindow's customContent. > > > Basically: > > > > var infoBoxContent:Sprite = new Sprite(); > > > // Call the InfoWindowLocationContent Class > > > infoBoxContent = new InfoWindowLocationContent(content); > > > > And the class creates a couple HBox, formats the content, pulls in an > > > image, then after the final addChild in the InfoWindowLocationContent > > > I set the infoWindow.customContent = infoBoxContent; > > > > All of this works great. The issue is then setting the > > > infoWindow.height based on the actual height of the infoBoxContent. > > > Everything I try keeps coming back 0. If I debug, I can see the > > > height getter variable is set correctly, but not the height itself. > > > > Any thoughts on how to get this? I'd hate to have to extend > > > OverlayBase just for this. Anyway to access the getter variable > > > easily? > > > > Thanks for any and all suggestions! > > > > KC -- You received this message because you are subscribed to the Google Groups "Google Maps API For Flash" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api-for-flash?hl=en.
