A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Guitar Tutor?

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    4

    Guitar Tutor?

    Hi there,

    I'd like to build my own version of something like this, and customise the design:

    Code:
    http://www.chordbook.com/guitarchords.php
    Has anyone seen any posts, or tutorials where I could get started from? I've got a good idea of the process, but little things like the way you can Drag and Drop the circles into position is something I've never done before...

    Thanks to anyone who can point me in the right direction!!

  2. #2
    Member
    Join Date
    Mar 2008
    Posts
    82
    Piece of cake. Drag and drop with snap, rough outline below. Good luck.

    PHP Code:
    var gridSize:Number 10;
    // Sets the size of the squares of the grid which the dots snap to.

    stage.addEventListener(MouseEvent.MOUSE_DOWNmousePressed);

    function 
    mousePressed(down:MouseEvent):void {
        
    stage.addEventListener(MouseEvent.MOUSE_UPmouseReleased);
        
    down.target.startDrag();
    }

    function 
    mouseReleased(up:MouseEvent):void {
        
    stage.removeEventListener(MouseEvent.MOUSE_UPmouseReleased);
        
    up.target.stopDrag()
        
        
    // These next lines handle the 'snapping'
        
    up.target.Math.round(mouseX gridSize) * gridSize;
        
    up.target.Math.round(mouseY gridSize) * gridSize;    


    ----------------------------------------------------------------------1
    5-------------3-------------2-------------1-------------0-------------0
    -------0-------------0-------------0-------------0-------------0------0
    ----------------------------------------------------------------------0
    3-------------2-------------0-------------0---------------------------2
    --------------------------------------------------------3-------------3

  3. #3
    Junior Member
    Join Date
    Jan 2009
    Posts
    4
    Hi there... thank you! ...been stuck on something else so still not had chance to try this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center