English 中文(简体)
Flash Pro s should be able to solve in seconds loading a movie
原标题:

I have this action script that pulls images from a xml file

> 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");

I want to load movies into the flash from the xml when someone clicks on one of the images. I suspect to make this possible I need to change this part of the actionscript

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

You might want to remove getURL(...), since that will push you to another page. Also loadMovie(url, target) needs a target.

问题回答

暂无回答




相关问题
As2 Benchmarking

I ve been looking for a took or a method of benchmarking as2 code specifically individual functions. I ve looked at Grant Skinners Performance Test which is for as3 so it does me no good. Does anyone ...

For Loop Only Returning Last Item in Array :(

I m an actionscript novice so I hope I m missing something simple here. In a nutshell, I have a for loop updating a dynamic text element but it seems to iterate so fast that only the last item in the ...

Volume slider - volume doesn t change until mouse over

I ve created a small music player with a sliding volume control. I m having trouble with the volume. Though it does control volume properly, if I set the initial volume to less than 100%, the volume ...

as2 simple for loop not populating textbox

I have got an xml file that brings text into a flash movie in the form of an array, I need to population some textboxes and want to do this using a for loop. My loop look like this: for(var i=...

Run Jquery function on actionscript 2.0

I have a function in jquery I would like run in flash using action script 2.0 The Jquery: <script> $(document).ready(function(){ $("a").click(function(event){ $("div#Header")....

热门标签