# BitmapData & StageDisplayState.FULL\_SCREEN clash

**URL:** <https://forum.kirupa.com/t/bitmapdata-stagedisplaystate-full-screen-clash/325626>\
**Category:** flash\
**Created:** [October 26, 2011, 5:27pm UTC](https://forum.kirupa.com/t/bitmapdata-stagedisplaystate-full-screen-clash/325626 "2011-10-26T17:27:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeeto](https://avatars.discourse-cdn.com/v4/letter/z/e274bd/32.png) [@zeeto](https://forum.kirupa.com/u/zeeto)\
**Post date:** [October 26, 2011, 5:27pm UTC](https://forum.kirupa.com/t/bitmapdata-stagedisplaystate-full-screen-clash/325626/1 "2011-10-26T17:27:04Z")

</div>

Hi,

There are lot of posts with regards to Security problems when trying to use draw(“file”); method on external file, however I’ve got this problem trying to use draw(stage) in FullScreen Mode.

Is this a case that using draw() on stage in FullScreen mode is impossible?  
Is there any workaround to do that?

```auto
package {

import flash.display.StageAlign; 
import flash.display.StageScaleMode; 
import flash.display.MovieClip; 
import com.zeeto.layout.fullscreen.FullScreenColorSmart; 

public class Main extends MovieClip { 
  private var fullScreen:FullScreenColorSmart; 

  public function Main():void { 
    stage.scaleMode = StageScaleMode.NO_SCALE; 
    stage.align = StageAlign.TOP_LEFT;  
    if (stage) start(); 
    else addEventListener(Event.ADDED_TO_STAGE, start); 
  }

  private function start(e:Event = null):void { 
    removeEventListener(Event.ADDED_TO_STAGE, start); 
    fullScreen= new FullScreenColorSmart(); 
    addChild(fullScreen); 
    stage.addEventListener(Event.RESIZE, stageResize); 
  } 

  private function stageResize(e:Event):void { 
    fullScreen.reposition(); 
  } 
} 
}

```

```auto

package com.zeeto.layout.fullscreen { 

import flash.display.Sprite; 
import flash.display.Bitmap; 
import flash.geom.Matrix; 
import flash.display.BitmapData; 
import flash.geom.ColorTransform; 

public class FullScreenColorSmart extends Sprite { 

  [Embed(source="/gfx/fullscreen.png")] 
  private var fs:Class; 
  private var fsIcon:Bitmap = new fs(); 

  public function FullScreenColorSmart() { 
    addEventListener(Event.ADDED_TO_STAGE, init); 
  } 

  private function init(e:Event):void { 
    removeEventListener(Event.ADDED_TO_STAGE, init); 
    addChild(fsIcon); 
  } 

  public function reposition():void { 
    var bmd:BitmapData = new BitmapData(1, 1); 
    var matrix:Matrix = new Matrix(); 
    matrix.translate( -this.x - this.width, -this.y); 
    bmd.draw(stage, matrix); // Causes security error 
    var pixel:uint = bmd.getPixel(0, 0); 
  } 
}  
}

```
