I'm attempting to create a "template" in which I´ll replace 4 images, each one with different sizes on different frames of 4 different buttons.
But each time I replace them the size,nor it's position nor it´s aspect ratio shouldn't be changed.
For that puropose I found this code:
var originalWidth:int = button1.width / button1.scaleX;
var originalHeight:int = button1.height / button1.scaleY;
which was useful for only one button.But when I do this:
var originalWidth:int = button1.width / button1.scaleX;
var originalHeight:int = button1.height / button1.scaleY;
var originalWidth:int = button2.width / button2.scaleX;
var originalHeight:int = button2.height / button2.scaleY;
var originalWidth:int = button3.width / button3.scaleX;
var originalHeight:int = button3.height / button3.scaleY;
var originalWidth:int = button4.width / button4.scaleX;
var originalHeight:int = button4.height / button4.scaleY;
It triggers the following errors:
- main, Layer 'actions', Frame 1, Line 37 1151: A conflict exists with definition originalWidth in namespace internal.
- main, Layer 'actions', Frame 1, Line 38 1151: A conflict exists with definition originalHeight in namespace internal.
- main, Layer 'actions', Frame 1, Line 40 1151: A conflict exists with definition originalWidth in namespace internal.
- main, Layer 'actions', Frame 1, Line 41 1151: A conflict exists with definition originalHeight in namespace internal.
- main, Layer 'actions', Frame 1, Line 43 1151: A conflict exists with definition originalWidth in namespace internal.
- main, Layer 'actions', Frame 1, Line 44 1151: A conflict exists with definition originalHeight in namespace internal.
- ComponentShim (Compiled Clip), Line 1 5000: The class 'fl.core.ComponentShim' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
- ComponentShim (Compiled Clip), Line 1 5000: The class 'fl.controls.UIScrollBar' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
PD: the solutions given only keps the original size of the first button but not the rest