flash data integration:
1. What does the reloadSlides function do? That seems to be the one needed
to evaluate.
2. May not be the problem, but be sure the load method follows the onLoad
handler in your code in both places. It is possible load could complete
before the line is reached and thus the code for the onLoad event does not
get processed resulting in random failed results.
--
Lon Hosford
www.lonhosford.com May many happy bits flow your way!
[quoted text, click to view] "TwistedTwig" <webforumsuser@macromedia.com> wrote in message
news:dlr76s$ar$1@forums.macromedia.com...
hey all,
i am having an odd problem. I dont understand why it dont work (well der
otherwise why would i be positng). Right.. well i am creating a dynamic
photo
gallery. The basics of it work well. The combo box is dynamically loaded
from
a php script that calls the MySQL DB and returns it in a string.... sorry
if i
am a bit slow and explaining every strep but only just learnt the loadVars
bit
today.
The pictures are also loaded into flash through the same style. (different
loadVars() thingy).. this works great the first time. but what i want to do
is
when they select an option on the combo box it requiries the DB through the
php
script and loads the new pictures up.
I know the php script works as i build a quick html page to check the post
and
it does return only the required pictures when there is something in the
post,
and when there isnt it returns them all.
but nothing is (seems) to be reloaded. i am not understanding where it is
going wrong. any suggestions plz? I am hoping from looking at that the
problem
will be visible. i am sure thats where the problem lies as i tested the php
script on its own.
Thank you for your help in advance.
Twiggy:o
//loads in the combo box options
headerLoader = new LoadVars();
headerLoader.load("headers.php");
headerLoader.ref = this;
headerLoader.onLoad = function(success) {
if(success) {
for(var i=0; i < this.EOF; i++) {
picid = this["catid"+i];
name = this["name"+i];
headers.addItem(name,picid);
}
}
headers.rowCount = 10;
}
//loads in the pictures
slideLoader = new LoadVars();
slideLoader.load("slides.php");
slideLoader.ref = this;
slideLoader.onLoad = loadSlides;
//in theory this should reload the pictures when combo box is used
function reloadSlides(searchString) {
slideLoader.search = searchString;
slideLoader.sendAndLoad("slides.php",this,"POST");
slideLoader.onLoad = loadSlides;
}
function loadSlides(success) {
if(success) {
for(var i=0; i < this.EOF; i++) {
urlss = this["URL"+i];
widthss = this["height"+i];
heightss = this["width"+i];
commentsss = this["comments"+i];
namess = this["name"+i];
slideNode = new Array();
slideNode[0] = urlss;
slideNode[1] = heightss;
slideNode[2] = widthss;
slideNode[3] = commentsss;
slideNode[4] = namess;
slides[i] = slideNode;
}
}
else {
picName.text = "fuckup";
}
startSlideShow();
}
// Show the first slide and intialize variables
function startSlideShow() {
_global.max = slides.length;
totalPicsNum.text = _global.max;
_global.index = 0;
picNum.text = _global.index+1;
updateSlide(_global.index);
}
//
// Updates the current slide with new image and text
function updateSlide(pointer) {
node = slides[pointer];
imagePath = node[0];
picName.text = node[4];
picComment.text = node[3];
imgwidth = Number(node[2]);
imgheight= Number(node[1]);
loadMovie(imagePath, targetClip);
var x = ((((100-((imgwidth/swidth)*100)) / 2 ) / 100) * swidth);
var y = ((((100-((imgheight/sheight)*100)) / 2 ) / 100) * sheight) + 18;
_root.targetClip._x = x;
_root.targetClip._y = y;
testButtons();
picName = slides.length;
}
//combo box code
on(change) {
reloadSlides(this.value);
}