To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 01-03-2006, 07:50 PM   #1
Sleezee
Member
 
Join Date: Mar 2005
Posts: 40
Panorama Scroll

Hi. I have just finished my new Flash site and I've got this one final problem.
It would be great if you could help me somehow. Please, visit this link: www.trusthead.com/main.html

As you might guess, I don't like the way background scrolls left or right. On my site, it starts to move even when the cursor is nearly in the middle of the page which can cause some problems when a viewer wants to click on any button. The best solution would be to tell the panorama to scroll only when the cursor reaches the left or right end of the movie. I have a good script but dunno what to add to make the background less sensitive.

The first frame contains this script:

Code:
 // Xphoto = startposition of the scoll image 
xphoto = 399.9; 
// 
// Widthmovie = This variable hase to be set to the 
// same amount of the moviewidth / 
widthmovie = 800; 
// 
// Scrollspeed = The scollspeed of the image (high numbers result in slow scrolls 10=average) 
scrollspeed = 15; 
// 
// widthphoto = the width of your scrollable image in pixels/ 
widthphoto = 2400; 
_root.info.gotoAndPlay(2);
The second:

Code:
// Setting the xmouse to 0 in the centre of the movie: 
ypozycja = _ymouse; 
if (ypozycja>0 and ypozycja<490) { 
   xmouse = _xmouse-(widthmovie/2); 
   // Setting the speed: 
   speed = (xmouse)/scrollspeed; 
   // If the speed is negative, the speed will be made positive here: 
   if (speed<0) { 
      speed = -(speed); 
   } 
   // If the mouse moves to left, the photo will scroll to the right:
   // (That makes sense.... Doesn't it!! ;-) 
   if (xmouse<0) { 
      xphoto = xphoto+speed; 
   } 
   // If the mouse moves to the right, the photo will scroll to the left: 
   if (xmouse>0) { 
      xphoto = xphoto-speed; 
   } 
   // Checking for the left end of the image: 
   if (xphoto>1200) { 
      xphoto = 1200; 
   } 
   // Checking for the right end of the image: 
   if (xphoto<-400) { 
      xphoto = -400; 
   } 
   // Placing the moviclip (photo) on it's new postition: 
   setProperty("photo", _x, xphoto); 
   //trace(_ymouse); 
}

It would be great if you could help me with this thing. I tried to figure it out but now Im lost.
Sleezee is offline   Reply With Quote
Old 01-03-2006, 09:27 PM   #2
517210
Member
 
Join Date: Jan 2006
Posts: 62
if (ypozycja>0 and ypozycja<490) {

speed = 10;

if (_xmouse<30) {
xphoto = xphoto+speed;
}

if (xmouse>Stage.width-30{
xphoto = xphoto-speed;
}
if (xphoto>1200) {
xphoto = 1200;
}
// Checking for the right end of the image:
if (xphoto<-400) {
xphoto = -400;
}
// Placing the moviclip (photo) on it's new postition:
setProperty("photo", _x, xphoto);
//trace(_ymouse);
}

i think the preceding codes can work?
i don't know it is you want?
__________________
Come from PeKing of China
517210 is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:32 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.