I need help! Can't seem to figure out how to update the captions in my imageViewer

I am creating an image viewer in which needs to update photos and update captions with next and previous features. I got the next, previous and image update to work. However, I am stuck on the captions. This is my code:
I have a main.as:
public class Main extends Sprite
private var _iv:ImageViewer;
private var _pictureList:Array;
private var _currentPicture:int;
private var _xmlData:XML;
public function Main()
var urlLoader:URLLoader=new URLLoader();
urlLoader.load(new URLRequest("xml/imageload.xml"));
urlLoader.addEventListener(Event.COMPLETE, onParse);
_iv=new ImageViewer();
_iv.path="images/";
_iv.imageList=["dogs1.jpg", "dogs2.jpg", "dogs3.jpg"];
_iv.display();
_iv.x = 110;
_iv.y = 10;
this.addChild(_iv);
var imageCaption:tfCaption = new tfCaption();
imageCaption.x = 140;
imageCaption.y = 350;
this.addChild(imageCaption);
var nextImage:NextButton = new NextButton();
nextImage.x = 445;
nextImage.y = 350;
nextImage.buttonMode = true;
this.addChild(nextImage);
nextImage.addEventListener(MouseEvent.CLICK, onNext);
var prevImage:PreviousButton = new PreviousButton();
prevImage.x = 105;
prevImage.y = 350;
prevImage.buttonMode = true;
this.addChild(prevImage);
prevImage.addEventListener(MouseEvent.CLICK, onPrev);
private function onParse(e:Event):void
_pictureList=[];
_xmlData= XML(e.target.data);
for each(var pic:XML in _xmlData.pic)
var vo:PicVO=new PicVO();
vo.file = pic.file;
vo.caption = pic.caption;
_pictureList.push(vo);
var _currentPicture:int = 0;
private function onNext(e:MouseEvent):void
_iv.next();
private function onPrev(e:MouseEvent):void
_iv.previous();
i have a imageLoader.as:
public class ImageLoader extends EventDispatcher
private var _xmlData:XML = XML("xml/imageload.xml");
private var ld:Loader;
public function ImageLoader(file:String)
super();
ld = new Loader(); //creates new Loader instance
ld.load(new URLRequest(file)); //requests new file to load
ld.contentLoaderInfo.addEventListener(Event.COMPLE TE, onLoad); //listens for loader to finish loading (xml)
private function onLoad(e:Event):void //onLoad function
var evt:ImageEvent = new ImageEvent(ImageEvent.IMAGE_LOADED); //
evt.image = e.target.content; //image is the current content
dispatchEvent(evt); //dispatches ImageEvent to find out if image finished loading
ld.contentLoaderInfo.removeEventListener(Event.COM PLETE, onLoad); //stop listening
ld.unload(); //stop loading process
ld = null;
i have a imageViewer.as:
public class ImageViewer extends Sprite
private var _imageList:Array;
private var _path:String;
private var _currentImage:int;
private var _ld:ImageLoader;
public function ImageViewer()
super();
init(); //runs the init function
private function init():void //init functionx
_imageList=[]; //creates instance of the array
_currentImage=0; //creates starting point for current image or image 1(0) used for validation
private function loadImg():void //loadImg function
_ld=new ImageLoader(_path+_imageList[_currentImage]); //loads current image
_ld.addEventListener(ImageEvent.IMAGE_LOADED, onLoad); //listens for image to finish loading
private function onLoad(e:ImageEvent):void //onLoad function
if(this.numChildren>0) //if there is a picture on the stage
this.removeChildAt(0); //takes that image off stage
this.addChild(e.image); //adds new image
public function display():void //display function
loadImg(); //runs the loadImg function
public function next():void //next function - goes to next photo
_currentImage++; //moves to next image in the array
if (_currentImage==_imageList.length)
_currentImage=0; //validates new image
_ld=new ImageLoader(_path+_imageList[_currentImage]); //loads image
_ld.addEventListener(ImageEvent.IMAGE_LOADED, onLoad); //listens for image to load
public function previous():void //goes to previous image
_currentImage--;
if (_currentImage<0)
_currentImage=_imageList.length-1; //validates image and moves back one
_ld=new ImageLoader(_path+_imageList[_currentImage]);
_ld.addEventListener(ImageEvent.IMAGE_LOADED, onLoad);
public function set path(value:String):void
_path=value;     //setting the path to its variable(value) - file path
public function set imageList(value:Array):void
_imageList=value; //setting the array to its variables(values)
an imageEvent.as:
public class ImageEvent extends Event
public static const IMAGE_LOADED:String = "image_loaded";
public var image:Bitmap;
public function ImageEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
super(type, bubbles, cancelable);
public override function clone():Event
return new ImageEvent(type, bubbles, cancelable);
a picVO (value object):
public class PicVO
public var file:String;
public var caption:String;
public function PicVO()
my xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<images>
<pic>
<file>dogs1.jpg</file>
<caption>Scrappy and Akiva snuggled up</caption>
</pic>
<pic>
<file>dogs2.jpg</file>
<caption>Scrappy being a cutie pie!</caption>
</pic>
<pic>
<file>dogs3.jpg</file>
<caption>Bella and Scrappy playing</caption>
</pic>
</images>
Can anyone help me?
Many thanks in advance!

