[sticky] Labs


Welcome to labs.dwightdemmers.nl. On this website I post all my Flash Experiments that I've made in my spare time. So people who want to can learn from them or just run them for fun.

Contact: info@dwightdemmers.nl

View Dwight Demmers's profile on LinkedIn

[04.03.2008] AS3 Scrollbar


I've been to the Adobe Actionscript 3 From The Ground Up Tour presented by Colin Moock. It was a great day and I've learned a lot. It was a 9 hours during lecture about Actionscript 3 and Object Oriented Programming (OOP)

So when I came home from this Tour, I thought it would be a great idea to make a scrollbar completely out of AS3. So here it is!
The only thing that the FLA contains is my MovieClip containing text, the scrollbar is completely generated by AS3.

Usage:
Create a MovieClip (MC) on the stage containing the contents that you want to scroll. Give the MC an instance name such as "contentMC".

Go to the actionspanel and type the following code:
import nl.dwightdemmers.easyScroller.*;
var myScroll:easyScroller = new easyScroller(contentMC, 200);
addChild(myScroll);

In the code above, contentMC is the instancename of my MovieClip on the stage. The 200 stands for the height of the scrollbar, you can make it as large or as small as you like.

If you like the scrollbar and wishes to use it, please drop me a mail at info[at]dwightdemmers[dot]nl
replace the [at] for a @ and the [dot] for .



View project »

Posted by: Dwight Demmers

[16.01.2008] Webcam Motion Detection Test 2


After the first webcam testcase, I went on and used the webcam as input device.

Usage:
Wave over the startbutton with your hand to activate the game.
The ball will move a cross the screen and bounces of the walls. If you move your body, hands or head the ball will react on your motion causing it to bounce into the other direction.

Note: You need a webcam to view this project. Flash will askyou for permission to use your webcam.



View project »

Posted by: Dwight Demmers

[16.01.2008] Webcam Motion Detection Test 1


We had the idea to use a webcam in one of our projects, so first I started with making a testcase for motion detecting. Just to see how everything works.

Note: You need a webcam to view this project. Flash will askyou for permission to use your webcam.



View project »

Posted by: Dwight Demmers

[03.12.2007] FPSChanger.as


There are many times that I would like to change the FPS (Frames Per Second) of a MovieClip instead of the whole SWF.
I've been searching for a script on the internet but without any "good" succes...

Today I've desided to write my own class which can change the FPS of any MovieClip on stage to whatever value the developer want, without "delaying" or "speeding-up" any other MovieClip on the stage.

I won't put the class online for download. But if you like to use the class, just drop me a e-mail at: info[at]dwightdemmers[dot].nl (where ofcourse [at] should be replaced for @ and [dot] should be replaced for a . )

Be sure to check out de the demo!



View project »

Posted by: Dwight Demmers

[27.11.2007] Custom Scrollbar


Because most of my projects at work contain long texts, I use scrollbars. But as many of you know, the standard scroll component of Flash isn't that pretty it is actually quite ugly...

So I decided to create my own scrollBar, there are many allready made by other persons, but most of them don't have the features that I want or just have to much features...
Now I have made my own scrollBar, it is still a "beta" because it is still a movieclip with AS2 code. So I will only show a demo swf. I will release the scrollBar later on, but fist I want to convert it to a component for more flexible use.

Have fun!

Features:
myScrollBar.targetMC = yourContentMC
myScrollBar.scrollHeight = fill in the wished height you want to show eg. 250
myScrollBar.showBorders = true or false
myScrollBar.showButtons = true or false



View project »

Posted by: Dwight Demmers

[26.10.2007] Leaves in the wind


I needed some autumn leaves that where blown away by the wind for a Flash game that I'm currently developing for my work. It was a lot of hustle to getit right, but here it is :-)
Refresh the project page to replay animation

*wished he paid more attention during Math classes at high-school*


View project »

Posted by: Dwight Demmers

[24.10.2007] Gravity Simulation


This was a little test to make a Ball fall with the simulation of gravity and friction. The code is written in classes.



View project » | Download sourcecode »

Posted by: Dwight Demmers

[20.09.2007] CPU Check


OK, first of all, I want to make the announcement that this page from now on will be published in English (so more people can benefit of my tests). :-)
All my earlier posts will be converted to English within time.
Nuff said, let's go to this testproject.

