Search code examples
actionscript-3heightwidthaddchild

addchild setting width and height


trying to do something pretty straight forward - have a function that adds child from library and sets position and width and height. Is adding fine but for some reason width and height aren't setting properly. Any suggestions?

code:

var video1tn:video1_btn = new video1_btn;

function thumbNails1():void{
  addChild(video1tn);
  video1tn.width = 350;
  video1tn.height = 170;
  video1tn.x = 794.95;
  video1tn.y = 85.5;
}

Solution

  • try placing a shape with 0 alpha to the background of your video1_btn, filling the entire initial size of the video1_btn. I have ran into this before and i think this solved it for me.