My client changed his mind about v6 and wants the swf compatible with v5. Maybe I should have been more prepared for this, but I’m not. I’ve barely chugged along with a tutorial and figuring this out, and I’m completely lost with converting it to v5 code. Can anyone help get me started?
Here’s my code so far:
onClipEvent (load) {
_global.ratio = 0;
_global.popup = 0;
imagehalf = -1668;
xcenter = 2000;
xspeed = 1/5;
speedratio = 0;
accel = 0;
accel_amount = .1;
setProperty("_root.button_left_ON", _visible, "0");
setProperty("_root.button_right_ON", _visible, "0");
setProperty("_root.popup_01", _visible, "0");
}
onClipEvent (enterFrame) {
if (_global.ratio == 0) { // slider is NOT being used
accel = accel-accel_amount; // create a deceleration value
if (accel<0) { // keep the deceleration value at 0 so the movement doesn't reverse
accel = 0;
}
} else { // slider IS being used
speedratio = _global.ratio; // use the slider position to calculate the speed of the scroll
accel = 1; // set acceleration to full
}
var xdistance = speedratio*accel; // determine how far to move the movie clip based on how far the slider is moved
_x -= (xdistance*xspeed); // actually reposition the movie clip
if (_x>0) { // test if the movie clip needs to loop from the left
_x = imagehalf;
}
if (_x<imagehalf) { // test if the movie clip needs to loop from the right
_x = 0;
}
if (_global.ratio<0) { // light up the buttons appropriately
setProperty("_root.button_left_ON", _visible, "1");
setProperty("_root.button_stop_ON", _visible, "0");
setProperty("_root.button_right_ON", _visible, "0");
}
if (_global.ratio == 0) {
setProperty("_root.button_left_ON", _visible, "0");
setProperty("_root.button_stop_ON", _visible, "1");
setProperty("_root.button_right_ON", _visible, "0");
}
if (_global.ratio>0) {
setProperty("_root.button_left_ON", _visible, "0");
setProperty("_root.button_stop_ON", _visible, "0");
setProperty("_root.button_right_ON", _visible, "1");
}
}
It’s for a scrolling image controlled with a slider. You can see my MX swf here.
I hope someone can help with this because I am so lost.
Thanks,
Dan