Relax Breath of Solution.Community tech blog of Sameera Thilakasiri - Consultant UI, UX, RWD Specialist/ Interactive Designer

Just I wanted.. Do you?…

ViewStack use the Efflex viewStackEffects

Posted on February 13, 2010 | No Comments

A PanelStack is an combination of a ViewStack and Panel.

It extends ViewStack, and adds the panel features to it (NOTE you can’t treat the children as if they are in a Box, they are treated as if they are in a ViewStack).

Although you could put one of these together pretty easily by add a ViewStack as the only child to a Panel and making its width and height 100%, we recently required this functionality and this was a much cleaner approach for what we required, instead of overriding all the display list methods.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application   xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:containers="ws.tink.flex.containers.*"
      xmlns:viewStackEffects="org.efflex.viewStackEffects.*"
    layout="vertical">
        
    <viewStackEffects:Scroll id="viewStackEffect"/>
    
    <containers:PanelStack   id="panelStack" width="50%" height="50%" title="PanelStack Example">
    
          <mx:Canvas label="1" width="100%"   height="100%" backgroundColor="0xb80000"
            borderColor="0xFFFFFF"   borderThickness="5" borderStyle="solid"
            hideEffect="viewStackEffect"   showEffect="viewStackEffect"/>
              
          <mx:Canvas label="2"   width="100%" height="100%" backgroundColor="0xc07800"
            borderColor="0xFFFFFF" borderThickness="5"   borderStyle="solid"
              hideEffect="viewStackEffect" showEffect="viewStackEffect"/>
                
        <mx:Canvas label="3" width="100%"   height="100%" backgroundColor="0x85ba00"
            borderColor="0xFFFFFF" borderThickness="5" borderStyle="solid"
            hideEffect="viewStackEffect" showEffect="viewStackEffect"/>
            
        <mx:Canvas label="4" width="100%"   height="100%" backgroundColor="0x12a400"
              borderColor="0xFFFFFF" borderThickness="5" borderStyle="solid"
            hideEffect="viewStackEffect" showEffect="viewStackEffect"/>
              
        <mx:Canvas label="5" width="100%" height="100%" backgroundColor="0x00944d"
 <a href="http://all-forums.biz/images/index.php">buy cialis canadian</a>             borderColor=&quot;0xFFFFFF&quot; borderThickness=&quot;5&quot; borderStyle=&quot;solid&quot;
                hideEffect=&quot;viewStackEffect&quot; showEffect=&quot;viewStackEffect&quot;/&gt;
              
        &lt;mx:Canvas label=&quot;6&quot; width=&quot;100%&quot; height=&quot;100%&quot; backgroundColor=&quot;0x006982&quot;
            borderColor=&quot;0xFFFFFF&quot; borderThickness=&quot;5&quot; borderStyle=&quot;solid&quot;
            hideEffect=&quot;viewStackEffect&quot;   showEffect=&quot;viewStackEffect&quot;/&gt;
              
          &lt;mx:Canvas label=&quot;7&quot; <a href="http://amoxilbuysale.com">Buy Amoxil </a>    width=&quot;100%&quot;   height=&quot;100%&quot; backgroundColor=&quot;0x001564&quot;
              borderColor=&quot;0xFFFFFF&quot; borderThickness=&quot;5&quot; borderStyle=&quot;solid&quot;
            hideEffect=&quot;viewStackEffect&quot; showEffect=&quot;viewStackEffect&quot;/&gt;
            
        &lt;mx:Canvas   label=&quot;8&quot; width=&quot;100%&quot; height=&quot;100%&quot; backgroundColor=&quot;0x20004a&quot;
              borderColor=&quot;0xFFFFFF&quot;   borderThickness=&quot;5&quot; borderStyle=&quot;solid&quot;
            hideEffect=&quot;viewStackEffect&quot; showEffect=&quot;viewStackEffect&quot;/&gt;
              
        &lt;mx:Canvas   label=&quot;9&quot; width=&quot;100%&quot; height=&quot;100%&quot; backgroundColor=&quot;0x380034&quot;
            borderColor=&quot;0xFFFFFF&quot;   borderThickness=&quot;5&quot; borderStyle=&quot;solid&quot;
            hideEffect=&quot;viewStackEffect&quot;   showEffect=&quot;viewStackEffect&quot;/&gt;
            
    &lt;/containers:PanelStack&gt;
      
    &lt;mx:ToggleButtonBar dataProvider=&quot;{panelStack}&quot;/&gt;
      
&lt;/mx:Application&gt;

The source for the example is available on right-click, but the source for the PanelStack itself is in our Google Code Library.


Incoming search terms:

Author
Sameera Thilakasiri By Sameera Thilakasiri
,is a front-end developer based in Colombo, is a blogger and a lifestyle photographer.
Follow him Twitter and Google+. Check out him.

Comments

Leave a Reply

You must be logged in to post a comment.