0

我有这个从 xml 文件中提取图像的动作脚本

> myPhoto = new XML();
> myPhoto.ignoreWhite = true;
> myPhoto.onLoad = function(success) {
>   //portfolioTag = this.firstChild;
>   numimages =
> this.firstChild.childNodes.length;
>   spacing = 28;   for (i=0; i<numimages;
> i++) {        this.picHolder =
> this.firstChild.childNodes[i];
>       this.thumbHolder =
> thumbnails.createEmptyMovieClip("thumbnail"+i,
> i);       this.thumbHolder._x = i*spacing;
>       this.thumbLoader =
> this.thumbHolder.createEmptyMovieClip("thumbnail_image",
> 0);
>       this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
>       this.thumbHolder.title =
> this.picHolder.attributes.title;
>       this.thumbHolder.main =
> this.picHolder.attributes.main;
>       this.thumbHolder.onRelease =
> function() {          getURL(this.main,
> "_self");             loadMovie(this.main);
>           main_txt.text = this.main;      };  }
> }; myPhoto.load("languages.xml");

当有人单击其中一个图像时,我想将电影从 xml 加载到闪存中。我怀疑要使这成为可能,我需要更改动作脚本的这一部分

this.thumbHolder.onRelease =
> function() {          getURL(this.main,
> "_self");             loadMovie(this.main);
>           main_txt.text = this.main;      };  }
> }; myPhoto.load("languages.xml");
4

1 回答 1

1

您可能想要删除getURL(...),因为这会将您推到另一个页面。还loadMovie(url, target)需要一个目标。

于 2009-11-22T20:52:42.163 回答