Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-flash] TabBar actual width

Expand Messages
  • Josh Tynjala
    I think you can listen for a ComponentEvent.RESIZE event (or something very similar) on TabBar. After the listener is called, tabBar.width should be accurate.
    Message 1 of 3 , Mar 8 11:47 PM
    • 0 Attachment
      I think you can listen for a ComponentEvent.RESIZE event (or something very similar) on TabBar. After the listener is called, tabBar.width should be accurate.

      Alternatively, try calling tabBar.drawNow() to cause it to redraw immediately. After the call, check tabBar.width.

      - Josh

      On Thursday, March 8, 2012, martizhen <martizhen@...> wrote:
      >  
      >
      > Hi, I'm new to as3 and I'm trying to figure out how to get the actual width of the TabBar object. TabButton width depends on the text content. My TabBar content changes dynamically so at some stage it overflows the container. I need to add a scroller when it happens but I need to know the current width of my tab menu. What I need is a xPosition from drawButtons method of TabBar.as. Is there any way of accessing that? Thanks in advance.
      >
      >
    • martizhen
      Thanks! tried tabBar.drawNow(),it works.
      Message 2 of 3 , Mar 13 11:35 AM
      • 0 Attachment
        Thanks! tried tabBar.drawNow(),it works.

        --- In ydn-flash@yahoogroups.com, Josh Tynjala <joshtynjala@...> wrote:
        >
        > I think you can listen for a ComponentEvent.RESIZE event (or something very
        > similar) on TabBar. After the listener is called, tabBar.width should be
        > accurate.
        >
        > Alternatively, try calling tabBar.drawNow() to cause it to redraw
        > immediately. After the call, check tabBar.width.
        >
        > - Josh
        >
        > On Thursday, March 8, 2012, martizhen <martizhen@...> wrote:
        > >
        > >
        > > Hi, I'm new to as3 and I'm trying to figure out how to get the actual
        > width of the TabBar object. TabButton width depends on the text content. My
        > TabBar content changes dynamically so at some stage it overflows the
        > container. I need to add a scroller when it happens but I need to know the
        > current width of my tab menu. What I need is a xPosition from drawButtons
        > method of TabBar.as. Is there any way of accessing that? Thanks in advance.
        > >
        > >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.