A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Preventing users from capturing the screen

  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    15

    Preventing users from capturing the screen

    Is there anyway to disable the Print Screen key or stop users from capturing the screen.

    I've tried the fallowing method

    private function init():void
    {
    this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
    }

    private function onEnterFrame(event:Event):void
    {
    System.setClipboard("Copy/Paste functionality has been disabled.");
    }

    but it gives me this error, anyway to make this work?

    Error: Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press.
    at flash.system::System$/setClipboard()


    Any help is greatly appreciated.

  2. #2
    Junior Member
    Join Date
    Jun 2010
    Location
    Toronto
    Posts
    28
    No. Only user interaction allows this to happen; I have worked many hours trying to figure this out but it's a security thing. Sorry!

  3. #3
    Junior Member
    Join Date
    Jun 2010
    Location
    Toronto
    Posts
    28
    You may try a workaround using JavaScript or some ExternalInterface connection where Flash is not involved in capturing the screen, it may get tricky.

  4. #4
    supervillain gerbick's Avatar
    Join Date
    Jul 2000
    Location
    undecided.
    Posts
    18,986
    For Windows, we used to capture the print screen keypress and throw up a modal popup with the warning of "Don't do that" - but on a Mac, they can Shift+Command+4 and draw outside of that browser (thus the browser is no longer in focus) and you can't capture that.

    Same for other screen capture scenarios.

    [ Hello ] | [ gerbick ] | [ Ω ]

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