Action Script in Action Welcome, Guest. Please login or register.
Always stay logged in

Login with username, password and session length
Home Help Search Login Register
Pages: [1]
  Print  
Author Topic: This will give you and idea of what a little scripting can do.  (Read 170 times)
Wayne
Administrator
Full Member
*****

Karma: 0
Offline Offline

Posts: 119


BEER ,beeeeeeeeeeer ah beer.


« on: November 14, 2009, 05:57:36 AM »

What we have here is a slide which when moved will scale a box.
Thinking not much there, wrong. Dive in and you will find you can use several parts of the script on other projects.

Lets get started.

Code:
//a preloader script.
onFrame (1) {
if (getBytesLoaded() >= getBytesTotal())
{
    gotoAndPlay(5);
}
}
onFrame (3) {
if (getBytesLoaded() >= getBytesTotal())
{
    gotoAndPlay(5);
}
}
onFrame (4) {
progress = int(getBytesLoaded() * 100 / getBytesTotal()) add "% - loading Flash...";
gotoAndPlay(3);
}
onFrame (5) {//now we start the slide
ball.onpress = function ()
{
    ball.startDrag(0.000000 == 1.000000, 5, 183, 150, 183);//this sets the guide for the ball
    d = 1;
};
ball.onrelease = function ()
{
    stopDrag();
    d = 0;
};
onmousemove = function ()
{
    if (_ymouse > 212 || _ymouse < 184)
    {
        stopDrag();
        d = 0;
    }
    else if (d == 1)
    {
        disp = ball._x;
        block._width = disp;
        block._height = disp;
    }
};
play ();
}
onFrame (6) {
stop ();
}

File is below

http://cycle1500.com/slidescalebar.swf
Logged
stream2
Star
Full Member
********

Karma: 0
Offline Offline

Posts: 110



« Reply #1 on: February 18, 2010, 07:39:26 AM »

Thanks a lot Mr Wayne

This is very useful on other projects 
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
DG Style by Fth*