[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]