I just started messing with the flash remoting photo gallery example.
Im a little confused about action script. How do I tell it the
recordcount of the query to dynamically set the amount of images in the
photogalley?
Here is the action script provided by the example. I'd like to replace
the 5 where it says "if (whichPic<5)" with the recordcount from my
query. Any suggestions?
Emmet
// load NetServices lib
#include "NetServices.as"
#include "NetDebug.as"
// initialize variables and properties
whichPic = 1;
bload = true;
// upon clicking 'next', increment pic and set bLoad
next.onPress = function() {
if (whichPic<5) {
bLoad = true;
whichpic++;
}
}
// upon clicking 'prev', decrement pic and set bLoad
back.onPress = function() {
if (whichPic>1) {
bLoad = true;
whichpic--;
}
};
_root.onEnterFrame = function() {
if (bLoad) {
input = whichPic;
// make call to CF method, passing it dynamically
generated image number
directoryService.getSlide(whichPic);
bLoad = false;
}
};
// --------------------------------------------------
// Handlers for data coming in from server
// --------------------------------------------------
function getSlide_Result(resultRecordset) {
// pass "slidePath" variable returned by CF to loadMovie
function
loadMovie(resultRecordSet.slidePath, "square");
descriptionField = resultRecordSet.description;
// interface.text = resultRecordSet.description;
bLoaded = true;
}
// --------------------------------------------------
// Start up the application
// --------------------------------------------------
if (inited == null) {
// do this code only once
inited = true;
// set the default gateway URL (for use in authoring)
NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/ga
teway");
// connect to the gateway
gateway_conn = NetServices.createGatewayConnection();
// get a reference to the service
var serviceAddress = "users.frontiertown";
directoryService = gateway_conn.getService(serviceAddress,
this);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4