OK, thanks Ben. I'm halfway there now. I listened for the
updateComplete event and it works great, it redraws and repositions the
graphics I'm drawing.
However, the graphics themselves, when you resize the panel a certain
amount, will still appear outside the panel area if the panel is small
enough. I'd like them to be part of the panel so that if more is drawn
inside the canvas than actually fits, the scrollbars appear and it
doesn't draw outside the panel. Do you know what I need to do that?
Thanks.
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 Merrill, Jason
Sent: Thursday, January 17, 2008 4:57 PM
To: [email protected]
Subject: RE: [flexcoders] Re: Drawn objects acting as children
to components?
Hmm, OK, no it's not in updateDisplayList - like I'm not
overriding that - but maybe I should be or listening for that event
instead. Thanks. I was just drawing directly onto the UIComponent
inside the panel.
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 ben.clinkinbeard
Sent: Thursday, January 17, 2008 3:57 PM
To: [email protected]
Subject: [flexcoders] Re: Drawn objects acting as
children to components?
Where are you making your calls to the drawing API? It
should be in
updateDisplayList(), but that would require subclassing.
If you don't
want to subclass you could probably hook up a listener
to
networkBrowser's updateComplete event and clear and then
redraw the
graphics in the handler.
HTH,
Ben
--- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , "Merrill, Jason"
<[EMAIL PROTECTED]> wrote:
>
>
> Subject sums it up, but to clarify, I'm using the draw
API in AS#
> (Sprite.graphics methods) to draw dynamically draw
objects in sprites
> inside a panel holding a UIComponent:
>
> i.e. networkBrowser.graphics.drawCircle(100, 100, 50);
>
> and then in MXML:
>
> <mx:Panel id="networkBrowserPanel" width="100%"
height="100%"
> layout="absolute" title="Network" >
> <mx:VBox horizontalAlign="left">
> <mx:UIComponent id="networkBrowser" />
> </mx:VBox>
> </mx:Panel>
>
> it works great. However, since the panel's width is
intentionally 100%
> and height 100% so that when the browser window is
resized, the panel
> resizes accordingly, the problem I have found with
using the draw
> methods is that the objects that are drawn don't act
like children of
> the Panel or Vbox components. For example, when you
resize the browser
> and the panel re-sizes, the drawn graphics do not
move- in fact, if you
> resize the panel enough, the graphics can appear
OUTSIDE the panel.
> Also, naturally I would like the graphics to be masked
by the panel's
> canvas, so that if the graphics are scaled up, they
don't appear outside
> the Panel, and if there is a lot of graphics drawn
which extend outside
> of the Panel's canvas, scrollbars will automatically
appear.
>
> I can post an image if that helps to show the problem.
Thanks for any
> help, I'm sure this has been covered before, but I
couldn't locate it in
> the archives.
>
> Jason Merrill
> Bank of America
> GT&O L&LD Solutions Design & Development
> eTools & Multimedia
>
> Bank of America Flash Platform Developer Community
>