Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2002
    Location
    Ontario, Canada
    Posts
    183
    Thanks
    0
    Thanked 1 Time in 1 Post

    attachmovie load problem

    I can’t believe that I’m asking this. I have gotten this to work in the pass. So it seems that I am forgetting something, but what.
    Here is the code.

    Code:
    var text_count = 0;
    var text_spacing = 40;
    
    test_array = new Array();
    test_array[0] = "test1";
    test_array[1] = "test01";
    test_array[2] = "test2";
    test_array[3] = "test02";
    test_array[4] = "test3";
    test_array[5] = "test03";
    
    var array_length = test_array.length;
    
    
    DisplayTest();
    
    function DisplayTest(){
    for (var i=0; i<array_length; i++){
    var item_mc = test_movie.attachMovie(test_mov_btn,"item"+text_count, text_count);
    	item_mc._y = text_count * text_spacing;
    	text_count++;
    	item_mc.text_here.text = test_array[i];
    	}
    }
    test_movie is the instance name of the movie clip I want to load the test_mov_btn(that is what I call it in the linkage properties) movie clip into.

    Hoping someone can help.
    Attached Files Attached Files
    if ( atfirst != succeed)
    tryagain();

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    I don't think I've ever seen it used like that with var = mc.attachmovie, but I'm guessing this might be part of the issue. Does this work?

    Code:
    function DisplayTest(){
    for (var i=0; i<array_length; i++){
    test_movie.attachMovie(test_mov_btn,"item"+text_count, text_count);
    	test_movie._y = text_count * text_spacing;
    	text_count++;
    	test_movie.text_here.text = test_array[i];
    	}
    }
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #3
    Regular Coder
    Join Date
    Dec 2002
    Location
    Ontario, Canada
    Posts
    183
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks, but no.

    That doesn't work.
    if ( atfirst != succeed)
    tryagain();

  • #4
    Regular Coder
    Join Date
    Dec 2002
    Location
    Ontario, Canada
    Posts
    183
    Thanks
    0
    Thanked 1 Time in 1 Post
    I got it to work and I am so embarrassed I forgot the " " that go around the idName.

    This code now works
    Code:
    function DisplayTest(){
    for (var i=0; i<array_length; i++){
    var item_mc = test_movie.attachMovie("test_mov_btn","item"+text_count, text_count);
    	item_mc._y = text_count * text_spacing;
    	text_count++;
    	item_mc.text_here.text = test_array[i];
    	}
    }
    if ( atfirst != succeed)
    tryagain();

  • #5
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Nice, and great signature by the way. I'm glad to see someone else poking around the Flash forum a bit
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

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