4 Replies Latest reply on Aug 30, 2010 8:02 AM by Boy Carper

    SpriteVisualElement updating dimensions

    Boy Carper

      Hey there!

       

      I'm struggling with the SpriteVisualElement in my project. I'm making a game editor that has a graphical workspace where items can be drawn on a grid. I did this before with flex 3 sdk using UIComponent where I added several Spites as layers to the UIComponent to setup my workspace. The UIComponent like the SpriteVisualElement does not update its dimensions when DisplayObjects are added to it.  So when you create a sprite that is larger than your screen it is desired that the component notifies its parent that the dimensions changed so that the appropriate scrollbars will appear and the image is masked. With the UIComponent I was able to accomplish this by setting the width and height manually according to the gridsize. I'm trying the same thing now with the SpriteVisualElement but without any success.

       

      Long story short:

      How can I update the SpriteVisualElement's dimensions so that the parent will apply a scrollRectangle and display the scrollbars?