2 Replies Latest reply on Dec 3, 2010 1:55 AM by VirtualCoder

    SWFLoader centering and resizing

    VirtualCoder Level 1

      Hi Folks,


      If I had no self control, I would smash my screen just about now.


      I have a YouTube player in a SWFLoader and the end result that I am after is to have it anchored to all sides so that it takes up all of the space that it has and especially on a window resize.  In addition, I would like to place it in the centre (left/right and top/down) because in most cases only one of the directions (vertical or horizontal) can be fully used up - due to it keeping the aspect ratio.


      So, it is anchoring that seems not to work or at least not if I anchor it to all 4 sides as well as click the vertical and horizontal centering, at the same time.


      Thanks for you help,


        • 1. Re: SWFLoader centering and resizing
          Flex harUI Adobe Employee

          I don't know how the YouTube player reacts to the way SWFLoader resizes

          content.  You may need to customize a SWFLoader to get it to work, and it

          still may not work if the YouTube player makes any stage assumptions.

          • 2. Re: SWFLoader centering and resizing
            VirtualCoder Level 1

            But if I want the SWFLoader to resize so that it takes up all of the browser window space (including resizing and maximizing the window) what SWFLoader properties should be set.  I set both its width and height to be this.width and this.height for the current window but I am unable to center horizontally nor vertically the SWFLoader.  It needs to be centered because it keeps the aspect ration, such that only one of the two horizontal/vertical directions takes up 100% of space while the other direction is always shorter.


            Can you post some code (any random code you can find) where you are setting size and or x,y co-ordinates of the SWFLoader?

            I could probably figure out what Youtube is doing but only once I wrap my mind around SWFLoader itself.


            Thanks again,