windec
02-17-2009, 02:56 PM
Iam a beginner and so please pardon the naiveness in my approach.
The iamge paths of 3 different resolutions are in a database and images-giver.php gives an xml. The idea is to load and display images of certain resolution based on zoomslider's value. callHTTPService is called only when the images are not already there.How to set the image source inside that function?. Better ideas are more than welcome.
inside <mx:Script>
private function zoomer(event:Event):void{
canvas.scaleX=zoomslider.value;
canvas.scaleY=zoomslider.value;
if(zoomslider.value<4){
var resolution=low;
}
if(zoomslider.value>8){
var resolution=high;
}
else{
var resolution=medium;
}
if(var imagesLoaded!=true){
callHTTPService(event:String);
}
}
public function callHTTPService(event:String){
getImages.send();
var imagesLoaded=true;
image1.source=;
}
<mx:HTTPService id="getImages" url="http://localhost/app/images-giver.php" method="POST" contentType="application/x-www-form-urlencoded" resultFormat="text" >
<mx:request>
<res>var resolution<res>
<name>picture1</name>
</mx:request>
</mx:HTTPService>
<mx:HSlider x="100" y="500" minimum="1" maximum="20" snapInterval=".1"
enabled="true" id="zoomslider" liveDragging="false" change="{zoomer(event)}"
allowTrackClick="false" toolTip="{zoomslider.value}"/>
inside the canvas there are images image1,image2 etc:
<mx:Image id="image1">
please note that I have posted only bits of code so that you can read it quickly.
The iamge paths of 3 different resolutions are in a database and images-giver.php gives an xml. The idea is to load and display images of certain resolution based on zoomslider's value. callHTTPService is called only when the images are not already there.How to set the image source inside that function?. Better ideas are more than welcome.
inside <mx:Script>
private function zoomer(event:Event):void{
canvas.scaleX=zoomslider.value;
canvas.scaleY=zoomslider.value;
if(zoomslider.value<4){
var resolution=low;
}
if(zoomslider.value>8){
var resolution=high;
}
else{
var resolution=medium;
}
if(var imagesLoaded!=true){
callHTTPService(event:String);
}
}
public function callHTTPService(event:String){
getImages.send();
var imagesLoaded=true;
image1.source=;
}
<mx:HTTPService id="getImages" url="http://localhost/app/images-giver.php" method="POST" contentType="application/x-www-form-urlencoded" resultFormat="text" >
<mx:request>
<res>var resolution<res>
<name>picture1</name>
</mx:request>
</mx:HTTPService>
<mx:HSlider x="100" y="500" minimum="1" maximum="20" snapInterval=".1"
enabled="true" id="zoomslider" liveDragging="false" change="{zoomer(event)}"
allowTrackClick="false" toolTip="{zoomslider.value}"/>
inside the canvas there are images image1,image2 etc:
<mx:Image id="image1">
please note that I have posted only bits of code so that you can read it quickly.