I was created a new project using flash cc html5 canvas and created a movieclip with 200px width and 200px height. I can able to get the properties using this.mc.nominalBounds;
. And I tried this.mc.getBounds ();
But it returns null
. setBounds
also not seems to work.
How to change the width of a movieclip in flash html5 canvas?
3.1k views Asked by Benny At
1
The
setBounds
method is for putting a custom bounds on something, or defining it when it can not be determined (like using the Graphics classes). Fortunately, all symbols from Flash CC come withnominalBounds
, which is the combined, untransformed size of the symbol.Using that, you can set the
scaleX
andscaleY
properties to size up and down your content. If you want it to be a specific width, just use the nominalBounds to determine a new scale.For example, if the clip is 200x200, and you want it to be 400x400, then:
Hope that helps!