[flexcoders] Enhanced Constraints Confusion...
Hi guys, I'm trying to work out how to use the Flex 3 constraints to replace a currently hand-coded layout. I'm running into a problem with content-sized constraints: how to have child components that position themselves on a particular constraint but don't actually affect the size of that constraint? The layout I'm looking for is this (each letter represents a component): A PMT C D Component PMT is the central component: the other components need to be a set distance to the left (A), right (C) or below (D). I've specified the constraints like so: (Schematic is a Canvas) (A is specified as right="pmtLeft:0") (PMT & D are specified as horizontalCenter="pmtCentre:0") (C is specified as left="pmtRight:15") So pmtLeft is sized to the width of A, pmtRight to the width of C, and pmtCentre to the width of PMT or D, whichever is greater. The problem is I need pmtCentre to be sized to the width of PMT only, and ignore the width of D. Yet I still need D centred on pmtCentre. I need the content-sized constraints, so PMT can be changed, but I also need D to be able to grow wider than its constraint. I.e. D needs to be centred under PMT but not affect the width of the "pmtCentre" ConstraintColumn. Is this possible? I tried includeInLayout="false" but that didn't do anything. I guess I'm looking for the equivalent of spanCols/spanRows for constraints. Am I missing something or is this a limitation of the enhanced constraints? If it is a limitation then they aren't as useful as claimed... Any alternatives suggested would be welcome too. Cheers, Charlie
Re: [flexcoders] Words Disappearing when Printing
Chris Infanti wrote: > The problem is...the last word of any Text components I have in the > container disappear whenever I print. Otherwise it prints as expected. > > I've encountered this many times. It's really irritating and hard to debug... The root cause is most likely the scaling rather than the printing of itself. Are you using system (default) or embedded fonts? If you're not already using them try embedded fonts - they scale better. Depending on the font you may also need to set fontAntiAliasType to normal rather than advanced (the default). The normal anti-aliasing doesn't look as nice but scales much more reliably. The advanced anti-aliasing varies character width depending on the scaling: this confuses the text width calculations. Sounds like Flash Player 10 will improve text handling: can't wait for that. (and hope it delivers on the promise...) Charlie
[flexcoders] How to Pass Data From Server to Client On App Load
Hi guys, I've been banging around solutions to this (apparently) simple problem for a few months. I still haven't found something I'm happy with. In our system users load Flex apps off an Apache server, authenticating to Apache using Single Sign-On (mod_auth_kerb against an ActiveDirectory server). The Flex app then loads/modifies data using HTTPServices to a Rails app. Apache passes the authentication details to Rails in a header, so I know the username in Rails and can lookup groups using LDAP on the AD server. My problem is: how do I quickly and securely pass the name of the logged in user to the Flex app running on the client? I've tried the following methods: 1. Use mod_rewrite to redirect the browser to app.swf?user=%{REMOTE_USER} and then use ExternalInterface to read the user parameter in Flex. -- Can get the user straight away, yay, but it's obviously insecure. 2. Provide a Rails action that reports the authenticated user (and groups). -- Not quick enough: I want to know the user straight away at app startup so I can display admin functions to admin users. Also the HTTPService call seems like unnecessary overhead to me. Any ideas how to do this? Some options I can think of but I'm not sure are possible: 1. Embed the username in the .swf somehow. I guess this would be a use for live-compiled MXML files on the server (but we don't have FDS/LCDS). 2. Configure Apache to send the username back in the HTTP headers and read them using ExternalInterface (possible?). Wouldn't be particularly secure. Although all the actual security is in Rails, so even if people managed to get the admin interface in Flex they couldn't use it to change anything on the server without the correct permissions on their user account. 3. Delay the startup of the Flex app until I get a result from the user HTTPService? I don't really want the user to wait though... 4. Use ExternalInterface to get the authenticated username from the browser using JavaScript. No idea if there are JavaScript functions to do this but would probably be the best method - no round trip to the server. Ta! Charlie