Copy link to clipboard
Copied
Dear friends, please help to solve the problem.
I have created a stretching banner based on action script 2.0 (100% x90px), on one of the layers added gif button (imported), which is located on the right side of the banner. It is essential that the button does not move when stretching a banner. I would be grateful for any help!
Stage.scaleMode = "noScale";
Stage.align = "LT";
var obResize:Object = new Object();
Stage.addListener(obResize);
obResize.onResize = function() {Resize()};
function Resize(){
//stretching the background
Fon_mc._width=Stage.width;
//center the clip
imggg2._x=Stage.width/2;
};
Resize();
Copy link to clipboard
Copied
It apopears that if you were to make the button a part of imgg2 that it should stay where you put it relative to the text's registration mark. Similarly, if you want to keep it separate, you should still be able to change its _x property in a similar fashion such that it is always the same distance from the center as you show wanting it to be.
Copy link to clipboard
Copied
I wanna keep this button separate. My button is a gif animation. Could you please help me with a code?
Copy link to clipboard
Copied
Something like the following might work... using your code and assuming "btnName" as the instance name of the button (name it however you wish)...
Stage.scaleMode = "noScale";
Stage.align = "LT";
var btnDistanceFromCenter:Number = btnName._x - Stage.width/2; // establish the distance from center
var obResize:Object = new Object();
Stage.addListener(obResize);
obResize.onResize = function() {Resize()};
function Resize(){
//stretching the background
Fon_mc._width=Stage.width;
//center the clip
imggg2._x=Stage.width/2;
btnName._x = Stage.width/2 + btnDistanceFromCenter; // move the button to be the same distance from the center
};
Resize();
Copy link to clipboard
Copied
Ned, thank you very much for help!
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now