var lolXMLML = new XML(); lolXML.ignoreWhite = true; lolXML.load("lol.xml"); lolXML.onLoad = function(success) { if (success) { var images = lolXML.firstChild.childNodes;
var maxThumbsPerRow = 6; var thumbWidth = Stage.width/(maxThumbsPerRow + 0);//change 0 value to alter spacing var thumbheight = Stage.height/(maxThumbsPerRow + 0); var maxResults:Number = 18; var thumbx:Number = 0; var thumby:Number = 350;
for (i=0; i<images.length; i++) { var imageNum = i+1; var imageName = images[i].attributes.name; var imageURL = images[i].firstChild.nodeValue;
trace("image number: "+imageNum+" is titled: "+imageName+" and the URL is "+imageURL);
} for (var photoIndex:Number = 0; photoIndex<images.length && photoIndex<maxResults; photoIndex++) { var photoNodeMLNode = images[photoIndex];
var thumbnail:MovieClip = attachMovie("thumb1", "thumb1"+photoIndex, getNextHighestDepth());
var lolXMLML = new XML(); lolXML.ignoreWhite = true; lolXML.load("lol.xml"); lolXML.onLoad = function(success) { if (success) { var images = lolXML.firstChild.childNodes;
var maxThumbsPerRow = 6; var thumbWidth = Stage.width/(maxThumbsPerRow + 0);//change 0 value to alter spacing var thumbheight = Stage.height/(maxThumbsPerRow + 0); var maxResults:Number = 18; var thumbx:Number = 0; var thumby:Number = 350;
for (i=0; i<images.length; i++) { var imageNum = i+1; var imageName = images[i].attributes.name; var imageURL = images[i].firstChild.nodeValue;
trace("image number: "+imageNum+" is titled: "+imageName+" and the URL is "+imageURL);
} for (var photoIndex:Number = 0; photoIndex<images.length && photoIndex<maxResults; photoIndex++) { var photoNodeMLNode = images[photoIndex];
var thumbnail:MovieClip = attachMovie("thumb1", "thumb1"+photoIndex, getNextHighestDepth());
New deals posted everyday, starting Black Friday and running through the holiday season! No hassles, no lines - just awesome savings on art, deviantWEAR, Premium Memberships and more!
Daily Literature Deviations is a group that is dedicated to bringing literature to the forefront of the deviantArt community. We attempt to accomplish this by daily featuring Literature artists from around the community that deserve the recognition, but are not getting it.
Each day we will feature 5 deviations from the Literature categories in a News Article. In order to support the artists that we feature, we ask that you the news article as well as check out the individual pieces. We understand that each day you may not be able to check out each and every one of the pieces, everyone has their own things going on. We just ask that you make an attempt to help support the growing Literature community.
^Ikue has been a devious member of our community for almost 7 years and in this time he has proven to be nothing short of dedicated and devoted. Whilst volunteering his time over the last 22 months as a Gallery Moderator within the Community Relations Team, Chris has brought the Vector gallery and many vector artists directly into the spotlight. ^Ikue's commitment to the community is evident in everything he touches and you can always find him reaching out to others with an encouraging word. Chris is a natural leader with a vibrant and empathic personality, and is a role model for deviants everywhere. It's ev... Read More
could someone check it out???
everything works up until the imageLoaded function and the ouput also displayes this:
Error opening URL 'file:///G|/UNIVERSITY/Professional%5FPortfolio/Portfolio/images/image1.jpg'
how do i fix this, so it grabs the images
i've placed traces to make sure various parts of coding flow through.
in imageLoaded my traces show outputs of undefined basically
to test this you will need to create a movieclip "thumb1" with a square in it and export for actionscript
the layout will look like this:
[0] [1] [2] [3] [4] [5]
[6] [7] [8] [9] [10][12]
[13][14][15][16]
/////////////////Actionscript Code////////////////////////
if (thumbnails == undefined) {
thumbnails = [];
} else {
for (var i:Number = 0; i<thumbnails.length; i++) {
thumbnails[i]._alpha = 100;
}
}
var lolXML
lolXML.ignoreWhite = true;
lolXML.load("lol.xml");
lolXML.onLoad = function(success) {
if (success) {
var images = lolXML.firstChild.childNodes;
var maxThumbsPerRow = 6;
var thumbWidth = Stage.width/(maxThumbsPerRow + 0);//change 0 value to alter spacing
var thumbheight = Stage.height/(maxThumbsPerRow + 0);
var maxResults:Number = 18;
var thumbx:Number = 0;
var thumby:Number = 350;
for (i=0; i<images.length; i++) {
var imageNum = i+1;
var imageName = images[i].attributes.name;
var imageURL = images[i].firstChild.nodeValue;
trace("image number: "+imageNum+" is titled: "+imageName+" and the URL is "+imageURL);
}
for (var photoIndex:Number = 0; photoIndex<images.length && photoIndex<maxResults; photoIndex++) {
var photoNode
var thumbnail:MovieClip = attachMovie("thumb1", "thumb1"+photoIndex, getNextHighestDepth());
thumbnail._y = thumby;
thumbnail._x = thumbx+(thumbWidth/2);
thumbnail.title = [link];
thumbnails.push(thumbnail);
thumbx += thumbWidth;
if ((photoIndex+1)%maxThumbsPerRow == 0) {
thumbx = 0;
thumby += thumbWidth;
}
// Week 7 code:
var imageXML = new XML();
imageXML.ignoreWhite = true;
imageXML.onLoad = imageLoaded;
trace (photoNode.firstChild.nodeValue);
var pics = photoNode.firstChild.nodeValue;
imageXML.thumbnail = thumbnail;
imageXML.load(pics);
}
} else {
trace("the STUPID images aren't loading");
}
};
function imageLoaded(success
var thumbnailSize
var thumbnailURL:String = thumbnailSize.attributes.nodeValue;
trace("hello " + this.firstChild.firstChild)// output = hello undefined
trace(this.thumbnail.image)// output = undefined
trace(thumbnailURL);
this.thumbnail.createEmptyMovieClip("image",this.thumbnail.getNextHighestDepth());
var loader:MovieClipLoader = new MovieClipLoader();
var loadListener = new Object();
loadListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number) {
target_mc._x -= target_mc._width/2;
target_mc._y -= target_mc._height/2;
};
loader.addListener(loadListener);
loader.loadClip(thumbnailURL,this.thumbnail.image);
}
hope u enjoy it, cause its been rattling my brain