Me again, still looking for a solution in vain. I just want a working slideshow for each project, but I made the projects using a for loop, making it more confusing (was following a tutorial). The thing is, in the tutorial, the guy only had one picture up per project, I want many.
On my projects page(frame), I have Project Panels. Just regular blocks displaying a thumbnail image of the project, and when clicked, it opens up a “fullProjectPanel” from the main time line.
This is the code for the fullProjectPanel:
var fullProjectPanelMulti:FullProjectPanelMulti;
// ADD FULL PROJECT PANEL ( runs when clicking on project panel(2nd frame of mainContainer, line 28))
function addFullPanelMulti(o:Number):void {
fullProjectPanelMulti = new FullProjectPanelMulti;
fullProjectPanelMulti.title.text = projectTitleM[o]
fullProjectPanelMulti.info.text = projectInfoM[o]
fullProjectPanelMulti.content.text = projectContentM[o]
fullProjectPanelMulti.client.text = projectClientM[o]
fullProjectPanelMulti.media.text= projectMediaM[o]
fullProjectPanelMulti.technology.text = projectTechnologyM[o]
fullProjectPanelMulti.link.text = projectLinkM[o]
fullProjectPanelMulti.loadImage(projectImageM2[o]);
fullProjectPanelMulti.loadImage2(projectImageM3[o]);
TweenLite.from(fullProjectPanelMulti, 0.6, {alpha:0, delay:1.2});
addChild(fullProjectPanelMulti);
// indicate state
fullProjectPanelUpMulti=true;
}
Now, the loadImage and loadImage2 functions are present on the fullProjectPanelMulti movieclip itself, and the code is:
function loadImage(imagePath:String):void
{
var ldr:Loader = new Loader();
var url:String = imagePath;
var urlReq:URLRequest = new URLRequest(url);
ldr.x = -35;
ldr.y = 67;
ldr.load(urlReq);
addChild(ldr);
}
function loadImage2(imagePath:String):void
{
var ldr:Loader = new Loader();
var url:String = imagePath;
var urlReq:URLRequest = new URLRequest(url);
ldr.x = -35;
ldr.y = 67;
ldr.load(urlReq);
addChild(ldr);
}
I have a couple of questions. First, how can there be two “ldr” with the same name? Both display the pictures they’re supposed to, but they have the same name?
Is it because they’re confined to the function?
Secondly, I cannot manipulate the "ldr"s at all, seeing as they only exist within the function; how can I make it so I can change them around with properties like “ldr.visible = false” not in the function.
Also, I don’t know if this is relevant or not, but the code for accessing the XML file is:
var projectImageM:XMLList;
var projectImageM2:XMLList;
var xml:XMLLoader = new XMLLoader(this,“data.xml”);
// FUNCTION THAT GETS CALLED FROM CLASS WHEN XML IS LOADED
function getXML(xmlData:XML):void {
[TABLE=“class: mceItemTable”]
[TR]
[TD][/TD]
[TD]projectImageM = xmlData.projectsM.project.image_path;[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]projectImageM2 = xmlData.projectsM.project.image_path2;[/TD]
[/TR]
[/TABLE]
}
I’m sorry this is long, but I really have no idea what to do ._., any help at ALL would be appreciated. Thanks.