| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Member
Join Date: Aug 2006
Posts: 92
|
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?
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jan 2006
Posts: 104
|
I imagine that it is possible, but I haven't thought of just how to do it, yet
![]() |
|
|
|
|
|
|
|
|
#3 |
|
2006 Man Of The Year
Join Date: Mar 2007
Posts: 880
|
yes. add this line:
ActionScript Code:
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. |
|
|
|
|
|
#4 |
|
Member
Join Date: Aug 2006
Posts: 92
|
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?
|
|
|
|
|
|
#5 |
|
Member
Join Date: Aug 2006
Posts: 92
|
Never mind, I figured it out! It just involved adding this line:
stage.align = StageAlign.TOP_LEFT; |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |