| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <s:Module xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:mx="library://ns.adobe.com/flex/mx" |
| xmlns:my="*" minWidth="600" minHeight="350" |
| creationComplete="requestPhotos()" backgroundColor="0x323232"> |
| |
| <fx:Script> |
| <![CDATA[ |
| import mx.collections.ArrayCollection; |
| import mx.rpc.events.ResultEvent; |
| |
| import spark.components.Group; |
| import spark.components.supportClasses.GroupBase; |
| import spark.effects.animation.MotionPath; |
| |
| [Bindable] |
| private var photoFeed:ArrayCollection; |
| |
| private function requestPhotos():void { |
| var params:Object = new Object(); |
| params.format = 'rss_200_enc'; |
| params.tags = searchTerms.text; |
| photoService.send(params); |
| } |
| |
| private function photoHandler(event:ResultEvent):void { |
| photoFeed = event.result.rss.channel.item as ArrayCollection; |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Declarations> |
| <s:HTTPService id="photoService" |
| url="http://api.flickr.com/services/feeds/photos_public.gne" |
| result="photoHandler(event)" /> |
| </fx:Declarations> |
| |
| <s:Panel title="Image Wheel Sample" width="100%" height="100%"> |
| <s:layout> |
| <s:VerticalLayout paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"/> |
| </s:layout> |
| |
| <s:HGroup verticalAlign="middle"> |
| <s:Label text="Flickr tags or search terms:" color="0xFFFFFF"/> |
| <s:TextInput id="searchTerms" |
| enter="requestPhotos()" text="bugs" /> |
| <s:Button label="Search" |
| click="requestPhotos()" /> |
| <!-- The slider to control the axis angle --> |
| <s:HSlider id="axisSlider" minimum="-90" maximum="90" |
| value="10" liveDragging="true" width="300"/> |
| </s:HGroup> |
| |
| <s:List width="100%" height="100%" |
| dataProvider="{photoFeed}" |
| itemRenderer="FlickrThumbnail" |
| id="theList"> |
| |
| <s:layout> |
| <my:WheelLayout gap="20" axisAngle="{axisSlider.value}"/> |
| </s:layout> |
| </s:List> |
| </s:Panel> |
| |
| </s:Module> |