As a Flash (game) designer I constantly have to take into account that there are people viewing/playing my projects with older outdated computers.
This means slower CPU's. To avoid slowing my animations down, I made this "CPU Check".
This little tool checks the CPU of the running computer and returns a number. The tool is only to check how fast the CPU is. To adjust your movie, you should use the Actionscript used by in my test. (also posted below)

Script:

function CPUcheck(){
    n = 0;
    a = getTimer();
    while (Number(n)<1000) {
        n = Number(n)+1;
    }
    b = getTimer();
    CPUlag = b-a;
   
    // From 1.3 Ghz CPU
    if (CPUlag<5) {
        _quality = "HIGH";
        _root.speedvalue = 9;
        _root.rotationSpeed = 13;
    }

    // From 500 Mhz CPU
    if ((CPUlag>5) && (CPUlag<15)) {
        _quality = "MEDIUM";
        _root.speedvalue = 11;
        _root.rotationSpeed = 15;
    }
    // Below 500 Mhz CPU
    if (CPUlag>13) {
        _quality = "LOW";
        _root.speedvalue = 13;
        _root.rotationSpeed = 15;
    }
}

CPUcheck();



View project » | Download sourcecode »

Posted by: Dwight Demmers

[11.09.2007] Reactievermogen


Dit is een test-spel die ik een jaar geleden heb gemaakt voor mijn werk. Uiteindelijk is het een compleet ander spel geworden.

Toch vond ik het wel waard om hier te plaatsen. De Actionscript is simpel, maar ik denk dat er wel van te leren valt ;-)
Have fun!

Besturing:
Beweeg de muis om je spelertje van links naar rechts te bewegen. Houdt de ongenode gasten tegen, maar pas op dat je de genode gasten niet per ongeluk tegenhoudt!


View project » | Download sourcecode »

Posted by: Dwight Demmers

[07.08.2007] Flash Google Maps


Ik wilde Google Maps toevoegen aan Hyves, maar helaas ondersteund Hyves geen Javascript Applicaties.

Omdat Hyves wel de "embed codes" van Youtube ondersteund, dacht ik dat het ook de embed code van elke andere Flash Api zou ondersteunen, dus heb ik Google Maps met behulp van GMap in Flash gemaakt.

Note: Helaas ondersteund Hyves alleen embed codes die van websites komen, die geregistreerd staan in de Hyves database. Deze API is dus niet bruikbaar in Hyves, overigens wel in je eigen website.

View project » | Download sourcecode »

Posted by: Dwight

[31.07.2007] Bereken BTW Module


Een tijdje geleden wilde ik de BTW optellen bij een bepaald bedrag en toen dacht ik, "Ik kan er ook een flash file van maken voor op een website".
Dit is vrij makkelijk te maken, dus heb ik het tijdens de theorie lessen van het CMM gemaakt ;-)

Bediening: Voer je bedrag zonder BTW in en druk op de knop!

View project » | Download sourcecode »

Posted by: Dwight

[30.07.2007] Block Breaker


Dit is het tweede spel uit het boek "Flash Professional 8 Game Development"
Het is een ouderwets "Block Breaker" spel, zoals ze vroeger in de Arcade hallen stonden, het doel is simpel, vernietig alle blokjes door er met je balletje tegenaan te stoten.

Bediening: Beweeg paddle: beweeg je muis van links naar rechts en andersom

View project »

Posted by: Dwight

[30.07.2007] Whack a Capsule


Mijn baas heeft onlangs voor mij een boek besteld genaamd "Flash Professional 8 Game Development" geschreven door Glen Rhodes. Een geweldig boek over gamedevelopment in Flash 8.

Dit is het eerste spel dat ik gemaakt heb met behulp van het boek. Dit spel was wel makkelijk en had ik ook zonder het boek kunnen maken, gezien ik al een aantal games voor mijn werk geschreven heb. Maar het is wel interressant om te lezen hoe Glen Rhodes naar bepaalde script technieken kijkt en hoe hij deze gebruikt.

Bediening: Slaan: linker muisknop Richten: beweeg de muis

View project »

Posted by: Dwight

[30.07.2007] Target Practice v1.0


Dit is een simple shooter waarin een schiettent van de kermis wordt nagebootst. Er komen "targets" omhoog waar je op moet schieten. Als je raakt krijg je 10 punten, als je mist gaan er 30 punten vanaf!

Dit spel gaat oneindig lang door, ik heb er nooit een eind aangemaakt omdat het mij alleen om de game-engine ging.

Bediening: Richten: Beweeg de muis Schieten: Linker muisknop Herladen: Klik op "reload"

View project » | Download sourcecode »

Posted by: Dwight