Duh.  Thanks.  You must be a Flash guy, like I am.  
 
 

Jason Merrill 
Bank of America 
GT&O L&LD Solutions Design & Development 
eTools & Multimedia 

Bank of America Flash Platform Developer Community 



 


________________________________

        From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Branam
        Sent: Friday, January 18, 2008 3:11 PM
        To: [email protected]
        Subject: Re: [flexcoders] Drawn objects acting as children to
components?
        
        

        
        Instead of changing the height, which will not affect the size
at all, you need to change the scaleX/scaleY properties:
         
        scaleX += .2;
        scaleY += .2;
        
        
        On Jan 18, 2008 3:03 PM, Merrill, Jason
<[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:
        

                
                Yeah, but for some reason when I do getBounds(this) and
then re-size the panel, the drawn graphic can extend beyond the
boundaries of the Panel.  
                 
                Also, zooming is tough because if I simply increase or
decrease width and height, it seems to move the graphic instead of
change it's size... 
                 
                 
                  public function zoomIn():void
                  {
                   height += 100;
                   width += 100;
                   updateDisplayList(unscaledWidth, unscaledHeight);
                  }
                  
                  public function zoomOut():void 
                  {
                   height -= 100;
                   width -= 100;
                   updateDisplayList(unscaledWidth, unscaledHeight);
                  }

                Jason Merrill 
                Bank of America 
                GT&O L&LD Solutions Design & Development 
                eTools & Multimedia 

                Bank of America Flash Platform Developer Community 



                 


________________________________

                        From: [email protected]
<mailto:[email protected]>  [mailto:[email protected]
<mailto:[email protected]> ] On Behalf Of Alex Harui
                        Sent: Friday, January 18, 2008 1:42 PM
                        To: [email protected]
<mailto:[email protected]> 
                        Subject: RE: [flexcoders] Drawn objects acting
as children to components? 
                        
                        

                        
                        You want the bounds of what you drew, so
getBounds(this) should be correct.
                         
                        If you set scaleX/Y to zoom, you shouldn't need
to do anything.  If you set scaleX/Y on an internal thing to zoom or in
the case of the circle, multiply the radius by some zoom factor, then
you have to report that new measuredWidth/Height in measure() and maybe
call invalidateList if you have some property like zoomFactor that we're
not already watching for changes 

________________________________

                        From: [email protected]
<mailto:[email protected]>  [mailto:[email protected]
<mailto:[email protected]> ] On Behalf Of Merrill, Jason
                        Sent: Friday, January 18, 2008 10:36 AM
                        To: [email protected]
<mailto:[email protected]> 
                        Subject: RE: [flexcoders] Drawn objects acting
as children to components? 
                        
                        

                        
                        I thought the container reference was needed by
the getBounds() method - it requires an  argument of a UIComponent of
some kind, I thought the custom component would need to know the new
size of the container when it got re-sized.  If I don't need the
container reference, then maybe I could just say getBounds(this) instead
and it would work. 
                         
                        Also, I want to implement a method to scale the
graphics up and down, I have that working, but I'm back to the graphic
not being centered and not staying within the boundaries of the Panel
container again when the zoom occurs.  I tried calling updateDisplayList
again when the zoom action happens, but that didn't work.  Any thoughts
there? 
                         

                        Jason Merrill 
                        Bank of America 
                        GT&O L&LD Solutions Design & Development 
                        eTools & Multimedia 

                        Bank of America Flash Platform Developer
Community 



                         


________________________________

                                From: [email protected]
<mailto:[email protected]>  [mailto:[email protected]
<mailto:[email protected]> ] On Behalf Of Alex Harui
                                Sent: Friday, January 18, 2008 12:10 PM
                                To: [email protected]
<mailto:[email protected]> 
                                Subject: RE: [flexcoders] Drawn objects
acting as children to components? 
                                
                                

                                
                                I think in the general case, you'll need
to set minHeight/minWidth to zero or something small on the Panel or
have fixed width/height on the Panel to get the Panel to consider
putting up scrollbars. 
                                 
                                The graphics object should compute
measuredMinWidth/measuredMinHeight to be the same as
measuredWidht/Height so the Panel will not try to shrink it past its
dimensions. 
                                 
                                If you can compute the measurements w/o
drawing then you don't need commitProperties and just draw in
updateDisplayList.
                                 
                                I don't know why you need a container
reference unless it is to get the bounds of the container to determine
where to draw, but if you've set up % widht/height you'll be given those
dimensions in updateDisplayList. 

________________________________

                                From: [email protected]
<mailto:[email protected]>  [mailto:[email protected]
<mailto:[email protected]> ] On Behalf Of Merrill, Jason
                                Sent: Friday, January 18, 2008 7:02 AM
                                To: [email protected]
<mailto:[email protected]> 
                                Subject: RE: [flexcoders] Drawn objects
acting as children to components? 
                                
                                

                                
                                Hey Jim, passing minWidth and minHeight
to the custom UI component worked perfectly for me - now the drawn
graphic is contained in the Panel container - thank you! 
                                 

                                Jason Merrill 
                                Bank of America 
                                GT&O L&LD Solutions Design & Development

                                eTools & Multimedia 

                                Bank of America Flash Platform Developer
Community 

                                

                                

                                

                                

                                

                                

                        

                        

                        

                        

                        

                        

                

                

                


        

         

Reply via email to