Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Desktop, Mobile and non-browser Environments > AIR (Apollo)

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-26-2008, 05:07 PM   #1
pixielex
Member
 
Join Date: Aug 2006
Posts: 92
Default Resize Air app without stretching?

Is it possible to make an Air app resizable without stretching all of the content? I am building an application where the user loads an image into the app window. If, for example, the user loads an image that is larger than the window size, I would like them to be able to resize the window to fit the image -- i.e. it's important that the image retain its original dimensions and NOT stretch. Similar to what happens if you have an image open in photoshop and you resize the window. Is this possible?
pixielex is offline   Reply With Quote
Old 04-26-2008, 09:23 PM   #2
kdittyr
Senior Member
 
Join Date: Jan 2006
Posts: 104
Default

I imagine that it is possible, but I haven't thought of just how to do it, yet
kdittyr is offline   Reply With Quote
Old 04-27-2008, 08:14 AM   #3
evride
2006 Man Of The Year
 
evride's Avatar
 
Join Date: Mar 2007
Posts: 880
Default

yes. add this line:

ActionScript Code:
stage.scaleMode = StageScaleMode.NO_SCALE;

this also allows you to use the Event.RESIZE event. also, if you choose to use custom chrome it automatically disables scale mode.


and wonderful help there kdittyr
__________________
I've curiosity on my side.
evride is offline   Reply With Quote
Old 04-28-2008, 03:03 PM   #4
pixielex
Member
 
Join Date: Aug 2006
Posts: 92
Default

Thanks evdog! That works...except, when I load an image that's larger than the window and then resize to try to fit the whole image, the image keeps getting moved so that I can never see all of it. Hard to explain, but basically, when I load the image, it loads at the top left (0,0), but when I stretch the window, I keep getting more and more white space to the top and left of the image. Any idea why this is happening and how to fix it?
pixielex is offline   Reply With Quote
Old 04-28-2008, 03:08 PM   #5
pixielex
Member
 
Join Date: Aug 2006
Posts: 92
Default

Never mind, I figured it out! It just involved adding this line:

stage.align = StageAlign.TOP_LEFT;
pixielex is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading remote files (gifs) into Air app via Xml Ricardinho AIR (Apollo) 1 04-25-2008 02:20 PM
Prevent closing air app with cmd+w shortkey ABM AIR (Apollo) 3 04-11-2008 08:18 AM
Trouble with HelloWorld air app... Assertnfailure AIR (Apollo) 0 03-08-2008 02:27 AM
Close and drag for AIR app djones AIR (Apollo) 8 02-28-2008 05:38 PM
Maximize and minimize Air app lg101 AIR (Apollo) 1 02-18-2008 01:39 PM


All times are GMT. The time now is 06:30 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.