[AS3][TUTORIAL] How to replace background map with image
Go to _02t > _lM_ (CREATE _lM_ IT IF YOU DON'T HAVE IT)
And replace whole _lM_ with this:
Got to _02t > _R_f (CREATE _R_f IT IF YOU DON'T HAVE IT)
And replace it with:
Then add new .as file in src folder called background
And replace everything with:
And make 800x600 px png image called background and put it in src folder
And replace whole _lM_ with this:
Code:
package _02t
{
import flash.display.Sprite;
public class _lM_ extends Sprite
{
public function _lM_()
{
var local1:background = new background();
local1.alpha = 1;
local1.scaleX = (800 / local1.width);
local1.scaleY = (600 / local1.height);
addChild(local1);
}
}
}//package _02t
And replace it with:
Code:
package _02t
{
import flash.display.Sprite;
import com.company.assembleegameclient.ui._zX_;
public class _R_f extends Sprite
{
public function _R_f()
{
addChild(new _pM_());
addChild(new _lM_());
addChild(new _zX_());
}
}
}//package _02t
Then add new .as file in src folder called background
And replace everything with:
Code:
package
{
import mx.core.*;
[Embed(source="background.png")]
public class background extends mx.core.BitmapAsset
{
public function background()
{
super();
return;
}
}
}