So, setting the game frame rate is necessary. To do that, you need to include a simple SWF meta tag above your class definition (and AFTER your library import), as stated below:
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.geom.Rectangle;
[SWF(frameRate="60", width="640", height="960",backgroundColor="0xffffff")]
public class YourGame extends Sprite
{
public function YourGame()
{
....
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.geom.Rectangle;
[SWF(frameRate="60", width="640", height="960",backgroundColor="0xffffff")]
public class YourGame extends Sprite
{
public function YourGame()
{
....
In the code, make sure you have your SWF meta tag written just before your Class. Here, a frame rate of 60 is chosen. Apart from the frame rate, you can set other configurations as well, such as width, height, background color, etc.
One thing to note is that, the effect of the frame rate "may not" be reflected if you are in the debugging mode with the Adobe AIR simulator. Therefore, don't be surprised if you still observe some lagging when debugging the game. Everything will be alright when you "Export Release Build".
Thank you, I have long been plagued with problems sized stage. Now I understand how to put the size.
ReplyDelete