SyntaxTerror
Content Creator
- Joined
- Jul 24, 2014
Hello
I am currently working on 16/9 SWF backgrounds for SDT, and I found a trick to move in a wider picture using buttons:
Basicaly, to have a 16/9 zoomable background for SDT, it has to be 1122x825 px (in fact 1122x600 is a bit wider than 16/9, but it is needed for full screen with window and menu bars, seems complicated but it works).
Here, I am using a 1644x825 px picture, I put its left side touching the left side on frame 1, its right side touching the right side on frame 20, and a classic tween between these two.
Here's the code I am using for buttons:
And here is the FLA of my background mod: HD+ BG test.fla
Along with the SWF if some want to try: HD+ BG test.swf
Actually, I'd prefer to do this using the left and right arrow keys (if they aren't used by another Loader mod in fact), but couldn't manage to find a code or made one myself...
Can someone well versed in ActionScript help me with this code?
Thank you.
I am currently working on 16/9 SWF backgrounds for SDT, and I found a trick to move in a wider picture using buttons:
Here, I am using a 1644x825 px picture, I put its left side touching the left side on frame 1, its right side touching the right side on frame 20, and a classic tween between these two.
Here's the code I am using for buttons:
Code:
stop(); // used to avoid that the frames are automaticaly played
// right button:
right.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame);
function fl_ClickToGoToNextFrame(event:MouseEvent):void
{
nextFrame();
}
// left button:
left.addEventListener(MouseEvent.CLICK, fl_ClickToGoToPreviousFrame);
function fl_ClickToGoToPreviousFrame(event:MouseEvent):void
{
prevFrame();
}
And here is the FLA of my background mod: HD+ BG test.fla
Along with the SWF if some want to try: HD+ BG test.swf
Actually, I'd prefer to do this using the left and right arrow keys (if they aren't used by another Loader mod in fact), but couldn't manage to find a code or made one myself...
Can someone well versed in ActionScript help me with this code?
Thank you.