Window size config - Mark, can this be added?

Monkey Targets Forums/Flash/Window size config - Mark, can this be added?

Karja(Posted 2012) [#1]
I like to use the Flash target when developing - it's one of the fastest builds for me, and it starts quickly. It's good when I want to test stuff repeatedly. But I like having everything configured from code - including the window width and height. Is there a reason that this couldn't be added?

src\trans\targets\flash.monkey:
...
	Method MakeTarget()

		CreateDataDir "data"

		' --- Added ----
		For Local file$=Eachin LoadDir( "templates",True )
			Local str$=LoadString( "templates/"+file )
			str=ReplaceEnv( str )
			SaveString str,file
		Next
		' --- End of addition ---
		
		'app code
		Local main$=LoadString( "MonkeyGame.as" )

		main=ReplaceBlock( main,"TRANSCODE",transCode )
		main=ReplaceBlock( main,"ASSETS",Assets() )
		main=ReplaceBlock( main,"CONFIG",Config() )
		
		SaveString main,"MonkeyGame.as"
...


targets\flash\templates\MonkeyGame.as:
...
[SWF(width="${FLASH_WINDOW_WIDTH}",height="${FLASH_WINDOW_HEIGHT}")]
...


Then one can add config lines in-code for the window size, and all is happiness and bliss! E.g.:
#FLASH_WINDOW_WIDTH="800"
#FLASH_WINDOW_HEIGHT="480"