Create a Flickr Viewer using Flex.In this tutorial, you will learn how to integrate photos from Flickr in your Flex application, using as.KkM9frLp5W0/T4VNgqGWYMI/AAAAAAAADTg/DtHeHC3fpTY/s1600/Flash+Player+11.3.300.214+Beta+1+IE+Free+Download+1.jpg' alt='Download Adobe Flash Player New Version 2012 Dodge' title='Download Adobe Flash Player New Version 2012 Dodge' />In this tutorial, you will learn how to integrate photos from Flickr in your Flex application, using as3flickrlib.You will need a Flickr API KEY, Adobe Flex Builder.Cheatbook your source for Cheats, Video game Cheat Codes and Game Hints, Walkthroughs, FAQ, Games Trainer, Games Guides, Secrets, cheatsbook.Now that youve taken your photo, the next step is to go to www.Pixlr is a free online app that lets you edit photos without having to download any software.You will need a Flickr API KEY, Adobe Flex Builder 3 or Eclipse with Flex Builder 3 plugin, and some basic knowledge of Flex and actionscript.You can view the final application here View Source is enabled.All the source files are here.Part 1 Creating the Flex project.Create a new Flex project called Flickr.Viewer, and choose Web application.Click on Next. Then, leave the output folder as default, it should be bin.Click on Next. Part 2 Design the user interface.The project is now ready to go.We will first designing the application.Open Flex. Viewer.Go to the Design Mode.Click on the application it should be a blue square taking all the page and go the Properties panel.Go to Layout and choose vertical in the combo.Original Article.AdultOnset Immunodeficiency in Thailand and Taiwan.Sarah K. Browne, M.D., Peter D. Burbelo, Ph.D., Ploenchan Chetchotisakd, M.D., Yupin. Box. Then go to Components panel, and in Layout select the Application.Control. Bar, then drag it in the Application.Go to Flex Properties and set a width of 1.Application. Control.Bar will be the height of its contents.Drag a Text. Input component in the Application.Control. Bar and a Button component just after the Text.Input. Set the label of the button to SEARCH FLICKR, in the Flex Properties panel.Add a Tile. List component next of the Application.Controlbar. Your application should look like that Now set up the ID parameter of the Text.Input, Button and Tile.List components in the Flex Properties panel.Text. Input should be set up to txt.Search, the Button should be set up to btn.Search and the Tile.List to pics. List.The user interface is completelly designed, lets add Flickr.Part 3 The libs. First, you will have to download the compiled versions of 2 libraries as.Flickr. Lib and as.Core. Lib. Go to http code.Download the package featured downloads.Unzip the file, and the in the expanded folder, go to bin and drag the file in Flex, inside your project, in the src folder.Once its done, go to http code.You should see that in your project and some other files of course.So now your project has the 2 libs.I strongly recommends you to use that method in any projects.By doing that, you are sure that you always have a working library.If you want to make a big application using external libraries which may evolve, I recommend you to use Flex Library projects and SVN synchronization, it will allow you to keep your code up to date.To complete that part, you need to tell Flex that you will use those libs.Right click on the project name, and then go to properties Flex Build Path and then Library path and the add SWC.Choose corelib. swc and do the same for flickr.Part 4 The code. In Code Mode, add a line after the tag.Start typing lt Mx Script.Press the Enter key.Now you should have a complete script tag.Inside of this Script tag, include the flickr functions we need import com.Then, some variables private var flickr Flickr.Service. private var apikey String enter you Flickr API key here.Result Number 5. After that, security parameters Security. Install Cgi Proxy On Centos Iso . Domainapi. flickr.Security. allow. Insecure.Domainapi. flickr.And set the data.Provider of the Tile.List import mx. Array.Collection. Bindable public var photos Array.Collection Bindable means that the Tile.List will update each time the data.Provider change. After that the function to call Flickr webservice.Basically, that means that we set up the apikey to send, an event.Listener to know when the data comes back, and the request itself to search photos, based on the Text.Input value. private function get.Images void. Flickr.Service new Flickr.Service apikey. Event.Listener Flickr. Result.Event. PHOTOSSEARCH, on.Photos. Search. Search.Result,1. Now that the code is done, we just need to connect the Tile.List to the data.Go to the Tile. List tag, and at the end of the parameters, just add data.Providerphotos. The tag should now look like that lt mx Tile.List width1. 00 height1.List data. Providerphotos item.Renderericon. Renderer If you run the application now, you wont see any images.Its because we miss an item.Renderer for the image.Part 5 The necessary item.Renderer. Go to File New MXML Component.Type icon. Renderer as filename and choose Box in Based on.Remove width and height.Go to Design Mode.Drop an Image Component.In the Flex Properties panel, set the ID to pic.Go to Code Mode. Add a script tag after the first Tag.In this script tag, add the following lines import com.Photo. import mx.Application. public function init void.Then, add an update.Complete event listener to this init function in the Box tag.It should look like that The item.Renderer is not ready.The complete code should be this Part 6 Linking the item.Renderer to Tile.List. Go back to Flickr.Viewer. mxml. In Code Mode, go to the Tile.List tag and add the item.Renderer parameter by typing item.Renderericon. RendererThe complete code for Flick.Viewer is done and should look like this lt Application xmlns mxhttp www.Script. import mx.Streaming. AMFChannel.Flickr. Service. private var apikey String enter you Flickr API key here.Result Number 5. Flickr.Service new Flickr.Service apikey. Security.Domainapi. Security.Insecure. Domainapi.Array. Collection.Bindable public var photos Array.Collection. private function get.Images void. Flickr.Service new Flickr.Service apikey. Event.Listener Flickr. Result.Event. PHOTOSSEARCH, on.Photos. Search. Search.Result,1. private function on.Photos. Search event Flickr.Result. Event void.List Paged. Photo.List event. data.List. per. Page max.Result. photos new Array.Collection photo.List. photos. lt mx Script.Application. Control.Bar width1. 00. Text.Input idtxt. Search.Button labelSEARCH ON FLICKR idbtn.Search clickget. Images.Application. Control.Bar. lt mx Tile. List width1.List data. Providerphotos item.Renderericon. Renderer.Tile. List. lt mx Application And the final code for icon.Renderer. mxml lt Box xmlns mxhttp www.Completeinit. Script.Photo. import mx.Application. public function init void.Script. lt mx Image idpic width1.Box Part 7 click to enlarge.Now the users can watch a list of pictures.Thats ok but not very good.To allow users to enlarge the pics, we will first create a new component, wich will contain the big pic.Go to File New MXML Component.Enter big. Pic. mxml as filename and Title.Window in based on.Enter 1. 00 for both width and height.Now, change the first tag by this one lt mx Title.Window xmlns xmlns mxhttp www.Controls. xmlns effcom.CLICK ANYWHERE TO CLOSE text.Aligncenter color3.Color0. 00. 00. Alpha0.Thickness. Left0 border.Thickness. Right0 border.Thickness. Top0 border.Thickness. Bottom0.Height2. 5 vertical.Scroll. Policyoff horizontal.Scroll. Policyoff.Bottom0 padding. Left0 padding.Right0 padding. Top0.Completeinit The xmlns are references to libs we will use.There are some graphical stuff, like border.Thickness, you can read Flex Documentations to know more, they are basically use to fit the browsers window.Go back to Flick.Viewer. mxml. To launch this component when the user clicks on an item in the list, add this code in the Script tag, at the end BIGPIC FUNCTIONS.Pop. Up. Manager.Title. Window. import big.Pic. import mx. events.Flex. Mouse. Event.Application. public var full.Window big. Pic. Big.Picid String void.Window big. PicPop.Up. Manager. create.Pop. Upthis, big.Pic, true. full. Window.Photo id. full. Window.Photo. Num pics. List.Index. Then look in the mxml code, and find the Tile.List tag. in the tag, add the item.Click property to launch the big pic item.Clickshow. Big. Picevent.Renderer. The tag should now look like that lt mx Tile.List width1. 00 height1.List. data. Providerphotos item.Renderericon. Renderer.Clickshow. Big. Picevent.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |