您的位置:程序门 -> 多媒体/设计/flash/silverlight 开发 -> flash流媒体开发



 flash中加载的图片无法滚动,高手请指点一下,谢谢!


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


flash中加载的图片无法滚动,高手请指点一下,谢谢!
发表于:2007-11-03 13:35:24 楼主
各位路过的兄弟姐妹,你们好!
   我的flash是加载xml数据里面的图片,但是在flash中不能滚动,那位高手能指点一下吗.如果能在鼠标移动上面有些透明度的变化当然最好.代码如下:
//-------------------------------------
//初始化部分
stop();
var   myxml   =   new   xml();
var   myarray   =   new   array();
//初始化参数设置
var   smallpicwidth   =   100;
var   smallpicheight   =   90;
var   bigpicwidth   =   500;
var   bigpicheight   =   600;
var   albumtext;
myxml.ignorewhite   =   true;
//初始化函数设置
myxml.onload   =   function(ok)   {
              if   (ok)   {
                            var   i   =   myarray.length;
                            var   speed   =   2;
                            _root.show.onenterframe   =   function()   {
                                          for   (var   i   =   1;   i <=myarray.length;   i++)   {
                                                        _root["images_"+i]._x   +=   speed;
                                                        if   (_root["images_"+i]._x> =400)   {
                                                                      _root["images_"+i]._x   =   -100;
                                                        }
                                          }
                            };
                            _global.scrollspeed   =   myxml.firstchild.attributes.scrollspeed;
                            albumtext   =   myxml.firstchild.attributes.albumtext;
                            //trace(albumtext);
                            _global.gap   =   myxml.firstchild.attributes.gap;
                            prasexml();
                            //********************************************************************************************************************
                            //流动代码加入开始
              }
};
//流动代码加入结束
//********************************************************************************************************************
//函数设置
function   prasexml()   {
              for   (var   i   =   0;   i <myxml.firstchild.childnodes.length;   i++)   {
                            var   tempobj   =   myxml.firstchild.childnodes[i].attributes;
                            myarray.push({linkurl:tempobj.linkurl,   imgurl:tempobj.imgurl,   imgtext:tempobj.imgtext});
              }
              drawleft();
}
function   drawleft()   {
              for   (var   i   =   0;   i <myarray.length;   i++)   {
                            var   picloadertemp   =   leftbar.createemptymovieclip("picloader"+i,   i+1);
                            var   piccountertemp   =   leftbar.createemptymovieclip("piccounter"+i,   i+10001);
                            piccountertemp.id   =   i;
                            picloadertemp._y   =   0;
                            picloadertemp._x   =   smallpicheight*i+_global.gap*i;
                            picloadertemp.loadmovie(myarray[i].imgurl);
                            piccountertemp.onenterframe   =   function()   {
                                          var   tempname   =   leftbar["picloader"+this.id];
                                          if   (tempname._width> 0)   {
                                                        var   tempscale   =   math.min(smallpicwidth/tempname._width,   smallpicheight/tempname._height);
                                                        tempname._width   =   90;
                                                        //tempname._width   =   tempscale   *   tempname._width
                                                        tempname._height   =   tempscale*tempname._height;
                                                        tempname.onpress   =   function()   {
                                                                      var   tempnum   =   this._name.slice(9);
                                                                      textarea.contenttext.text   =   myarray[tempnum].imgtext;
                                                                      //trace(textarea.contenttext.text);
                                                                      drawright(myarray[tempnum].imgurl);
                                                                      _root.show._alpha   =   50;
                                                        };
                                                        delete   this.onenterframe;
                                          }
                            };
              }
}
function   drawright(a)   {
              picloader.loadmovie(a);
              var   piccounter   =   this.createemptymovieclip("piccounter",   60000);
              piccounter.onenterframe   =   function()   {
                            if   (picloader._width> 0)   {
                                          var   tempscale   =   math.min(bigpicwidth/picloader._width,   bigpicheight/picloader._height);
                                          picloader._width   =   picloader._width;
                                          picloader._height   =   picloader._height;
                                          picloader._x   =   0;
                                          picloader._y   =   0;
                                          picloader.onpress   =   function()   {
                                                        geturl(a,   "_blank");
                                          };
                                          delete   piccounter.onenterframe;
                            }
              };
}
myxml.load("picx.xml");
高手指点一下呀.急,急,急!

解决问题立即给分,希望我帮调一下文件,然后再上传上来.

源文件如下:http://www.djiang.com/flash.rar
发表于:2007-11-03 23:39:171楼 得分:0
无人问津,好惨了.
发表于:2007-11-06 14:32:552楼 得分:0
透明度你更改_alpha的变化即可.
发表于:2007-11-06 15:39:023楼 得分:0
49076904欢迎as程序高手和游戏开发者加入,菜鸟勿捞


快速检索

最新资讯
热门点击