topical media & game development
lib-flex-store-productsView-ProductFilterPanel.mx
lib-flex-store-productsView-ProductFilterPanel.mx
(swf
)
[ flash
]
flex
<?xml version="1.0" encoding="utf-8"?>
<!--
//////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2003-2006 Adobe Macromedia Software LLC and its licensors.
// All Rights Reserved.
// The following is Sample Code and is subject to all restrictions on such code
// as contained in the End User License Agreement accompanying this product.
// If you have received this file from a source other than Adobe,
// then your use, modification, or distribution of it requires
// the prior written permission of Adobe.
//
//////////////////////////////////////////////////////////////////////////
-->
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:productsView="*"
xmlns:flexstore="*"
height="100%"
paddingLeft="4"
paddingRight="12"
paddingTop="12"
paddingBottom="8"
verticalGap="0"
currentState="showingThumbnails">
<mx:Metadata>
[Event(name="filter", type="lib_flex_store_samples_flexstore_ProductFilterEvent")]
[Event("compare")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import mx.controls.sliderClasses.Slider;
import mx.controls.Alert;
//import samples.flexstore.ProductFilterEvent;
private var thumbBeingPressed:Boolean;
private function dispatchFilter():void
{
var event:lib_flex_store_samples_flexstore_ProductFilterEvent =
new lib_flex_store_samples_flexstore_ProductFilterEvent(filter, thumbBeingPressed);
dispatchEvent(event);
currentState = "showingThumbnails";
}
private function sliderValue(values:Array, index:int):Number
{
return values[index];
}
private function productRemoved():void
{
if (currentState == "showingComparison")
{
if (productList.items.length == 0)
{
dispatchFilter();
}
else
{
attemptCompare();
}
}
}
private function attemptCompare():void
{
if (productList.items.length > 0)
{
dispatchEvent(new Event("compare"));
currentState = "showingComparison";
}
else
{
Alert.show("There are no items to compare.", "Compare");
}
}
]]>
</mx:Script>
<flexstore:lib_flex_store_samples_flexstore_ProductFilter id="filter">
<flexstore:series>{series.selectedItem}</flexstore:series>
<flexstore:minPrice>{sliderValue(priceSlider.values, 0)}</flexstore:minPrice>
<flexstore:maxPrice>{sliderValue(priceSlider.values, 1)}</flexstore:maxPrice>
<flexstore:triband>{cbTriband.selected}</flexstore:triband>
<flexstore:camera>{cbCamera.selected}</flexstore:camera>
<flexstore:video>{cbVideo.selected}</flexstore:video>
</flexstore:lib_flex_store_samples_flexstore_ProductFilter>
<mx:CurrencyFormatter currencySymbol="
(C) Æliens
18/6/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.