Hey there, Im kind of new to designing websites but I am learning fast. I have started putting together a flash based website to present my works. I am dynamically loading thumbnails and the larger companions using an XML file. Everything seems to work fine on my comp but when I upload it to my host sever the larger images do not want to load and on occasion a page of thumbnails doesnt want to load.
my adress is
www.jart.tk.
also the code im using only places one image atop another, so when I click on a thumbnail it will place the larger image on top of the last it does not take the previouse one away. which can be a problem if one image is smaller than the last. or if I wanted to load movie clips.
I realize that this probably isnt the best way of doing things but I have not found any tutorials or anything that really allows me to understand what's going on and allows me to adjust things so I can make them happen the way I want.
here is the AS of one page.
import fl.transitions.Tween;
import fl.transitions.easing.*;
//XML Trails stuff
//var to hold Tween;
var fadeTweenPhotoP1:Tween
// Creating image txtfield
var imageTextPhotoP1:TextField = new TextField();
// Instance of loader class
var imageLoaderPhotoP1:Loader;
// Holds XML data
var xmlPhotoP1:XML;
//creates XML list object
var xmlListPhotoP1:XMLList;
// sets the loader
var xmlLoaderPhotoP1:URLLoader = new URLLoader();
//Loads xmlfile
xmlLoaderPhotoP1.load(new URLRequest("Images/xml/photoPage1.xml"));
// Eventlistner to see when xml files is loaded
xmlLoaderPhotoP1.addEventListener(Event.COMPLETE, xmlLoadedPhotoP1);
//define xml loaded function
function xmlLoadedPhotoP1(event:Event):void
{
xmlPhotoP1 = XML(event.target.data);
xmlListPhotoP1 = xmlPhotoP1.children();
// Loop to load all thumnails
for(var i:int = 0; i < xmlListPhotoP1.length(); i++)
{
imageLoaderPhotoP1 = new Loader();
imageLoaderPhotoP1.load(new URLRequest(xmlListPhotoP1[i].attribute("thumb_P1")));
imageLoaderPhotoP1.x = i * 60 + 203;
imageLoaderPhotoP1.y = 596;
imageLoaderPhotoP1.name = xmlListPhotoP1[i].attribute("main_P1");
addChild(imageLoaderPhotoP1);
// Loading main image listning for mouse click
imageLoaderPhotoP1.addEventListener(MouseEvent.CLI CK, showPicturePhotoP1);
}
}
function showPicturePhotoP1(event:MouseEvent):void
{
imageLoaderPhotoP1 = new Loader();
imageLoaderPhotoP1.load(new URLRequest(event.target.name));
imageLoaderPhotoP1.x = 246;
imageLoaderPhotoP1.y = 200;
addChild(imageLoaderPhotoP1);
//Position of text field
imageTextPhotoP1.x = 246;
imageTextPhotoP1.y = 180;
//Loop to see all nodes if source of nodes matches the event.target.name
for(var j:int = 0; j < xmlListPhotoP1.length(); j++)
{
if(xmlListPhotoP1[j].attribute("main_P1") == event.target.name)
{
imageTextPhotoP1.text = xmlListPhotoP1[j];
}
}
fadeTweenPhotoP1 = new Tween(imageLoaderPhotoP1, "alpha", None.easeNone,0,1,1,true);
}
//Auto size text field
imageTextPhotoP1.textColor = 0xFFFFFF;
imageTextPhotoP1.autoSize = TextFieldAutoSize.LEFT
addChild(imageTextPhotoP1);
if one of the XML pages code is needed to plz let me know.
Many thanks for any help or suggestions.