A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Photoscroller

  1. #1
    Member
    Join Date
    Jul 2003
    Location
    brewtown
    Posts
    36

    Photoscroller

    i have a swf thats a photoscroller - Photoscroller.swf-
    this Photoscroller.swf is targeted to a empty_mc on my main swif.
    now, how can i prevent the scrolling feature when the mouse is not directly on the scroller.

    when i move the mouse anywhere on the main swf the scroller responds, ...drives me crazy..

  2. #2
    Senior Member the_protectot's Avatar
    Join Date
    Jul 2003
    Posts
    401
    Yeh that's annoying..

    try putting a check location script around the scroll code...

    code:

    if (_xmouse > leftbound && _xmouse < rightbound && _ymouse > topbound && _ymouse < bottombound){
    //do your scroll
    }


  3. #3
    Member
    Join Date
    Jul 2003
    Location
    brewtown
    Posts
    36
    i couldn'tget it to work.

    take a look at the code. where would i place it?

    Code:
    xmouse = _xmouse - (widthmovie/2);
    speed = (xmouse) / scrollspeed;
    if (speed < 0) {
    	speed = -(speed);
    }
    if (xmouse < 0) {
    	xphoto = xphoto + speed;
    }
    if (xmouse > 0) {
    	xphoto = xphoto - speed;
    }
    
    if (xphoto > 0) {
    	xphoto = 0;
    }
    if (xphoto < -(widthphoto - widthmovie)) {
    	xphoto = -(widthphoto - widthmovie);
    }
    setProperty("photo", _x, xphoto);

  4. #4
    Senior Member the_protectot's Avatar
    Join Date
    Jul 2003
    Posts
    401

    try...

    code:

    if (_xmouse > leftbound && _xmouse < rightbound){
    if (_ymouse > topbound && _ymouse < bottombound){

    xmouse = _xmouse - (widthmovie/2);
    speed = (xmouse) / scrollspeed;
    if (speed < 0) {
    speed = -(speed);
    }
    if (xmouse < 0) {
    xphoto = xphoto + speed;
    }
    if (xmouse > 0) {
    xphoto = xphoto - speed;
    }
    if (xphoto > 0) {
    xphoto = 0;
    }
    if (xphoto < -(widthphoto - widthmovie)) {
    xphoto = -(widthphoto - widthmovie);
    }
    setProperty("photo", _x, xphoto);
    }
    }



    replace "topbound", bottombound" etc. with your own values.

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