tiingshii
11-17-2009, 06:19 AM
hi ppl,
im working on all direction panning, the script is working, but its not the effect i want. i want to get the same effect as this website http://marvelultimatealliance.marvel.com/ (when your inside, click on character button which is at the top of the screen, then click on any of the characters. move your cursor around to test the panning)
Whats the different between mine and the marvel site is:
- (marvel) if your cursor move abit to the left/right and stop moving your cursor, the panel will stop moving anymore, as for mine, it will continue moving until it reach the edge of the image.
- last point, (marvel) if you move your cursor to the top left corner and move your cursor back to the center of the screen, the image will move back to the center too. Mine will move diagonally to the edge.
panel.onRollOver = panelOver;
function panelOver ()
{
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = stroke.getBounds (_root);
function scrollPanel ()
{
if (_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax)
{
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
if (panel._x>=-25)
{
panel._x = -25;
}
if (panel._x<=-265)
{
panel._x = -265;
}
if (panel._y>=-20)
{
panel._y = -20;
}
if (panel._y<=-170)
{
panel._y = -170;
}
var xdist = _xmouse-450;
var ydist = _ymouse-275;
panel._x += -xdist/30;
panel._y += -ydist/30;
}
anyone can help me to get the same effect as the marvel's site?
http://www.pddesignstudio.com/scrollingPanel1.zip
im working on all direction panning, the script is working, but its not the effect i want. i want to get the same effect as this website http://marvelultimatealliance.marvel.com/ (when your inside, click on character button which is at the top of the screen, then click on any of the characters. move your cursor around to test the panning)
Whats the different between mine and the marvel site is:
- (marvel) if your cursor move abit to the left/right and stop moving your cursor, the panel will stop moving anymore, as for mine, it will continue moving until it reach the edge of the image.
- last point, (marvel) if you move your cursor to the top left corner and move your cursor back to the center of the screen, the image will move back to the center too. Mine will move diagonally to the edge.
panel.onRollOver = panelOver;
function panelOver ()
{
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = stroke.getBounds (_root);
function scrollPanel ()
{
if (_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax)
{
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
if (panel._x>=-25)
{
panel._x = -25;
}
if (panel._x<=-265)
{
panel._x = -265;
}
if (panel._y>=-20)
{
panel._y = -20;
}
if (panel._y<=-170)
{
panel._y = -170;
}
var xdist = _xmouse-450;
var ydist = _ymouse-275;
panel._x += -xdist/30;
panel._y += -ydist/30;
}
anyone can help me to get the same effect as the marvel's site?
http://www.pddesignstudio.com/scrollingPanel1.zip