Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411621 Posts in 69391 Topics- by 58447 Members - Latest Member: sinsofsven

May 10, 2024, 09:04:28 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)AIR windows and the stage
Pages: [1]
Print
Author Topic: AIR windows and the stage  (Read 1386 times)
Matt Thorson
Level 7
**

c'est la vie


View Profile WWW
« on: January 06, 2010, 02:57:42 PM »

Okay, this has been annoying me forever.  I've searched but can't find the solution anywhere.  It's one of those bugs I could deal with and ignore, but I'd much rather have it resolved.

Okay. So I have a Flash SWF running in an AIR EXE (I need right- and middle-click support), using FlashDevelop. In my Main class I have the following line:
Code:
[SWF( backgroundColor = "0xFFFFFF", frameRate = "50", width = "800", height = "600" )]

Here's the first oddity.  When I trace( stage.width ), I get 320 back.  So... okay? Thought I just set that to 800 but whatever, I guess.

So now here's where it gets annoying.  My AIR app makes the window start at 800x600 (this is what I want, as defined in my application.xml file), but the actual stage appears to only takes up the top left 320x240.  However, if I resize the window, the stage then scales so that it still takes up the top-left 40% of the window.

What I want it to do: I want the stage to start at 800x600.  Mainly though I don't want the stage to scale as the window changes size, like any normal non-game app, so that everything stays the same size when you resize the window but you have more real estate to work in.

Any ideas? Is this even possible? Looking at AIR apps made with Flash/Flex Builder, it seems to be. I've actually achieved this just running a SWF in my browser before (Flash will still display stuff off-stage if you don't set limits in the HTML), but now I need the AIR extras. HALP

edit: the 2x scaling problem was unrelated, but the real problem is still there. Edited the post removing the part about it being scaled 2x.
« Last Edit: January 06, 2010, 03:09:38 PM by Matt Thorson » Logged

st33d
Guest
« Reply #1 on: January 07, 2010, 05:20:49 AM »

First off you want to be reading the properties stageWidth and stageHeight not width and height.

Also you may be interested in the following link:

clicky
Logged
Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« Reply #2 on: January 07, 2010, 05:26:17 AM »

Have you tried changing them on the Project->Properties menu?
Logged

Working on HeliBrawl
Matt Thorson
Level 7
**

c'est la vie


View Profile WWW
« Reply #3 on: January 07, 2010, 01:04:59 PM »

First off you want to be reading the properties stageWidth and stageHeight not width and height.

Okay, that explains why the stage.width was tracing as 320 (the elements within it are only 320 in width), thanks Smiley

Also you may be interested in the following link:

clicky

Hmmm.  That article was about setting the default size of the window.  What I'm looking for is a way to stop the stage from rescaling itself when the window is resized.

Have you tried changing them on the Project->Properties menu?

I have, and those can help with the problem of the default stage size being wrong, but as I said above I'm still looking for a way to prevent the stage from scaling when the window is resized.

I'm beginning to suspect it may not be possible - the stage scaleX and scaleY properties are read-only. Guess I'll just have to live with it.
Logged

bateleur
Level 10
*****



View Profile
« Reply #4 on: January 07, 2010, 01:32:01 PM »

I'm beginning to suspect it may not be possible - the stage scaleX and scaleY properties are read-only. Guess I'll just have to live with it.

I haven't actually tried this myself, but I'm inclined to suspect that setting the scaleMode property of the Stage to StageScaleMode.NO_SCALE might do the trick?
Logged

Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« Reply #5 on: January 07, 2010, 03:32:54 PM »

Checkout "fscommand" documentation, I'm not sure it's gonna work but, it's a good shot.

Quote
allowscale      Specifying false sets the player so that the SWF file is always drawn at its original size and never scaled. Specifying true forces the SWF file to scale to 100% of the player.

http://livedocs.adobe.com/flex/3/langref/flash/system/package.html#fscommand%28%29

Good luck!
Logged

Working on HeliBrawl
Matt Thorson
Level 7
**

c'est la vie


View Profile WWW
« Reply #6 on: January 07, 2010, 05:17:09 PM »

I'm beginning to suspect it may not be possible - the stage scaleX and scaleY properties are read-only. Guess I'll just have to live with it.

I haven't actually tried this myself, but I'm inclined to suspect that setting the scaleMode property of the Stage to StageScaleMode.NO_SCALE might do the trick?


This did it! Thank you sir Grin
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic