dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Calling a Movie Clip Dynamically

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    7

    Calling a Movie Clip Dynamically

    Hey everyone, thanks in advance for the help. I'm looking to do something fairly simple, but can't seem to figure it out.

    I want to set a whole bunch of movie clips to a certain position, all at once. However I seriously do not want to type each movie clip name individually. So I'm trying to do something like so.

    The movie clips are named c1 through c10.

    Code:
    on(press)
    {
    	
    	for (i=1;i<=10;i++)
    	{
    	Test="c"+String(this.i);
    	
    	_root.Test.gotoAndStop(2);
    	}
    		
    
    }
    Thank you again for the help

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    on (press) {
    	for (var i = 1; i<=10; i++) {
    		_root["c"+i].gotoAndStop(2);
    	}
    }

  3. #3
    Junior Member
    Join Date
    Jun 2010
    Posts
    7
    THANK YOU! I could kiss you!

  4. #4
    Junior Member
    Join Date
    Jun 2010
    Posts
    7
    N/m
    Last edited by seterwind; 07-01-2010 at 03:49 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center