Skip to main content
April 1, 2011
Question

AS 2 for infinite slide show loop

  • April 1, 2011
  • 1 reply
  • 1045 views

I don't know if there is a simple answer to my question. Here goes.  I created an infinitely looping series of photos that scrolls from right to left. The animation was created with 6 photos and was animated using AS 3.

Is there substitute coding using AS 2 in place of my AS 3 coding?

Or is it more complicated and does it depend on how the photos were set up in my document, how the photos and groups of photos were converted to symbols etc??

here is my current AS 3 code that works.

var centerX:Number = stage.stageWidth / 2;

var galleryWidth:Number = infiniteGallery.width;

var speed:Number = 0;

addEventListener(Event.ENTER_FRAME, moveGallery);

function moveGallery(e:Event):void {

speed = -(0.02 * (mouseX - centerX));

infiniteGallery.x+=speed;

if (infiniteGallery.x>0) {

infiniteGallery.x= (-galleryWidth/2);

}

if (infiniteGallery.x<(-galleryWidth/2)) {

infiniteGallery.x=0;

}

}

I'm not a coding guru and find my AS stuff through blogs and tutorials and need to be led by the hand.

Thanks!

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 1, 2011

why do you want to change to as2?


April 1, 2011

I've got a AS 2 animation that I want to drop the movie clip into. This animation has pause loop scripting that works great with AS2 but I can't seem to make work with AS 3 pause loop coding that I've found online.

kglad
Community Expert
Community Expert
April 1, 2011

use a main as3 swf to load your as2 and your as3 swfs.