/ Published in: ActionScript 3
URL: http://latinflashtour.com/srcview/source/components/RepeatedItem4.mxml.html
Lee Brimelow show's how to smooth an image that is loading from Flickr.
Expand |
Embed | Plain Text
<?xml version="1.0" encoding="utf-8"?> <s:ItemRenderer xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:d="http://ns.adobe.com/fxg/2008/dt" xmlns:mx="library://ns.adobe.com/flex/halo"> <fx:Script> <![CDATA[ import mx.events.FlexEvent; import flash.net.navigateToURL; protected function image1_clickHandler(event:MouseEvent):void { navigateToURL(new URLRequest("http://www.flickr.com/photos/"+this.data.owner+"/"+this.data.id)); } [Bindable] public var loaderContext:LoaderContext; private function imageInit():void { loaderContext = new LoaderContext(); loaderContext.checkPolicyFile = true; im.load("http://farm"+data.farm+".static.flickr.com/"+data.server+"/"+data.id+"_"+data.secret+"_s.jpg"); } ]]> </fx:Script> <s:states> <s:State name="normal"/> <s:State name="hovered"/> <s:State name="selected"/> </s:states> <mx:Image creationComplete="imageInit()" smoothBitmapContent="true" loaderContext="{loaderContext}" id="im" toolTip="{data.title}" click="image1_clickHandler(event)" buttonMode="true" width="50" height="50" d:userLabel="Layer 10 copy 4" x="0" y="0" maintainAspectRatio="false"/> <s:Rect d:userLabel="Item Highlight" width="50" height="50"> <s:stroke> <s:SolidColorStroke weight="2" color.normal="0x666666" color.selected="0xFFFFFF" color.hovered="0xFFFFFF"/> </s:stroke> </s:Rect> </s:ItemRenderer>
Comments
Subscribe to comments
You need to login to post a comment.

Getting error : Cannot resolve attribute 'smoothBitmapContent' for component type mx.controls.Image.
My first question to you is, are you using the Flex 4 SDK? If so, are you using Flash Builder 4?
If both of your answers are "yes", then within Flash Builder 4, you should be able to use code hinting to see what is the problem with the attributes.