Forum Moderators: open

Message Too Old, No Replies

Flash MX: interactive scrolling background

can anyone advise on this please?

         

The Cricketer

10:32 am on Dec 11, 2003 (gmt 0)

10+ Year Member



I'm using Flash MX. I need a rectangular swf where a single background image is scrolling horizontally to begin with and when the mouse moves to that side of the swf the background image moves in the direction of the mouse (preferably in that direction but it doesn't matter if it goes the opposite way).

That is all that is required, just the one scrolling image. I have seen a few tutorials on the web, and the concept seems quite simple, but these tutorials always go a couple of steps further than I need and with my knowledge do not allow me to get what I want.

Is what I want simple? Can someone advise what I need to do?

Hope someone can help.
Cheers

korkus2000

6:35 pm on Jan 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it is simple. It is a not very complicated action script. I don't know of a script off hand. Did you find one?

benihana

1:31 pm on Jan 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



did you get an answer cricketer?

this should get you started with the picture scrolling in response to mouse movements:

have your picture contained in a movieclip with an instance name of pic_mc. in your actions layer put this:


pic_mc.onEnterFrame = function ()
{
picx = pic_mc._x;
//define picx as the x coordinate of the picture
mousex = _root._xmouse;
//define mousex as the x coordinate of the mouse
if (picx <= mousex) {
pic_mc._x += 1;
//if the mouse is to the right of the pictures centre, move the picture to the right
}
if (picx >= mousex) {
pic_mc._x -= 1;
//if the mouse is to the left of the pictures centre, move the picture to the left
}
};

ben