lundi 29 février 2016

Remove movieClips using array list?

I've a array of list and created image place holder with the array objects name (Example: myArray[a,b]) and loaded images from there, having array list as folder name. And finally created a movieClip to load on them and display in stage.

Now I want to remove them calling the same array list.

Need help here...

My code below:

for (var l: int = 0; l < ListArray.length; l++) {

    var BookName: MovieClip = new bookThumb();

    trace("\n[" + l + "]: " + ListArray[l]);
    ImageFoldername = ListArray[l];
    var bookImagePath: String = "file://" + File.userDirectory.nativePath.toString() + "/Books/" + ImageFoldername + "/Images/Icon.png";
    trace(bookImagePath);

    var ImagePlacer: Loader = new Loader;
    var ImageURL: URLRequest = new URLRequest(bookImagePath);

    ImagePlacer.load(ImageURL);


    BookName.addChild(ImagePlacer);
    BookName.name = ImageFoldername

    addChild(BookName)

    BookName.x = FirstBook_x;
    BookName.y = FirstBook_y;
    BookName.buttonMode = true;
    BookName.mouseChildren = false;
    BookName.addEventListener(MouseEvent.CLICK, IconSelected);
    BookName.alpha = .8
    BookName.addEventListener(MouseEvent.MOUSE_OVER, IconMouseOver);
    BookName.addEventListener(MouseEvent.MOUSE_OUT, IconMouseOut);

    FirstBook_x = FirstBook_x + 250;

}

Aucun commentaire:

Enregistrer un commentaire