0

私はflex 3プロジェクトに取り組んでいます。複数の画像がある1つのタイルリストがあり、すべての画像がタイルリストの異なるキャンバスに配置されています。allowmultipleSelectionをtrueにします。ここで、ユーザーが TileList から選択した印刷ボタンのクリック時にすべての画像を印刷する必要があります。

どうすればいいのか、適切な提案をください。

ありがとう、

4

1 に答える 1

0

ここでは、TileList の代わりに Tile を使用し、選択したすべての画像を 1 つの配列にプッシュします。そして、printer.printPageでその配列を渡すと、すぐに機能します。

 /* MyCustomItemBox */

  <mx:HBox  id="hb"  autoLayout="false">
    <mx:Image id="img" source="{imageURL}"/>
  </mx:HBox>


 /*   Print Script */

 // Custom Component which will be added in to Tile. 
 var myCustomBox= new MyCustomItemBox();
 thumbView.addChild(myCustomBox);

  // On Print Button Click
 protected function onPrintPages(event:MouseEvent):void
 {
    var printer:Printer = new Printer();
    var arr:Array = new Array();

        for(var i:int = 0;i<10;i++)
            {
                 var bdi:MyCustomItemBox = thumbView.getChildAt(i) as MyCustomItemBox;
                var hb:HBox = bdi.getChildByName("hb") as HBox;
                arr.push( hb.getChildByName( 'img' ) as UIComponent  );
            }

   if(arr.length > 0)
        printer.printPage(arr,null, "showAll");

 }

<mx:Tile id="thumbView" autoLayout="false" width="90%" height="90%" />
于 2012-09-18T11:00:39.103 に答える