set sprite dimensions
Code
public class Test extends Sprite
{
[Embed(source="MSBack.swf")]
private var SomeClass:Class;
public function Test()
{
开发者_Python百科 addChild(new SomeClass());
addChild(txtFld);
this.height = 100;
this.width = 100;
txtFld.text = width.toString() + " " + height.toString();
}
}
}
addChild(new SomeClass()) loads a swf background image having width = 100, and height = 100. My problem is that the above code does not show the whole background image. The right and bottom parts are missing. However the textfield displays the 100 100. which is the value i am expecting.
Hmmm, Beware, setting width and height of an object in Flash will SCALE the object.
This could be the issue you are facing.
精彩评论