2012-12-12 1 views
0

사용자가 하드 디스크에서 이미지를 업로드 할 수있는 플래시 애플릿을 작성하려고합니다.
그래서 actionscript는 이미지를 편집하여 서버로 보냅니다.
이미지를로드하는 것은 플래시 플레이어, 파이어 폭스, 오페라에서 작동하지만 이미지를 선택한 후 크롬에서 멈 춥니 다.
flashdevelop를 사용하고 있습니다. 여기
내 코드입니다 :
actionscript3 (플래시) 이미지 파일을 크롬에로드하지 않습니다.

public class Main extends Sprite 
{ 

    [Embed(source = "../lib/lena.png")] 
    private var layer0Class : Class; 
    private var layer0:Bitmap = new layer0Class(); 

    private var fileReferenceSelect:FileReference = new FileReference(); 

    public function Main():void 
    { 
     if (stage) init(); 
     else addEventListener(Event.ADDED_TO_STAGE, init); 
    } 

    private function init(e:Event = null):void 
    { 
     removeEventListener(Event.ADDED_TO_STAGE, init); 
     /// add image to flash scene 
     addChild(layer0); 

     /// add button 
     var my_button:SimpleButton; 
     my_button = new SimpleButton(); 
     my_button.x = 150; 
     my_button.y = 50; 
     var cerchio:Shape=new Shape(); 
     cerchio.graphics.beginFill(0x000000,1); 
     cerchio.graphics.drawCircle(my_button.x,my_button.y,20); 
     cerchio.graphics.endFill(); 
     my_button.upState = cerchio; 
     my_button.overState = cerchio;; 
     my_button.downState=cerchio; 
     my_button.hitTestState = my_button.upState; 
     addChild(my_button); 
     /// button clicked 
     my_button.addEventListener(MouseEvent.CLICK,function(m:MouseEvent):void 
     { 
      fileReferenceSelect.browse([new FileFilter("PNG Files (*.png)","*.png; *.jpg; *.jpeg")]); 
     }); 
     /// file selected 
     fileReferenceSelect.addEventListener(Event.SELECT, function(event:Event):void 
     { 
      fileReferenceSelect.load(); 
     }); 
     /// file ready to load 
     fileReferenceSelect.addEventListener(Event.COMPLETE, function(event:Event):void 
     { 
      var ldr:Loader = new Loader();    
      /// file loaded 
      ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event):void { 
       var bm:Bitmap = Bitmap(e.target.content as Bitmap); /// here chrome is messing up 
       layer0.bitmapData = bm.bitmapData; 
      }); 
      ldr.loadBytes(fileReferenceSelect.data); 
     }); 
    } 

} 


이 때문에 크롬에서 일부 제한의인가 (I 크롬에 플래시가 샌드 박스에 있음을 읽기)?
더 좋은 방법이 있나요?

+0

있습니다 서버 또는 로컬 테스트 로컬 인 경우 크롬을 사용하여 서버에서 응용 프로그램을 실행하십시오. – Ronnie

+0

localfiles에서 테스트했습니다. – LovelyHanibal

+0

나는 그것이 다른 것으로 의심하지 않았다. 하지만 지금은 서버에 넣을 때 작동합니다. 도움 주셔서 감사합니다. 크롬의 정상적인 작동인지 또는 내가 서버에서만 작동하도록 잘못된 작업을하고 있는지 알고 계십니까? – LovelyHanibal

답변

2

크롬에 로컬로 플래시 콘텐츠를로드하는 데 문제가있었습니다. 그것의 플래시 글로벌 플레이어 설정. 문제는 크롬에 내장 된 플래시 버전이 있다는 것입니다. 어쨌든,이 사이트의 설정을 항상 순종하지 않습니다 http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

을만큼 당신이 그것도 fine..heck해야 웹 서버에서 테스트로 로컬 웹 서버가 작동 당신이

+1

을 추가하면 주소 표시 줄에 'chrome : // plugins /'를 입력하여 후추 플래시를 비활성화 할 수 있습니다. 그런 다음 + 세부 정보를 클릭하고 후추 플래시를 찾아서 사용 중지하십시오. 플러그인 버전이 설치되어있는 한 제대로 작동합니다. – Ronnie

관련 문제