loadClip Problem (may need GURU)

[LEFT]
I’ll tell you right now that this is probably a Guru Level Problem.

I’m trying to dynamically load in an image using XML file to give me the location.
Once the image is loaded i need to resize it to fit within the constraints of my flash file.
So what i have to use is loadClip and not the loadMovie method. See the below script for insight into code complexity.

Since i’m trying to load the image which is based off the XML, i’m calling the attach script below directly, using the XML information that i stored in an object as reference.


static private function loadPanelData():Void
    {
        //first for loop access top menu tags
        for(var i=0;i<__objXMLData.length;i++)
        {
                        //secound for loop accesses sub menu tags
            for(var j=0; j<__objXMLData*.submenu.length; j++)
            {
                                //if a sub menu object exists then create a new menu item
                if(__objXMLData*.submenu[j].name!=undefined)
                {
                    __aPaneList*[__sSidePanel].attachMovie("SubMenuButton","SubMenuButton"+j,__aPaneList*[__sSidePanel].getNextHighestDepth());
                    //offset the menu items location
                    __aPaneList*[__sSidePanel]["SubMenuButton"+j]._y = 75+(j* __aPaneList*[__sSidePanel]["SubMenuButton"+j]._height);
                    __aPaneList*[__sSidePanel]["SubMenuButton"+j]._x = 25;
                                        //assign the textbox text
                    __aPaneList*[__sSidePanel]["SubMenuButton"+j].content.text = __objXMLData*.submenu[j].name;
                                        //create another movieclip that will house the rest of the data.
                                        __aPaneList*[__sMainPanel].createEmptyMovieClip("SubMenuButton"+j,__aPaneList*[__sMainPanel].getNextHighestDepth());

//----------------------------- REFLECT -------------------------------//
//if you've understood the data and the methodology used up until this point then the next step should be understandable and there may be a possibility of understanding potential problems.

                                        //Create a third loop that is used to attach images based off of location strings.
                    for(var k=0;k<__objXMLData*.submenu[j].image.length&&__objXMLData*.submenu[j].image.length!=undefined;k++)
                    {
                        //make sure that there is a string
                        if(__objXMLData*.submenu[j].image[k]!= undefined)
                        {
                                                        //create an empty movieclip to house the picture.
                            __aPaneList*[__sMainPanel]["SubMenuButton"+j].createEmptyMovieClip(k,__aPaneList*[__sMainPanel]["SubMenuButton"+j].getNextHighestDepth());

                                                        //load the picture. IT WORKS...
                                                        //I need to know when the picture is loaded to be able to change the width and height parameters.
                            __aPaneList*[__sMainPanel]["SubMenuButton"+j][k].loadMovie(__objXMLData*.submenu[j].image[k]);
                                                        //Which means that i haven't found a way to use the loadClip method. 

what i have to do is use a MovieClipLoader. Call the same picture string pass in the object and then use another object to call a onLoadComplete function or the like… but its within a loop so it needs to be dynamic and readily able to be modified. so i need an array if movieClipLoaders and Objects…

Whenever i’ve tried it they’ve all failed one way or another always returning false or undefined.

Any help and solutions would be much appreciated.

Sincerely Yours,
Benjamin Stern.
[/LEFT]

so instead of

__aPaneList*[__sMainPanel]["SubMenuButton"+j].createEmptyMovieClip(k,__aPaneList*[__sMainPanel]["SubMenuButton"+j].getNextHighestDepth());

i’ve inserted


aLoadMovie*[j][k] = new MovieClipLoader();
							
aLoadMovie*[j][k].loadClip(__objXMLData*.submenu[j].image[k], __aPaneList*[__sMainPanel]["SubMenuButton"+j][k]);

which returns false with the first clip and undefined with the secound.

but it still doesn’t work…

erm thats the most craziest code I’ve seen, but I’m not a guru

what is the advantage of “object” coding compared to coding it normally :stuck_out_tongue:

private variables are preceded by __ as a sort of mental note that i shouldn’t try to be accessing them from a different class.

I do thank you guy’s for taking a look at it and i do apologize for the high level programming methods, they are pretty complex at first glance but they become a very powerful tool.

I store it in an object to be able to access later rather then having to break down the xml structure again (which is something i don’t necessarily like doing) it’s also easier to use in for loops and the such.

absolute sillyness…


aLoadMovie*[j][k].loadClip(__objXMLData*.submenu[j].image[k], __aPaneList*[__sMainPanel]["SubMenuButton"+j][k]);//origional
 
aLoadMovie*[j][k].loadClip(new String(__objXMLData*.submenu[j].image[k]), __aPaneList*[__sMainPanel]["SubMenuButton"+j][k]);//tried and failed
 
aLoadMovie*[j][k].loadClip(""+__objXMLData*.submenu[j].image[k]+"", __aPaneList*[__sMainPanel]["SubMenuButton"+j][k]);// this one worked????

i got it to work but, it doesn’t make complete sense. the secound and third methods should have functioned in the same manner having the same effect.

i finally isolated the problem. any additional q’s don’t hesitate to ask… heh

BNNS