LivingDeadBeat
06-20-2009, 02:07 PM
Hi Forum,
Firstly i didn't notice there was a Flex 3 section when i first posted this, if a mod wants to move this it would be greatly appreciated.
I'm trying to learn flex, i don't have any prior knowledge of flash but have watched all the "learn flex tutorials". I have coding experience in php, javascript and the .net framework.
Basically i want to make a app much the same as this:
(click on view/zoom large image)
http://www.sothebys.com/app/live/lot/LotDetail.jsp?lot_id=159530245
So far i have managed to use the image loader to load an image....and thats about it. I have been messing around with the bitmapdata class but not really sure how to go about zooming in or out, or what to display the image in. I.e what component in the design view should i use as a container for the image that will let it overflow without scollers.
This is the start of my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#FBF8F8, #FBF8F8]"
applicationComplete="Init()">
<mx:Script>
<![CDATA[
private var imgLoader:Loader;
private function Init():void{
imgLoader = new Loader();
//Image location string
var imageURL:String = "http://www.miravit.cz/.....1.jpg"
//Instantiate URL request
var imageURLReq:URLRequest = new URLRequest(imageURL);
imgLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, imgLoadCompleted);
imgLoader.contentLoaderInfo.addEventListener(Progr essEvent.PROGRESS, progressListener);
//Begin image load
imgLoader.load(imageURLReq);
}
private function imgLoadCompleted(event:Event):void{
//On completion of image load
progressBar.visible = false;
var scale:Number = 1;
//Set matrix size
var m:Matrix = new Matrix();
m.scale (scale,scale);
var originalBmd:BitmapData = new BitmapData(this.width, this.height);
originalBmd.draw(this.imgLoader,m);
auctionImageContainer.source = bm;
}
private function progressListener(event:ProgressEvent):void {
//Update progress indicator.
progressBar.setProgress(Math.floor(event.bytesLoad ed / 1024),Math.floor(event.bytesTotal / 1024));
}
]]>
</mx:Script>
I have tried to find tutorials on this but they seem thin on the ground with reference to flex and the few that i have found either contain errors, or don't show what components to use in the design view. Any help with how i might move forward would be greatly appreciated.
Thanks
Tom
Firstly i didn't notice there was a Flex 3 section when i first posted this, if a mod wants to move this it would be greatly appreciated.
I'm trying to learn flex, i don't have any prior knowledge of flash but have watched all the "learn flex tutorials". I have coding experience in php, javascript and the .net framework.
Basically i want to make a app much the same as this:
(click on view/zoom large image)
http://www.sothebys.com/app/live/lot/LotDetail.jsp?lot_id=159530245
So far i have managed to use the image loader to load an image....and thats about it. I have been messing around with the bitmapdata class but not really sure how to go about zooming in or out, or what to display the image in. I.e what component in the design view should i use as a container for the image that will let it overflow without scollers.
This is the start of my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#FBF8F8, #FBF8F8]"
applicationComplete="Init()">
<mx:Script>
<![CDATA[
private var imgLoader:Loader;
private function Init():void{
imgLoader = new Loader();
//Image location string
var imageURL:String = "http://www.miravit.cz/.....1.jpg"
//Instantiate URL request
var imageURLReq:URLRequest = new URLRequest(imageURL);
imgLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, imgLoadCompleted);
imgLoader.contentLoaderInfo.addEventListener(Progr essEvent.PROGRESS, progressListener);
//Begin image load
imgLoader.load(imageURLReq);
}
private function imgLoadCompleted(event:Event):void{
//On completion of image load
progressBar.visible = false;
var scale:Number = 1;
//Set matrix size
var m:Matrix = new Matrix();
m.scale (scale,scale);
var originalBmd:BitmapData = new BitmapData(this.width, this.height);
originalBmd.draw(this.imgLoader,m);
auctionImageContainer.source = bm;
}
private function progressListener(event:ProgressEvent):void {
//Update progress indicator.
progressBar.setProgress(Math.floor(event.bytesLoad ed / 1024),Math.floor(event.bytesTotal / 1024));
}
]]>
</mx:Script>
I have tried to find tutorials on this but they seem thin on the ground with reference to flex and the few that i have found either contain errors, or don't show what components to use in the design view. Any help with how i might move forward would be greatly appreciated.
Thanks
Tom