• 20-02-2010, 22:42:06
    #1
    çok kolay bişe 1.frameye sağ tıklayıp action seçiyoruz ve aşağıdaki kodları yapıştıtıyoruz // ile başlayanlar açıklamaları ama ingizlice
    önizleme ve indirmek için
    http://www.ffiles.com/flash/particle...e_type=success



    //Create a new instances of a shape and add it to the stage.
    var myShape:Shape = new Shape();
    addChild(myShape);
    
    //Double click property must be enabled before it will generate an event.
    stage.doubleClickEnabled = true;
    
    //Adds event listeners to the stage.
    stage.addEventListener(MouseEvent.MOUSE_DOWN, drawLine);
    stage.addEventListener(MouseEvent.MOUSE_UP, drawUp);
    
    //This adds the drawMove function and sets the inital start position
    //of the line.
    function drawLine(event:MouseEvent):void {
     myShape.graphics.moveTo(mouseX, mouseY);
     stage.addEventListener(MouseEvent.MOUSE_MOVE, drawMove);
    }
    
    //This function creates the random coloured line with different thicknesses.
    function drawMove(event:MouseEvent):void {
     var randomNumber:uint = Math.floor(Math.random()*15)+5;
     myShape.graphics.lineStyle(randomNumber, Math.random()*0xFFFFFF);
     myShape.graphics.lineTo(mouseX, mouseY);
    }
    
    //This removes the drawMove function and adds the clearMovie function.
    function drawUp(event:MouseEvent):void {
     stage.removeEventListener(MouseEvent.MOUSE_MOVE, drawMove);
     stage.addEventListener(MouseEvent.DOUBLE_CLICK, clearMovie);
    }
    
    //This function clears the line.
    function clearMovie(event:MouseEvent):void {
     myShape.graphics.clear();
    }
  • 21-02-2010, 00:40:34
    #2
    Teşekkürler