-
if(i>$){i=:);}
Button actions not working for externally loaded jpgs????
Hi,
I wrote a function that loads an XML feed, creates blank MCs, and loads external jpgs into there places. It works fine but the button actions don't work for the loaded images??????
(on rollOver, onRollOut, onPress, arent working)
PLEASE PLEASE PLEASE help!
//Note: I wrote this code for a project in Player 8 AS 2, and this is Player 6 AS 1. Im think this might be the problem?
Code:
function getThumbs(type) {
//imageXML.load("xml_render.php?type="+type);
imageXML.ignoreWhite = true;
Ystacking = 0;
if (imageXML.loaded) {
var thumbDirectory = imageXML.firstChild.attributes.small;
var mainDirectory = imageXML.firstChild.attributes.big;
var ammountOfButtons = ((imageXML.firstChild.childNodes.length/2)-1);
for (var i = 0; i<=ammountOfButtons; i++) {
_root.thumbs.buttons.createEmptyMovieClip("button"+i, i+100);
loadMovie(url+thumbDirectory+imageXML.firstChild.childNodes[i].attributes.name, _root.thumbs.buttons["button"+i]);
_root.thumbs.buttons["button"+i]._x = 0;
Ystacking += Number(imageXML.firstChild.childNodes[(i-1)].attributes.thumbHeight);
_root.thumbs.buttons["button"+i]._y = (Ystacking);
_root.thumbs.buttons["button"+i].imageURL = mainDirectory+imageXML.firstChild.childNodes[i].attributes.name;
_root.thumbs.buttons["button"+i].fullWidth = Number(imageXML.firstChild.childNodes[i].attributes.fullWidth);
_root.thumbs.buttons["button"+i].fullHeight = Number(imageXML.firstChild.childNodes[i].attributes.fullHeight);
_root.thumbs.buttons["button"+i].onRollOver = function() {
this.color_shine(255, 255, 255, .09);
scrollSound = new Sound();
scrollSound.attachSound("scroll1");
scrollSound.start();
};
_root.thumbs.buttons["button"+i].onRollOut = function() {
this.undo_color_shine();
};
_root.thumbs.buttons["button"+i].onPress = function() {
newImage(this.imageURL, this.imageWidth, this.imageHeight);
_root.closeContentWin();
trace("!");
};
}
} else {
trace("XML Has Not Loaded");
}
thumbs.scrollToMouse(.09, 26, 5);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|