A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: onClipEvent + _root = Sliding Pages Not Working

  1. #1
    Member
    Join Date
    Apr 2006
    Posts
    49

    onClipEvent + _root = Sliding Pages Not Working

    I'm having a tough time with a page sliding clip, and not sure what to do.

    I've got a movieClip with a page sliding effect that I found here at Flash Kit. It's perfect for what I need, however the effect will only work in that movieClip. Once you try to load that movieClip from anywhere else, the sliding no longer works.

    Here's the code that's on the image clip:

    Code:
    onClipEvent (load) {
    	_x = 0;
    	_y = 0;
    	spd = 5;
    	//this is the scrolling speed, the hight the number the faster it scrolls//
    }
    onClipEvent (enterFrame) {
    	_x += (endX-_x)/spd;
    	_y += (endY-_y)/spd;
    	_root.page1.onRelease = function() {
    		endX = 0;
    		endY = 0;
    	};
    	_root.page2.onRelease = function() {
    		endX = -864;
    		endY = 0;
    	};
    	_root.page3.onRelease = function() {
    		endX = -1728;
    		endY = 0;
    	};
    	_root.page4.onRelease = function() {
    		endX = -2592;
    		endY = 0;
    	};
    }
    Buttons are of course on the main sliding clip timeline.

    Any help would be appreciated.

  2. #2
    Member
    Join Date
    Apr 2006
    Posts
    49
    Whoops. Got it. Needed to replace the
    Code:
    _root
    with
    Code:
    this._parent._parent

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center