Professional Web Applications Themes

Clearing the stage - Macromedia Director Lingo

I've just found out how to draw pixels on the stage on a mouseDown (thanks JohnAQ) with: on mouseDown clickedSprite = the clickOn if clickedSprite = 0 then mLoc = the clickLoc (the stage).image.fill(mLoc[1], mLoc[2], mLoc[1] + 1, mLoc[2] + 1, rgb(0, 0, 0)) end if end Now, after the drawing I would like to able to clear the stage (when clicking a button) of what has just been drawn. Is this possible and if so how??? Thanks...

  1. #1

    Default Clearing the stage

    I've just found out how to draw pixels on the stage on a mouseDown (thanks JohnAQ) with:

    on mouseDown
    clickedSprite = the clickOn
    if clickedSprite = 0 then
    mLoc = the clickLoc
    (the stage).image.fill(mLoc[1], mLoc[2], mLoc[1] + 1, mLoc[2] + 1, rgb(0, 0, 0))
    end if
    end

    Now, after the drawing I would like to able to clear the stage (when clicking a button) of what has just been drawn.

    Is this possible and if so how???

    Thanks



    Nicollini webforumsuser@macromedia.com Guest

  2. #2

    Default Re: Clearing the stage

    Hi,

    You need to copy what was on the stage before you drew over it, then repaste the original back ontop.

    Global Srect,StageUndo

    On mousedown
    Srect=rect(0,0, 800, 600)
    StageUndo=(the stage).image.duplicate()
    (the stage).image.setpixel(the mouseh, the mousev,rgb(0,0,0))
    end

    on undo
    (the stage).image.copypixels(StageUndo, srect,srect)
    end


    Des



    Desmond22 webforumsuser@macromedia.com Guest

  3. #3

    Default Re: Clearing the stage

    the drawpixels code draws directly onto the stage image. to erase everything drawn you need to get Director to force a redraw of the sprites on stage. You can do this by issuing the following line of code and attaching it to a button (most likely)

    on mouseUp
    the stageColor = the stageColor
    end

    Because this affects the stage's default color, Director will redraw all the sprites as they should be and the drawn pixels will dissappear. This is the same technique use to remove video artefacts and any trailing lefts by a sprite that has 'trails' turned on

    hth

    johnAq


    johnAq webforumsuser@macromedia.com Guest

Similar Threads

  1. Clearing the new FLVPlaback
    By andros in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: October 11th, 06:46 PM
  2. Replies: 3
    Last Post: July 14th, 12:52 AM
  3. Clearing cache?
    By Steve Landavazo in forum Web Design
    Replies: 1
    Last Post: April 24th, 03:20 PM
  4. Clearing Arrays
    By Support in forum PERL Beginners
    Replies: 8
    Last Post: January 29th, 01:05 AM
  5. Odp: Clearing the stage
    By luk in forum Macromedia Director Lingo
    Replies: 0
    Last Post: July 16th, 01:19 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139