views:

77

answers:

3

I've been developing a web based pure ActionScript-3 (no MXML involved) videogame using FlashDevelop, and have had no real surprises so far.

I've recently tried moving my project over to the trial (but fully functional) of Intellij-Idea and have found that while the .swf produced by Intellij still functions, it has somehow been scaled up so that all elements are twice the size. This is without me having made any code changes at all.

I am aware of stage.scaleMode, but am not using it in my code.

I want to stress that I am not talking about any attributes of the HTML wrapper which normally presents the .swf, as this behaviour is evident even when I load the bare .swf into my browser.

The only variables I can think of here are the parameters passed to the Adobe flex compiler - but I've looked through the available parameters and haven't seen anything likely.

Does anyone have any thoughts as to what might be happening here?

A: 

Can we see the HTML wrapper and some code samples? How are you embedding the swf? stage.scaleMode should be set to StageScaleMode.NO_SCALE; if that is set and it's scaling then something else is wrong. Would be tough to tell without some snippets.

Typeoneerror
Well that's the thing - the problem occurs without the html wrapper being used at all, with a url of the general form file:///home/stevet/workspace/myProject/my.swf - so the HTML wrapper is *not* connected with the current problem.As for the code snippets - I'm at work at the moment. I'll try to boil the problem down to a small code snippet tonight.
teapot7
A: 

I'm not familiar with IntelliJ but in Flash terms, does fiddling with your publish settings help?

whybird
Hard to say as I've never used the Flash ide :) I'm new to ActionScript and haven't used Intellij for years (I remember it as being fantastic for java development) so it's entirely possible I am missing some setting. btw - is that Mark Whybird from DIRECT-L?
teapot7
Yes, that's me :-) Who dat?
whybird
Steve Taylor - I'm pretty much a lurker these days, since I haven't done any Director work within living memory.
teapot7
Cool. NIce to see you.
whybird
A: 

The solution is to add the following two lines to the start of the program:

        stage.scaleMode = StageScaleMode.NO_SCALE;
        stage.align = StageAlign.TOP_LEFT;

(With appropriate imports of StageScaleMode and StageAlign)

Note that I didn't need to add these when running the project from FlashDevelop.

The scaleMode can be set to one of four values: NO_SCALE NO_BORDER SHOW_ALL EXACT_FIT Intellij seems to default to the behaviour of EXACT_FIT while FlashDevelop defaults to the behaviour of NO_SCALE.

The stage alignment can be set to TOP TOP_LEFT LEFT BOTTOM_LEFT etc. I'm not sure how to describe the default Intellij behaviour - it looks partly but not completely centered. FlashDevelop defaults to TOP_LEFT.

Where is this implicit behaviour stored if not in the code itself? I haven't a clue - perhaps in some .swf file header information.

I certainly prefer the FlashDevelop default behaviour.

teapot7