LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-03-2007, 02:21 AM
clem_c_rock clem_c_rock is offline
Registered User
 
Join Date: Jul 2004
Posts: 60
Rep Power: 9
clem_c_rock is on a distinguished road
Strange behavior - creating, loading movie clips works only for first function call

Hello,

I am reading an XML document and creating empty movie clips and attaching multiple instances of a movie clip from the library into each empty movie clip.

it works fine in the first loop and function call but after that, the movie clips register as being created, and attached but they aren't showing up.


Here's some of the code, in a nutshell:

Code:
function call_xml( start_cnt )
{ 
        var xml_menu:String =  'gallery.xml'; 
       menuXML = new XML();
       menuXML.ignoreWhite=true;     
       menuXML.load( xml_menu ); 
       menuXML.onLoad = parse_xml;   
}


function parse_xml()
{
	 //---- create holder movie clips  w/in the pc_movie_loader
	 //---------------------------------------------------------------------------
	_root.pc_movie_loader.mc_holder_clip.unloadMovie();
	_root.pc_movie_loader.createEmptyMovieClip( 'mc_holder_clip', 1 );
         //----------------------------------------------------------------------------
			  
          for( var i:Number = 0; i < node_1.length; i++ ) 
	 {	
	           subnode_1 = node_1[i].childNodes;
		 
		  if( i >= this_start_cnt && i < this_end_cnt )
		  {
			   _root.pc_movie_loader.mc_holder_clip.createEmptyMovieClip( 'mc_demo_panel_' + i, i );
	                      _root.attach_movie_clip('reg_demo_panel', _root.pc_movie_loader.mc_holder_clip['mc_demo_panel_' + i], '', row_x, row_y );
		             _root.print_clip_elements(_root.pc_movie_loader.mc_holder_clip); 
			   
			     row_cnt++;
			     row_y = row_y + (_root.pc_movie_loader.mc_holder_clip['mc_demo_panel_' + i]._height + 10);
			   		
			     if( row_cnt == 2)
			     {
				   row_x = 444;
				   row_y = 10;
				   row_cnt = 0;
			   }
		  }
	 }

}

and here's the print_clip_elements test function I'm using to print the contents of the movie clips:


function print_clip_elements( clip:Object )
{
	for( var j in clip )
	{
		 trace( "****** j:" + j + " : " + clip[j] );
	}
}

and here's the attach_movie_clip test function I'm using to attach the movie clips from the library:

function attach_movie_clip( movie_clip:Object, level:Object, message_var:String, x_coords:Number, y_coords:Number ) 
{ 
       level.attachMovie( movie_clip, movie_clip,10,{_x:x_coords,_y:y_coords});
}
When I call the print clip elements the output is as follows for every function call:


===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_4
===== END PRINT MOVIE CLIPS ============================


===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_5 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_5
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_4
===== END PRINT MOVIE CLIPS ============================


===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_6 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_6
j:mc_demo_panel_5 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_5
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_4
===== END PRINT MOVIE CLIPS ============================


===== START PRINT MOVIE CLIPS ============================
j:mc_demo_panel_7 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_7
j:mc_demo_panel_6 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_6
j:mc_demo_panel_5 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_5
j:mc_demo_panel_4 : _level0.pc_movie_loader.mc_holder_clip.mc_demo_pan el_4
===== END PRINT MOVIE CLIPS ============================

it's registering that all the movie clips have been created and the mc_demo_panel library item has been attached.

Any ideas why the first function call works and everyone after that doesn't?

Thanks,
Clem C
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
preloader for movie with attachSound FlashGuru Flash Wishlist and Bugs 1 07-16-2008 05:23 AM
Buttons ... damned BUTTONS gooup Flash 8 3 10-15-2006 12:31 AM
Loading swf into holder movie gp_330 Newbies 3 02-01-2006 05:43 AM
Dynamically Import and Attach AS to Movie Clips thebeige Flash MX ActionScript 2 09-26-2003 03:57 AM
preloading plankd Newbies 4 08-25-2000 11:15 AM




All times are GMT. The time now is 08:49 PM.