...

View Full Version : attachmovie load problem



Frank
06-12-2009, 03:24 PM
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.



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.

gnomeontherun
06-12-2009, 09:34 PM
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?


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];
}
}

Frank
06-12-2009, 10:03 PM
Thanks, but no.

That doesn't work.

Frank
06-15-2009, 09:41 PM
I got it to work and I am so embarrassed I forgot the " " that go around the idName.

This code now works


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];
}
}

gnomeontherun
06-15-2009, 11:12 PM
Nice, and great signature by the way. I'm glad to see someone else poking around the Flash forum a bit :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum