ImageBvr pics[] = {
importImage(buildURL(imgBase, "phantom.jpg")),
importImage(buildURL(imgBase, "hiddenBeachSS.jpg")),
importImage(buildURL(imgBase, "hiddenBeachSG.jpg")),
importImage(buildURL(imgBase, "jotunheimen1.jpg")),
importImage(buildURL(imgBase, "redWoodCar.jpg")),
importImage(buildURL(imgBase, "wenatcheeCascades.jpg")),
importImage(buildURL(imgBase, "tulipsHol1.jpg")),
importImage(buildURL(imgBase, "tulipsHol2.jpg")),
importImage(buildURL(imgBase, "yosemiteCreek.jpg")),
importImage(buildURL(imgBase, "kidsUtah.jpg")),
importImage(buildURL(imgBase, "foliageUtah.jpg"))};
construct a corresponding array of behaviors |
ArrayBvr pictures = new ArrayBvr(pics);
ditto for corresponding labels |
StringBvr lbls[] = {
toBvr("Phantom Is., Crater Lk., Oregon"),
toBvr("Hidden Beach, Klamath, California"),
toBvr("Hidden Beach, Klamath, California"),
toBvr("Jotenheimen, Norway"),
toBvr("Redwoods N.P., California"),
toBvr("Wenatchee, Cascades, Washington"),
toBvr("Tulip Garden, Holland"),
toBvr("Tulip Garden, Holland"),
toBvr("Yosemite, California"),
toBvr("Centerville, Utah"),
toBvr("Bountiful, Utah")};
ArrayBvr lables = new ArrayBvr(lbls);
Construct a NumberBvr counter object, and use it as an interactive
index to select a picture and a corresponding lable. |
NumberBvr numPics = lables.length();
NumberBvr index = (NumberBvr) (new Counter(numPics)).getBvr().runOnce();
ImageBvr picture = (ImageBvr) pictures.nth(index);
StringBvr lable = (StringBvr) lables.nth(index);
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.