is there more than one _xmlData.pic.caption node in your xml?
if yes, the following should be tracing more than one caption:
for each(var pic:XML in _xmlData.pic)
var vo:PicVO=new PicVO();
vo.file = pic.file;
vo.caption = pic.caption;
trace(pic.caption);
_pictureList.push(vo);
if it does not, you probably have a malformatted xml.
if you can't easily find the problem, copy and paste your xml.

Similar Messages

  • I have Photoshop CS6.  I recently purchased a Nikon D750.  I can't seem to figure out how to update my version to read raw files.  I am not computer illiterate, but not a IT wiz either.  I have a pc with windows 7.

    I have Photoshop CS6.  I recently purchased a Nikon D750.  I can't seem to figure out how to update my version to read raw files.  I am not computer illiterate, but not a IT wiz either.  I have a pc with windows 7.

    Have you updated Camera Raw to 8.7?
    Camera Raw plug-in | Supported cameras
    Camera Raw plug-in installer

  • Can't seem to figure out how to get the signature to work correctly

    I am having trouble getting Digital Signatures to work on a PDF. This is the first time that I have ever tried to use them, and the first time that I used Lifecycle to convert a form instead of just building it one field at a time in Acrobat Pro.
    In the past, I have gotten several PDF's that required signing. It seemed like an easy process, I clicked on the signature to sign it and then the email button to submit. The first time I did it before I had a signature, it walked me through the process of getting one set up, that was easy too.
    Now, I need one, and all of the sudden, it doesn't seem so easy any more.
    I have the CS3 Design suite with Acrobat Pro 8.0
    I did the layout in InDesign, and the form conversion in Lifecycle. The signature fields were added there automatically, all looked good so far.
    I open the file in Reader 9.0 and am unable to add a signature. I made sure that Reader 9.0 knew where my signature file was, but no matter what I do the document sign options are all greyed out.
    I opened the form in Acrobat 8 and it will let me sign, but I have to immediately save/as or the signature doesn't take. I have to save it save/as twice because there are two signatures.
    I figured there was some rights setting wrong, but can't find it. I have searched for signature, but can't seem to find a post that applies to my problem.
    This is driving me crazy. This shouldn't be that difficult. I am missing something here.
    Can anybody here shed some light on this?
    Thanks,
    Kirk

    To enable the form to be signed in Reader you will need to open the form in Acrobat; goto Advanced>Enable Usage Rights and then save this copy of the form for sending out to the users.
    The user should then be able to edit and digitally sign the form. They can then email the signed/saved pdf as a browsed for attachment or via the email icon in the toolbar. Note - if you have created an email submit button on the form, then unless they have Acrobat they could only return an xml file.
    The other way to do this however is to create a dataset by 'distributing' the form. This time the Email Return button will send back a full version of the form. During the distribution setup you will have the option to email the form directly or to save it and send it later,so you can send to users as and when or even post it to a website or intranet.
    When you receive and open the returned form it will ask whether you want to add it to the predetermined dataset (or if you want to categorise the returns into geographical areas for example, you could create new additional datasets at this point). If the form is data heavy however, the dataset will become very large and unwieldy pretty quickly, but you can export the data from it (including signatures) in xml format and import this into an Excel spreadsheet.
    To simplify the Excel xml import process I'd recommend you carefully structure your form in the hierarchy (LiveCycle) into the order you would want the data items to appear in your spreadsheet and switch off those data items that you will not need by setting the default binding for the irrelevant fields to "None".
    Clear as mud? Hope this helps.

  • I can't seem to figure out how to update BIOS...

    I have a MSI K9VGM-V motherboard running BIOS v1.6 I upgraded my BIOS before with the flash utility but now I can't find one and the live update will not work on my system..
    If someone could link me to the latest BIOS to my board with the utility I would be grateful! I found one but unfortuntely the .exe flash utility is not opening so it must not be a good source.

    Svet's question is a very good one...
    Do NOT update the bios if you experience any compatibility isues, bsod or crashes. In that case: troubleshoot!
    Do NOT update the bios because there is a new one. New is not always better, it may even make things worse for you.
    Do NOT update the bios using the .exe you are looking for.
    Do NOT update the bios using LiveUpdate.
    those are the DON'Ts. Let's go to the DOs:
    Do update if you are planning to install a new cpu that needs a newer bios revision.
    Do update if you experience a problem that can only be solved by a new bios revision.
    And finally... >>Use the MSI HQ Forum USB flasher<<

  • I want to download my itunes library to my shuffle. can't seem to figure out how to do this. can you help me?

    I want to download my itunes library to my shuffle. Can't seem to figure out how to do this. Can anybody help?

    You probably need to set up automatic syncing.  Select the shuffle in iTunes.  You see a row of "tabs" (buttons) starting with Summary.  Click on Music next to Summary.  This is the iPod's Music tab, where you tell iTunes how to sync songs to the shuffle.
    Check the box for Sync Music.  If your iTunes music library is small enough to fit on the shuffle, you can choose to sync Entire music library.  Then click Apply.
    Otherwise, you can choose to sync Selected playlists, artists, albums, and genres, then select (checkmark) the playlists, artists, albums, and/or genres that you want on the shuffle, from the lists below.
    Here's one convenient way to set it up.  In your iTunes library, create a new regular playlist; call it something like "iPod Songs" (or whatever you want).  From your iTunes music library, load that iPod Songs playlist with ALL the songs you want on the shuffle.  On the shuffle's Music tab, find and checkmark that iPod Songs playlist (under Playlists).  When you click Apply, those songs sync to the shuffle.  Going forward, to update songs on the shuffle, just update that iPod Songs playlist in iTunes (add and/or remove songs) and then connect your shuffle.  iTunes automatically updates the shuffle with the same changes.  If the iPod is already connected, click the Sync button to update the iPod.
    If you have any specific question, please post back.

  • HT5557 Using IBook, I can't seem to figure out how to insert a blank page inbetween pages that are already set up, like if you want to add some pictures or something.  Anyone have any tips on this?  Thanks, Mark

    Using IBook, I can't seem to figure out how to insert a blank page inbetween pages that are already set up, like if you want to add some pictures or something.  Anyone have any tips on this?  Thanks, Mark

    To enable the form to be signed in Reader you will need to open the form in Acrobat; goto Advanced>Enable Usage Rights and then save this copy of the form for sending out to the users.
    The user should then be able to edit and digitally sign the form. They can then email the signed/saved pdf as a browsed for attachment or via the email icon in the toolbar. Note - if you have created an email submit button on the form, then unless they have Acrobat they could only return an xml file.
    The other way to do this however is to create a dataset by 'distributing' the form. This time the Email Return button will send back a full version of the form. During the distribution setup you will have the option to email the form directly or to save it and send it later,so you can send to users as and when or even post it to a website or intranet.
    When you receive and open the returned form it will ask whether you want to add it to the predetermined dataset (or if you want to categorise the returns into geographical areas for example, you could create new additional datasets at this point). If the form is data heavy however, the dataset will become very large and unwieldy pretty quickly, but you can export the data from it (including signatures) in xml format and import this into an Excel spreadsheet.
    To simplify the Excel xml import process I'd recommend you carefully structure your form in the hierarchy (LiveCycle) into the order you would want the data items to appear in your spreadsheet and switch off those data items that you will not need by setting the default binding for the irrelevant fields to "None".
    Clear as mud? Hope this helps.

  • I am running OS 10.5.8 along with ipoto 6. i can't seem to figure out how to upgrade. i can't upgrade to 11 but what can i do??

    i need to upgrade my iphoto on my intel based imac. running 10.5.8. can't seem to figure out how to upgrade this iphoto. i also have a new macbook on which this version of iphoto won't open. the macbook is running 10.6.7. what can i do to run iphoto on both machines??

    iLife 11 and iPhoto 9 require  OS X10.6.3 as a minimum.  So you will need to upgrade your iMac to Leopard or Snow Leopard and then purchase iPhoto 11 from the App Store.  If you can find a copy of iLife 11 somewhere you'll get all of the latest iApps.
    You're new MBP should be running iPhoto 11 and the other iLIfe 11 apps.
    OT

  • I am trying to download photoshop presets from online but can't seem to figure out how to open them in photoshop. They download sucessfuly and then goes to my download folder on my computer, from there I double click on the file and photoshop opens and th

    I am trying to download photoshop presets from online but can't seem to figure out how to open them in photoshop. They download sucessfuly and then goes to my download folder on my computer, from there I double click on the file and photoshop opens and then nothing happens, any ideas? I am using a PC

    This video is a great step by step tutorial.
    Photoshop: How to Download & Install New Brushes & other Presets - YouTube
    Gene

  • I just downloaded the new itunes and i cant figure out how to update the apps on my iphone when im on my computer?

    I just downloaded the latest itunes and i cant figure out how to update my iphone apps on my computer now.  I go to the toolbar on the top and press search for updates and it tells me that the latest version of itunes is already downloaded or that there are no updates available at this time.  Previously, i would be able to go to the apps page on itunes and then press search for updates and then download all. Then I would sync with my phone and both phone and computer would be updated.  Now I can only update on the phone and I know Im going to encounter where it tells me the info for downloading is too large to do it on your phone, hence my first question.....where do I go to update my apps on my computer????

    While you're in itunes, with the leftside window open, click on Apps. Then, look across the top middle of your itunes screen. You will see several choices: All, Iphone/iPad Touch, Ipad, Ipod Games, List, and Updates. 
    Clicking on each of these gives you a different view. 
    When you select ALL you will see all of your apps. When you select Updates you sill see only the apps that need to be updated. When you are in Updates you will see the Update button in the lower right corner.
    Hope this helps.

  • I use to drag and drop an web address into a link toolbar, can't seem to figure out how to do this...?

    I just upgraded to Windows 7 and with it I got the latest Firefox. There is nothing like learning 2 things at one time. On my old XP and 3.? all I have to do was drag and drop a web address into a link toolbar. Saving all my frequent visited or just sights I want quick access to, to a toolbar quick button. I have been playing with this for days and decided to try this Forum. I did find the Bookmark toolbar, but cant seem to figure out what is if for or if you can drop into it. When I right click it and Customize, it shows me add on buttons, but nothing to do with web addresses or alike...
    Bottom line; I want to be able to drag and drop a web address into a toolbar for recall latter and be able to edit the address with a right click at a latter date in necessary...
    Thanks, Mike

    You can drag and drop the favicon also known as the [https://support.mozilla.com/en-US/kb/Site+Identity+Button site identity button], at the left hand edge of the location bar onto a toolbar to bookmark the site.

  • Can anyone tell me how to use the loops and backing tracks with a single guitar input? I can't seem to figure out how to set this up

    I am trying to configure Mainstage to input my own guitar and add a backing track from the library or a loop but, I can figure out how to open or add the tracks I've downloaded. Any help would be great

    did you try the PlayBack preset/template?
    once you open the PlayBack plug-in you just load the tracks from the plug-in's menu.

  • Help I my iMessage is offline and I can't seem to figure out how to reactivate it.  It shut itself off on it's own and I've tried everything under the sun to reactivate it and nothing is working.

    My imessge status is offline and I have tried everything to reactivate it and nothing works.  I don't know what to do.. I am not very tech savy and new to Mac so I am not certain if there is something going on behind the scenes that I can do to address this.  I have an ipad and phone and my instant messaging works fine on them but not on my Mac Pro.
    Help! PLEASE and THANKS

    You can drag and drop the favicon also known as the [https://support.mozilla.com/en-US/kb/Site+Identity+Button site identity button], at the left hand edge of the location bar onto a toolbar to bookmark the site.

  • Can't seem to figure out how to publish

    I have two sites that I have created for my two companies using iWeb 08. In the tree it shows both sites all the time. When I publish to folder both sites get published no matter what I do, and when I publish to MobileMe the top site in my list gets published to the web even if I highlight the second site and click publish.
    All I want to do is be able to publish one site or the other whenever I feel like it. Any help out there???

    Welcome to the Apple Discussions. FWIW I use iWebSites to manage multiple sites.. It lets me create multiple sites and multiple domain files.
    If you have multiple sites in one domain file here's the workflow I used to split them into individual site files with iWebSites. Be sure to make a backup copy of your original Domain.sites files before starting the splitting process.
    This lets me edit several sites and only republish the one I want.
    OT

  • HT1386 I can't seem to figure out how to put an album that i downloaded to itunes on my phone

    I am trying to download an album that I have on itunes to my iphone 4s  How do I do that?

    OK, Connect your device to your computer, start iTunes and click on your device in the device list.
    After that choose the Music pane in the right window and see if you can locate your album.
    Select it and press "sync" to start the sync process. After that the music should be present on your iPhone.
    See also page 60 of the iphone_user_guide
    iTunes in the Cloud: When you’re signed in to the iTunes Store, all of your previous purchases automatically appear in Music. See iCloud on page 17.
    ••Sync content with iTunes on your computer: See Sync with iTunes on page 18.

  • I can connect to my work server via vpn but cannot seem to figure out how to map the network drives on the iMac. Any thoughts?

    Wish to map network drives on the iMac. Any thoughts?

    For some reason, the error box photo didn't appear in my post. Here it is:

Maybe you are looking for

  • Problem Installing BPEL Process Manager in Win2K

    Hello, I am new to BPEL and especially to Oracle BPEL Process Manager. I have to write my diploma thesis about an BPEL-related topic an so I decided to try the Oracle BPEL PM. My OS is Win2K, we run Bea Weblogic 8.1.4 as an app server. I installed th

  • Coloring  a popup field in a tabular form

    Hello all, i have searched for this subject many times, find a lot of answers to coloring at all, but none of them works for me. I have a tabular form,in the sql query i create a column COLOR (case clause) and try to color the back-/foreground of the

  • EHPI failed in DEPLOY_ONLINE_DEPL

    I am upgrading my PI system from NW700 SPS14 to NW7.01 SPS3 with EHPI. In the DEPLOY_ONLINE_DEPL it fails because SDM server is being shutdown while the JSPM is trying to update the SDM repository. My full problem analysis is below. Thank you. Dave E

  • The ongoing volume problems

    This is what worked for me re same inadequate volume on Treo when IT first came out. It's what I think many of us wish for, barring just plain fixing the problem in an update, re the iPhone right now: http://www.gotreosoftware.com/products/VolumeCare

  • Trouble Installing Elements 11 on my laptop

    So after clicking Open on the Elements 11 zip file with winzip, it directed me to open the install file. After processing to 100%, it then asked me what program do you want to use to open the xml install file? What program do I use? The default windo