Our Gallery for displaying and selecting graphical objects includes vector images as well as bitmap images. The vector images are SWF files containing the actual artwork. When one of our graphical designers began adding his artwork to the Gallery he simply imported the Illustrator files into Flas and published an SWF. We didn't bother settings the stage dimensions to fit the artwork, since we've learned from before that it's the content of the Flash that counts - not the actual stage dimensions.

This turned out to be a false assumption...

The thumbnail included an mx:Image that simply had its source property set to the SWF URL. When the Gallery thumbnails loaded the artwork, the whole area of the SWF stage was included. Since we obviously only wanted to show the actual artwork in the thumb this had to be fixed. Adjusting each file from within Flash would be too time consuming so we had to come up with something else. In the end we loaded the SWF files using a Loader, adding its content to a Sprite and finally setting the Sprite as the Image source. This meant that we had to fix loading effects, since the loading now took place in the Loader and not the Image. So, how come the Sprite doesn't include the whole stage area but the Loader does? I haven't figured that out just yet, but this is one way to get the desired result. 

Tags: , , ,

Bookmark and Share
 
 
 

While developing our latest project we needed to display a quite large set of thumbnails. I started out by using the mx:TileList component for this, but soon discovered that scrolling a whole row at a time could be disorienting. I turned to another (set of) components: mx:Tile and mx:Repeater and got smooth scrolling. This presented me with another problem though: all thumbnails in the mx:Tile loaded at once - even if the ones not visible. This behavior differs from the mx:TileList which only loads what's needed (i.e. visible). So, which one is the best choice? On one hand we have the scrolling and one the other we have loading issues. We ended up using mx:Tile and a repeater, controlling the loading behavior ourselves, simply because we needed a really smooth experience scrolling though the thumbnails. This meant more work, but we have to remember that we're designing for the user, not the developer.

Tags: , ,

Bookmark and Share