Be a Supporter!

Scrolling Camera (repeat)

  • 647 Views
  • 14 Replies
New Topic Respond to this Topic
Darkaxl
Darkaxl
  • Member since: Oct. 23, 2004
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Scrolling Camera (repeat) 2005-09-09 10:59:39 Reply

yea i asked a while ago and got some responses but i didnt understand what to do with the AS they was given.

I'm makin a flash site and Basicly i want it to be fully interactive. So rather like the snow effect that follows you're mouse, i need AS that when the mouse is to the left of the flash stage the Background would move to the left e.g There a bustop on the far right but you cant see it when the site loads up, Thus you need to scroll right to get to it. I know there is a AS code for this but its realy hard to find. IF theres a Tutorial or Possibly step by step help someone could helpwith
id appreiciate it

Darkaxl.


BBS Signature
liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 11:03:10 Reply

There isn't a set AS code for it, but it is possible. One way would be to make all the background a movie clip and then have it so if the _xmouse was lower than a set point (eg 150) then the background moves to the left/right.


Sup, bitches :)

BBS Signature
T-H
T-H
  • Member since: Jan. 7, 2004
  • Offline.
Forum Stats
Member
Level 40
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 11:03:54 Reply

As I posted last time, put this code on your frame, and name the back ground movie clip "backGround_mc". That will work fine.

_root.onEnterFrame = function(){
xDist =( Stage.width/2)-_root._xmouse;
yDist = (Stage.height/2)-_root._ymouse;
backGround_mc._x += xDist/30;
backGround_mc._y +=yDist/30;
}

V Cam is a nightmare to get to scroll using AS, so dont bother using that.

IWantSomeCookies
IWantSomeCookies
  • Member since: Aug. 20, 2004
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 11:05:14 Reply

Dude, I know what you mean. I had it - but I got a new comp and lost all my codes.. ill go a' searching for you!

Im sure something like when mouse is at 200 on the x axis, background_mc go to 600 on the x axis. I havent actionscripted for a while, need to get back into it!


"Actually, the server timed out trying to remove all your posts..."
-TomFulp

LEMITUDE
LEMITUDE
  • Member since: Aug. 8, 2004
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 11:35:38 Reply

What is V Cam??? sounds interesting. Is it similar to the flash camera used in 'Prowlies by the River'???

liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 11:37:04 Reply

Here's an example, move your mouse to the left or to the right..

http://media.putfile.com/sidescroll


Sup, bitches :)

BBS Signature
T-H
T-H
  • Member since: Jan. 7, 2004
  • Offline.
Forum Stats
Member
Level 40
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 12:03:52 Reply

At 9/9/05 11:35 AM, LEMITUDE wrote: What is V Cam??? sounds interesting.

Yeah its used in PBTR, you can't really use it for game scrolling though as it resizes the stage so co ordinates get messed up. Might be able to but I've never been able to get it working that way.

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to Scrolling Camera (repeat) 2005-09-09 12:05:21 Reply

At 9/9/05 12:03 PM, T-H wrote:
At 9/9/05 11:35 AM, LEMITUDE wrote: What is V Cam??? sounds interesting.
Yeah its used in PBTR, you can't really use it for game scrolling though as it resizes the stage so co ordinates get messed up. Might be able to but I've never been able to get it working that way.

Yeah I thought the VC was an action script command for a while then when I used it I realised that it was the best EVER tool for animators and is sooooo easy to use.
Also dont try and export movies as anything except swf when using one :P


- Matt, Rustyarcade.com

liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 12:06:56 Reply

At 9/9/05 12:05 PM, Ninja-Chicken wrote: Also dont try and export movies as anything except swf when using one :P

That will be because AS only works with .swf XD


Sup, bitches :)

BBS Signature
Darkaxl
Darkaxl
  • Member since: Oct. 23, 2004
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 12:12:48 Reply

LIAM THAT OWNZ ^^: And Thanx the script Ill credit ya for AS help ^^;


BBS Signature
LEMITUDE
LEMITUDE
  • Member since: Aug. 8, 2004
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 12:27:44 Reply

At 9/9/05 12:03 PM, T-H wrote:
At 9/9/05 11:35 AM, LEMITUDE wrote: What is V Cam??? sounds interesting.
Yeah its used in PBTR, you can't really use it for game scrolling though as it resizes the stage so co ordinates get messed up. Might be able to but I've never been able to get it working that way.

OIC.

You can use it in games... just make your own MC the same size as your stage (because its actually the resizing of the camera MC that causes the co-ords. to go funny), copy the AS accross minus the scaling and tint parts (if you dont need them) and bobs yer uncle.

I used it to do the scrolling for this: http://www.newground..ag/alphas/alpha/1194
although the camera's _x and _y positions are simply _root.cam._x = _root.hero._x ... but in the same way for mouse controled scrolling, you could have two simple, invisible MCs, set to _root.its_name1._x = _root.cam._x + 200 and for the 2nd.. - 200 with another bit of code, something along the lines of
if (_root._xmouse >= _root.its_name1._x){
_root.cam._x +=5;
}
or whatever.

LEMITUDE
LEMITUDE
  • Member since: Aug. 8, 2004
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 12:31:37 Reply

DOH!

or even simpler... without the invisible MCs, you could just have:

if (_root._xmouse >= _root.cam._x +200){
_root.cam._x +=5;
}
if (_root._xmouse<= _root.cam._x -200){
_root.cam._x -=5;
}

T-H
T-H
  • Member since: Jan. 7, 2004
  • Offline.
Forum Stats
Member
Level 40
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 12:33:25 Reply

At 9/9/05 12:27 PM, LEMITUDE wrote: OIC.

Thanks for that, didn't follow what you were saying completey but its good to know it can be done. I'll have a play around when i need to.

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to Scrolling Camera (repeat) 2005-09-09 13:10:02 Reply

At 9/9/05 12:06 PM, -liam- wrote:
At 9/9/05 12:05 PM, Ninja-Chicken wrote: Also dont try and export movies as anything except swf when using one :P
That will be because AS only works with .swf XD

Really you dont say??
OMG you are clever I didnt realise that I though I could use AS to make dvds


- Matt, Rustyarcade.com

Darkaxl
Darkaxl
  • Member since: Oct. 23, 2004
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Scrolling Camera (repeat) 2005-09-09 13:10:52 Reply

ninja dont be harsh he's just commenting ^^;


BBS Signature