Scroll background image???

This is a discussion on Scroll background image??? within the Macromedia Flash forums in Adobe Tools category; My background image (945 px wide) is larger than my Flash window (620 px wide). When a user moves the cursor left or right, I want the background image to move in that direction but only as far as the edge of the image and when the cursor stops moving so should the image. I will also have hot spots in various places that will be clickable. I tried this code (see below), but it doesn't quite do what I need. For one thing it continues to scroll beyond the left and right edge of the background image. Another problem ...

Go Back   Application Development Forum > Adobe Tools > Macromedia Flash

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-26-2008, 04:21 PM
Maxwell Hammer
Guest
 
Default Scroll background image???

My background image (945 px wide) is larger than my Flash window (620 px wide).
When a user moves the cursor left or right, I want the background image to move
in that direction but only as far as the edge of the image and when the cursor
stops moving so should the image. I will also have hot spots in various places
that will be clickable. I tried this code (see below), but it doesn't quite do
what I need. For one thing it continues to scroll beyond the left and right
edge of the background image. Another problem is that the image keeps moving
even though the cursor stopped, which make it near impossible to click on my
hotspots.


function accelScroller(myTarget) {
myMiddle = Stage.width/2;
this.onEnterFrame = function() {
moveDist = myMiddle-_root._xmouse;
myTarget._x += moveDist/10;
//border check
if (myTarget._x>Stage.width) {
myTarget._x = 0;
} else if (myTarget._x<0) {
myTarget._x = Stage.width;
}
}
}
accelScroller(mcInstanceName);

Reply With Quote
  #2  
Old 08-27-2008, 04:45 PM
el pescado
Guest
 
Default Re: Scroll background image???

Hey,

I have thought of using this for the exact reason. I haven't got around to
using the hotspots but check out this tutorial. I think this what you mean.

http://www.kirupa.com/developer/flas..._image_pan.htm


Reply With Quote
  #3  
Old 08-27-2008, 08:04 PM
Maxwell Hammer
Guest
 
Default Re: Scroll background image???

AWESOME! This looks like exactly what I was needing. Thanks! (can't wait to try it out.)
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:20 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.