Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / December 2005



Tip: Looking for answers? Try searching our database.

sliding content

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dirkness - 31 Dec 2005 16:02 GMT
hi

I'm developing a site using sliding content - controlled with up and down
buttons.  But I'm having problems with the positioning 'degrading' the more the
up / down  buttons are pressed:

You can see this here: http://www.detkendesign.com/detken2/portfolio.htm 

I'm using the  AS below for the buttons.

Grateful for any ideas on a fix.

Thanx

Dirk

onClipEvent (load) {
    _x = 0;
    _y = 0;
    div = 5;
}

onClipEvent (enterFrame) {
    _x += (endX-_x)/div;
    _y += (endY-_y)/div;

    _root.up.onRelease = function() {
        if(_y<-260){
            endX = 0;
            endY = _y+260;}
};
   
    _root.down.onRelease = function() {
        if(_y>-1040){
            endX = 0;
            endY = _y-260;}
};
   
}
tralfaz - 31 Dec 2005 19:20 GMT
> hi
>
[quoted text clipped - 6 lines]
> You can see this here:
> http://www.detkendesign.com/detken2/portfolio.htm

The link isn't working, but anyway, store your positions in variables
instead of in the object itself.  Incrementing the object's properties
directly can result in decimal place round-off etc.   Many objects
won't increment certain properties in a linear way.

Instead of something like _x++
Use an storage variable like this..
xpos++;
Then assign it to _x:
_x = xpos;

Start with whole numbers and keep it on whole numbers..
Initialize to a whole number to start..
xpos = 100;
Then add only whole numbers...
xpos += 5;
tralfaz
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.