Flash Gallery | Flash Templates | Flash Menu | Flash Design | Flash Audio & Video

flash page flip

Actionscript 3.0 video tutorials

+ Reply to Thread
Results 1 to 2 of 2

Thread: custom cursor under a box

  1. #1
    Junior Member Settled In Glen Charles Rowell is on a distinguished road
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

    Talking custom cursor under a box

    amazing Flash templates
    My code is working but I have 1 small problem and one bit of code that I want to make better.

    1. The problem: The symbol that is the custom cursor is under a box. So, I would like to swap the movieclips or some how move the cursor's movie clip to the top.

    2. When I click and drag something I would like the loaded custom cursor icon to change to a different custom cursor (a movie clip in my library), then when I release go back to the original custom cursor.

    Regards,

    Glen Charles Rowell

    Code:
    import flash.ui.Mouse;
    import flash.events.MouseEvent;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    
    
    
    stage.addEventListener(Event.ENTER_FRAME, moveMouse);
    function moveMouse(Event) {
        Mouse.hide();
        cursor.x = mouseX;
        cursor.y = mouseY;
    }
    
    var board:Sprite = new Sprite();
    
    stage.addChild(board);
    //swapChildren( board, cursor ); 
    board.addChild(dragThis);
    trace(stage.getChildAt(0).name); // sprite2
    trace(stage.getChildAt(1).name); // sprite1
    
    
    board.graphics.lineStyle(1,0);
    board.graphics.beginFill(0xCCCCCC,0.7);
    board.graphics.drawRect(0,0,200,300);
    board.graphics.endFill();
    board.x = 100;
    board.y = 10;
    
    dragThis.x = 50;
    dragThis.y = 50;
    
    dragThis.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    
    function startMove(evt:MouseEvent):void {
        stage.addEventListener(MouseEvent.MOUSE_MOVE, pointMove);
    }
    
    function pointMove(e:MouseEvent):void {
        dragThis.x = goodX(board.mouseX);
        dragThis.y = goodY(board.mouseY);
        e.updateAfterEvent();
        
    }
    
    stage.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    
    function stopMove(e:MouseEvent):void {
        stage.removeEventListener(MouseEvent.MOUSE_MOVE, pointMove);
    }
    
    function goodX(inX:Number):Number {
        if (inX < 0) {
            return 0;
        }
        if (inX > 200) {
            return 200;
        }
        return inX;
    }
    
    function goodY(inY:Number):Number {
        if (inY < 0) {
            return 0;
        }
        if (inY > 300) {
            return 300;
        }
        return inY;
    }

  2. #2
    Junior Member Settled In Glen Charles Rowell is on a distinguished road
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

    Re: custom cursor under a box

    Any ideas? If I could just get a little help swapping the depths it would be great. I would love to use external classes but I'm not allowed to use external files in this project.

    Regards,

    Glen Charles Rowell

    PS I tried adding the custom cursor again but it didn't work.

+ Reply to Thread

Similar Threads

  1. Custom events and describeType method
    By Flep in forum Tutorials
    Replies: 0
    Last Post: 19-10-09, 05:07
  2. using custom class and get error
    By davids701124 in forum advanced Actionscript 3.0
    Replies: 0
    Last Post: 02-08-09, 12:33
  3. Burnandbass custom navigation
    By burnandbass in forum CS4 FlepStudio users utilities
    Replies: 0
    Last Post: 12-04-09, 10:43
  4. Disabling pan (with hand cursor) when zoomed in?
    By 40044004 in forum Actionscript 3.0 newbies
    Replies: 3
    Last Post: 09-01-08, 07:50
  5. Custom events - EventDispatcher
    By Flep in forum Tutorials
    Replies: 0
    Last Post: 23-09-07, 17:37

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Optimization by vBSEO