Adobe Dreamweaver Forums



Last 10 THreads :         Adobe Flash 10 kills Wimpy (Last Post : midiwriter - Replies : 38 - Views : 254 )           »          Randomnly load and animate videos from xml (Last Post : pillowsr4u - Replies : 0 - Views : 1 )           »          loader onComplete firing, but TextField not disappearing (Last Post : Laura MS - Replies : 4 - Views : 5 )           »          Re: using cast members with case of statement (Last Post : Dave C - Replies : 0 - Views : 1 )           »          Binding problem with form controls in IE (Last Post : BKBK - Replies : 1 - Views : 6 )           »          Cannot launch Fireworks. An Internal Error Occured. (Last Post : glenna - Replies : 35 - Views : 36 )           »          files are one level too deep (Last Post : Dooza - Replies : 2 - Views : 3 )           »          DW CS4 - Internet Explorer - Tables (Last Post : Murray *ACE* - Replies : 1 - Views : 2 )           »          JS Code Completion (Last Post : MyDogBerkeley - Replies : 0 - Views : 1 )           »          CS4 trials expired too early (Last Post : walla walla - Replies : 3 - Views : 4 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flash
 
Tags: , ,



Reply
  #1 (permalink)  
Old 08-26-2008, 09:41 PM
Maxwell Hammer
 
Posts: n/a
Diggs:
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
Sponsored Links
  #2 (permalink)  
Old 08-27-2008, 10:12 PM
el pescado
 
Posts: n/a
Diggs:
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 (permalink)  
Old 08-28-2008, 01:28 AM
Maxwell Hammer
 
Posts: n/a
Diggs:
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


  #4 (permalink)  
Old 08-28-2008, 06:03 PM
kolnikoff
 
Posts: n/a
Diggs:
Default Re: Scroll background image???

Maxwell Hammer wrote:
> 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);
>


Hi Maxwell,

I'm really a beginner with actionscript (so I could be totally wrong)
but doesn't the image keep moving because it is inside an 'onEnterFrame'
function which by its very nature keeps repeating whilst in that frame
so all the statements inside the function will keep repeating too?

Cheers

Kol
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 05:48 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk