1 Replies - 1475 Views - Last Post: 17 October 2012 - 04:48 AM

#1 44corners  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 243
  • Joined: 22-February 06

Scrolling Items (non-parallax, non-continuous)

Posted 12 March 2006 - 03:05 AM

Description: Delete sctrict-type variable declarations if wish to use in Flash versions prior to MX 2004.

All actions go in first frame of actions layer on root timeline.Scrolling code can be used for text menus, picture slides, navigation around a panoramic picture etc.

Slightly tweaked code from the "Scrolling Thumbnail Panel" tutorial at http://www.gotoAndLearn.com so that the menu stops where it's meant to.
var stageWidth:Number = 550;
var scrollSpeed:Number = 7;//Higher number = slower speed
var clipWidth:Number = 2016;
var clipX:Number = mySymbol_mc._x;

mySymbol_mc.onRollOver = mySymbol_mcOver;
function mySymbol_mcOver() {
     this.onEnterFrame = scrollmySymbol_mc;
     delete this.onRollOver;//makes sure buttons still work on rollOver
}
function scrollmySymbol_mc() {
     var xdist = _xmouse-(stageWidth/2);
     clipX += -xdist/scrollSpeed;
     if (clipX>=0) {//this stops scrolling left
          clipX = 0;
     }
     if (clipX<=stageWidth-clipWidth) {//This stops scrolling right
          clipX = stageWidth-clipWidth;
     }
     setProperty("mySymbol_mc", _x, clipX);//assigns mySymbol_mc's new coordinates (clipX) to make scroll
}



Is This A Good Question/Topic? 0
  • +

Replies To: Scrolling Items (non-parallax, non-continuous)

#2 lizr0x  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 15-October 12

Re: Scrolling Items (non-parallax, non-continuous)

Posted 17 October 2012 - 04:48 AM

what do we replace for the picture to start scrolling in flash im using CS6
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1