调整大小后的图片未显示

时间:2015-05-14 11:13:53

标签: actionscript-3 flash

这是我的代码的一部分,我正在尝试从XML输出图像,所有的东西都工作,除了一个,它的图像调整大小。也许我做错了,因为我是flash ac3的新手,我很难理解Flash AC3的逻辑。

当我在“Addobe Flash Pro”中启动我的闪光灯时,我获得了调整大小的图像,但在flashplayer的网站上没有图像,imahes不想显示:(

与闪存链接 - http://flash.leto-templates.com/flash.html

   var my_thumb_width: Number;
   var my_thumb_height: Number;
   var img_height: Number;
   var my_images: XMLList;
   var my_total: Number;
   var my_total_width: Number;
   var image:Bitmap; 

   function processXML(e: Event): void {
     var myXML: XML = new XML(e.target.data);

     my_thumb_width = myXML.@width;
     my_thumb_height = myXML.@height;
     my_images = myXML.image;
     my_total = my_images.length();
     my_total_width = (my_thumb_width + 10) * (my_images.length()) - stage.stageWidth;

     createContainer();
     callThumbs();
     if (my_images.length() > 6) {
       myTimer.start();
     }
   }

   ////...
   var thumb_loader = new Loader();
   var box: Product_box = new Product_box();
   thumb_loader.load(new URLRequest(thumb_url));
   thumb_loader.contentLoaderInfo.parentSandboxBridge = new Object();
   thumb_loader.contentLoaderInfo.parentSandboxBridge['url'] = thumb_url;
   var handleComplete:Function = buildHandleComplete(i);
   thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleComplete );
   ////...   

   function buildHandleComplete(i:int):Function {
     return function(event:Event):void {
       thumbLoaded(event, i);
     };
   }

   function thumbLoaded(e: Event, i: Number): void {
     image = new Bitmap(e.target.content.bitmapData);
     image.width = my_thumb_width;
     image.height = 140;
     image.y = 47;
     image.x = (my_thumb_width + 10) * i;
     container_mc.addChild(image);
   }

0 个答案:

没有答案