Note that there are some explanatory texts on larger screens.

plurals
  1. POSmooth sliding animation in Flex with large amounts of components
    text
    copied!<p>I have a component I created that works like a Viewstack but the next index component slides in from one of the four sides. I've got it working well enough that it's acceptable to use, but I want to make it more efficient.</p> <p>Right now I'm using a Canvas as the base component, I create a snapshot of the current view using an ImageSnapshot (<code>new Bitmap( ImageSnapshot.captureBitmapData( this ) )</code>), and I slide the new index on top of that image on index change.</p> <p>I'm basically looking for suggestions on how to do this a better way. By taking the Image after the component loads, and after the slide happens, I've gotten the initial jaded moves down to a minimum, but we normally use this for transitioning grids so it's almost always slow on the first or first couple slides.</p> <p>Here's what some of it looks like so far:</p> <pre><code>private function creationComplete(e:Event):void { tmpImage.source = new Bitmap( ImageSnapshot.captureBitmapData( this ) ); } public function set selectedIndex(value:int):void { if(_selectedIndex == value + 1) return; _selectedIndex = value+1; var obj:UIComponent; tmpImage.height = height; tmpImage.width = width; tmpImage.visible = true; tmpImage.x = 0; //tmpImage.includeInLayout = true; for (var i:int = 1; i &lt; numChildren; i++) { obj = UIComponent(getChildAt(i)); //obj.x = width; if(i == _selectedIndex){ obj.visible = true; objDisplay = obj; } else obj.visible = false; } mv1.target = tmpImage; mv2.target = objDisplay; switch ( direction ) { // X/Y sliding logic } parEfect.play(); tmpImage.source = new Bitmap( ImageSnapshot.captureBitmapData( this ) ); } </code></pre> <p>If you're wondering, I'm using index 0 of the canvas for the image, and offset my custom selectedIndex by 1.</p> <p>I'll post more of it if need be, but I want to keep the question down to a minimum and this pretty much sums it up.</p> <p>Any help is greatly appreciated! I really want to get this component to perform better. Also, this has to be done using Flex 3</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload