dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: creating limits with variables

  1. #1
    Member
    Join Date
    Jul 2001
    Posts
    49

    Smile fukin help

    i need to know how to create limits for an animation i have created.
    the script is as folows
    rolly._x=_xmouse
    with rolly being the instance name of my movie clip.
    now i only want the object to follow the mouse in a certain area not the entire movie .
    if anyone out there could help with this please get back to me .
    cheers.

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    44
    This kinda tricky way to do this...
    Make a blank frame (I mean empty) with action stop() in your rolly, name frame "hide_cur" (just for hiding the dragged clip) and then...
    Place this script in your rolly:

    Code:
    onClipEvent(enterFrame){
            Mouse.hide();
    	xTarget = _root._xmouse;
    	yTarget = _root._ymouse;
         // here You can change the limits
    	if ((xTarget>690) || (xTarget<100) || (yTarget>290) || (yTarget<1)){
    		Mouse.show();
    		this.gotoAndPlay("hide_cur");
    		_y += (yTarget-_y);
    		_x += (xTarget-_x);
    	} else {
    	this.gotoAndPlay(1); // or any with the content...
    	_y += (yTarget-_y);
    	_x += (xTarget-_x);
    }
    }
    It`s seems to be little bit complicated, but it works...
    Or You can use :

    Code:
    _root.rolly.startDrag( True, left_limit, top_limit, right_limit, bottom_limit );

    ZeroIQ

  3. #3
    Member
    Join Date
    Jul 2001
    Posts
    49
    thanq

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