i have the following layers:
Gallery - containt mx.controls.load named art1Loader
Gallery Info - Dynamic Text Box named infoBox
Gallery Buttons - btn1
i have the following script within btn1
on(release){
art1Loader.contentPath = “images/artists/artist1/exam1.jpg”;
}
loadText = new loadVars();
loadText.load(“txt/art/artist1/TEXT1.txt”);
loadText.onLoad = function(success) {
if (success) {
// trace(success);
infoBox.html = true;
infoBox.htmlText = this.info;
}
};
}
i get the follwing errors:
Warning Symbol=Test Clip , layer=GaleryButtons, frame=2:Line 4: The identifier ‘loadVars’ will not resolve to built-in object ‘LoadVars’ at runtime.
loadText = new loadVars();
Error Symbol=Test Clip , layer=GaleryButtons, frame=2:Line 5: Statement must appear within on handler
loadText.load(“txt/art/artist1/TEXT1.txt”);
Error Symbol=Test Clip , layer=GaleryButtons, frame=2:Line 6: Statement must appear within on handler
loadText.onLoad = function(success) {
Error Symbol=Test Clip , layer=GaleryButtons, frame=2:Line 13: Unexpected ‘}’ encountered
}
Total ActionScript Errors: 4 Reported Errors: 4
Ok so im new to this somebody please help?
try
[AS]on (release) {
art1Loader.contentPath = “images/artists/artist1/exam1.jpg”;
loadText = new LoadVars();
loadText.load(“txt/art/artist1/TEXT1.txt”);
loadText.onLoad = function(success) {
if (success) {
// trace(success);
infoBox.html = true;
infoBox.htmlText = this.info;
}
};
}[/AS]
try
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#0000FF]on[/COLOR] [COLOR=#000000]([/COLOR]release[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
art1Loader.[COLOR=#000080]contentPath[/COLOR] = [COLOR=#FF0000]“images/artists/artist1/exam1.jpg”[/COLOR];
loadText = [COLOR=#000000]new [/COLOR] [COLOR=#0000FF]LoadVars[/COLOR]COLOR=#000000 [/COLOR];
loadText.[COLOR=#0000FF]load[/COLOR]COLOR=#000000 [/COLOR];
loadText.[COLOR=#0000FF]onLoad[/COLOR] = [COLOR=#000000]function [/COLOR]COLOR=#000000 [/COLOR] [COLOR=#000000]{[/COLOR]
if COLOR=#000000 [/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#808080]// trace(success); [/COLOR]
infoBox.[COLOR=#0000FF]html[/COLOR] = [COLOR=#000000]true [/COLOR];
infoBox.[COLOR=#0000FF]htmlText[/COLOR] = [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]info[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
superstar it works perfectly cheers