All pastes #594736 Raw Edit

Someone

public text v1 · immutable
#594736 ·published 2007-06-29 02:09 UTC
rendered paste body
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="initApp()">
  <mx:Script>
      <![CDATA[
          private var imageWidth:Number=0;
          private var imageHeight:Number=0;
          [Bindable]
          var imageID:String;
          function initApp():void{
              imageID=Application.application.parameters.imageID;
              img.source="http://photomosaic.s3.amazonaws.com/l"+imageID+".jpg";
          }
          function changeSize():void{
             img.width=uint(imageWidth*hSlider.value/100);
             img.height=uint(imageHeight*hSlider.value/100);
          }
      ]]>
</mx:Script>
<mx:HSlider id="hSlider" minimum="20" maximum="100" value="50" 
            dataTipPlacement="top" tickColor="black" 
            snapInterval="1" tickInterval="10" 
            labels="['20%','100%']" allowTrackClick="true" 
            liveDragging="true" change="changeSize();"/>
<mx:Panel id="panel" title="Photo Mosaic ({imageID})" height="100%" width="95%">
	<mx:Canvas id="disp" height="100%" width="100%">
        	<mx:Image id="img" x="0" y="0"
			source="http://photomosaic.s3.amazonaws.com/l{imageID}.jpg"
         		complete="imageWidth=img.width; imageHeight=img.height;	changeSize();"/>
	</mx:Canvas>
</mx:Panel>
</mx:Application>