Code fails when converted from AS 1.0 to 2.0

Updating a flash swf with AS 1.0 to 2.0 and when I publish it in 2.0 t

Page 1 of 1

1 Replies - 730 Views - Last Post: 13 December 2007 - 12:32 PM

#1 Frost  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-December 07

Code fails when converted from AS 1.0 to 2.0

Post icon  Posted 12 December 2007 - 03:56 PM

Hi,

The flash swf that I have was published in flash 6, AS 1.0. I changed the publishing to use AS 2.0 to take advantage of some new features and my scroll functions have quit working. I believe the code issue is in the code block below:

Actionscript from the "Content" MC which contains a series of 6 images that are scrolled through:


Code:
onClipEvent (load) {
	//accel = 0.6;
	//rate = 0.2;
	accel = 0.6;
	rate = 0.03;
	_root.pos = this._x; //start position
}

onClipEvent(enterFrame) { 
xkoord2 = _root.pos - _root.press *_root.width;
	x=x*accel+(xkoord2-_x) * rate;
	_x+=x;
	if(Math.abs(_root.xkoord2-_x)<1) { _x=_root.xkoord2; }
} 


The "Content" mc is then loaded into another mc ("pic6 page") which contains a mask layer that covers 3 of the six images in the "Content" mc. With the "pic6 page" mc I have the following actionscript:


Code:

_root.left = false;
_root.n = 6;
_root.press = 0;
_root.width = 280;


Since switching to pubish in AS 2.0 the scroll feature goes way to far to the left instead of just showing the next 3 images and stopping.

Any help would be greatly appreciated.

thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Code fails when converted from AS 1.0 to 2.0

#2 DilutedImage  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 14
  • View blog
  • Posts: 646
  • Joined: 20-November 06

Re: Code fails when converted from AS 1.0 to 2.0

Posted 13 December 2007 - 12:32 PM

Got a source file I can look at?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1