Mark Forums Read
  #1  
Old 09-17-2009, 01:43 AM
Gaberiel97 Gaberiel97 is offline
Junior Member
 
Join Date: Sep 2009
Posts: 1
Gaberiel97 is on a distinguished road
Default Dynamicaly loaded images help

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.
Reply With Quote
 #Add to Ads's Reputation  
OldSponsored Ads
Ads AdsPromoter is online
Member
 
Join Date: LongTime
Posts: 1100
Ads is on a distinguished road
Default New Sponsored Ads



This message will go away once you are registered. Also, by registering, you will have access to all post topics, communicate privately with other members (PM), respond to polls, upload graphics, and access other special features! Registration is fast, simple and absolutely free so please Click Here to join our Web Hosting community today!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:22 PM.


Powered by vBulletin Version 3.6.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.4.0