1. There are two button on the stage instanced named (next_btn) and (prev_btn)
2. A movieclip named container_mc.
3. swfs which is to be load in the container_mc
here is code for my fla file:
Expand|Select|Wrap|Line Numbers
- //==================== < Button controll script > =====================\\
- next_btn.onPress = function() {
- if(s <xmldata.firstChild.childNodes.length-1){
- //trace("xmllength = "+xmldata.firstChild.childNodes.length+ " s = "+s )
- //trace("movie name = "+xmldata.firstChild.childNodes[s].firstChild.childNodes[0].nodeValue)
- s++;
- }
- else {
- s=0
- }
- container_mc.loadMovie(xmldata.firstChild.childNodes[s].firstChild.childNodes[0].nodeValue);
- trace("nextButton is pressed");
- };
- prev_btn.onPress = function() {
- if(s > 0){
- s--;
- }
- else {
- s = xmldata.firstChild.childNodes.length-1
- }
- container_mc.loadMovie(xmldata.firstChild.childNodes[s].firstChild.childNodes[0].nodeValue);
- trace("prevButton is pressed");
- };
- //==================== < /Button controll script > =====================\\
- _global.completeMovie = true;
- //_root.container_mc.loadMovie("showMov1.swf")
- //==================== < XML load script > =====================\\
- var xmldata:XML = new XML();
- xmldata.ignoreWhite = true;
- xmldata.onLoad = function(sucess:Boolean) {
- if (sucess) {
- check_text.text = "sucesssfully loaded";
- if (completeMovie == true) {
- }
- trace("file has been loaded");
- } else {
- check_text.text = "Error in loading ";
- trace("error in loading file");
- }
- };
- xmldata.load("moviedata.xml");
- //==================== < /XML load script > =====================\\
- _global.s = 0;
- onEnterFrame = function () {
- if (completeMovie == true) {
- s++;
- container_mc.loadMovie(xmldata.firstChild.childNodes[s].firstChild.childNodes[0].nodeValue);
- };
- var xmllength:Number = xmldata.firstChild.childNodes.length;
- if (s == xmllength) {
- s = -1;
- }
- };
first frame: _global.completeMovie = false;
lastframe:_global.completeMovie = true;
code on xml file:
Expand|Select|Wrap|Line Numbers
- <data>
- <moviedata>
- <movie1>showMov1.swf</movie1>
- </moviedata>
- <moviedata>
- <movie2>showMov2.swf</movie2>
- </moviedata>
- <moviedata>
- <movie3>showMov3.swf</movie3>
- </moviedata>
- </data>
The problem is that when i played my file the first swf which is (game_run_area.swf) loaded but after the rest of the swf is not loaded into the game_run_area.swf.
Plz reply if some one has the solutions.
Thanks
Deepak Nagpal