Hi there Shawn,
I'm a relative newbie here as well but I thought I'd take a look. I
learn as I do so I try. :-)
It seems when your loadMainImage event is being triggered, you are
parsing the data from the XML file correctly actually. But what you want
to do is pull the unique data from the item being clicked.
Is the list of images across the bottom a horizontal list? If it is, and
if the datasource used to fill that list is the same XML list, then what
you may want to try is for your horizontalList set a function to respond
to the "change" event:
<mx:HorizontalList
id="thumbScroller"
source="{ yourDataSource }"
change="loadMainImage" // call the loadMainImage function when the
selected item in the horizontal list changes
/>
Then in your function,
public function loadMainImage(event:Event):void {
//pull the data from the selected item of the thumb scroller as it
has been populated by the XML data source
image_name_txt.text = [EMAIL PROTECTED];
mainImage.source = [EMAIL PROTECTED];
}
I'm not sure if you are using the HorizontalList for your thumb scroller
on the bottom, just a guess.
Hopefully that helps a little,
Michael
shawn.gibson wrote:
I swear to god I'm doing the best I can here, and I do seem to be
getting closer.
My problem right now is that I don't seen to be able to get the main
image (orthe text label) to load after a particular thumb is clicked.
I SEEM to be loading the entire array...which of course makes no
sense. The function that does this is the following:
public function loadMainImage(event:Event):void {
[EMAIL PROTECTED]
[EMAIL PROTECTED]
}
I'm trying to tell both the image_name_text and the Main_mage to load
what would be the current text/title and the current image based on
the secections involved.
I'll give the entire block if it helps:
<mx:Script>
<![CDATA[
//import mx.events.ModuleEvent;
//import mx.modules.ModuleManager;
import mx.core.Application;
import flash.net.*;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
[Bindable]
public var selectedNodeTree:XML;
// Event handler for the Tree control change event.
public function treeChanged(event:Event):void {
selectedNodeTree=Tree(event.target).selectedItem as XML;
[EMAIL PROTECTED];
thumbService.send();
}
public function loadThumbScroller(file:String):void {
thumbService.url = file;
thumbService.send();
}
public function loadMainImage(event:Event):void {
[EMAIL PROTECTED]
[EMAIL PROTECTED]
}
]]>
</mx:Script>
I have migrated everything to my development machine (Vista is rather
Nifta!). If this code provided doesn't help I will upload the
application to my make-shift server till my real server gets back to
the shop.
I am also very worried that I don't get the concepts Tracy and others
abide by - not referencing the result directly, but doing so by using
a ResultHandler, because my understanding is without such, you can't
debug. I just don't get that part at all.
Does anyone know why my loadMainImage method seems to be passing both
an array of ALL text and, I am GUESSING, instead of reading the single
image as it should, it might be trying to pass the entire group of
images to the image, which would explain why it gives me a broken
image...but DOES seem to want to connect...just doing so incorrectly.
The XML is of this structure:
<?xml version="1.0" encoding="iso-8859-1"?>
<rootdir>
<gallery label="/">
<item name="Catherine1" thumblink="images/CD2_thumb.jpg"
piclink="images/CD2.jpg"/>
<item name="Catherine1" thumblink="images/artwork1.jpg"
piclink="images/artwork1.jpg"/>
<item name="Catherine1" thumblink="images/artwork2.jpg"
piclink="images/artwork2.jpg"/>
<item name="Catherine1" thumblink="images/artwork3.jpg"
piclink="images/artwork3.jpg"/>
<item name="Catherine1" thumblink="images/artwork4.jpg"
piclink="images/artwork4.jpg"/>
<item name="Catherine1" thumblink="images/artwork5.jpg"
piclink="images/artwork5.jpg"/>
<item name="Catherine1" thumblink="images/artwork6.jpg"
piclink="images/artwork6.jpg"/>
</gallery>
</rootdir>
I'm getting desperate. I can't do this by myself, and I'm sinking into
a depression because of it. Outside the fact that this venture has
cost me over $25,000 so far (I'm a secretary, we are talking about a
year's pay for me into this project..., and I am getting nowhere, I'm
getting very depressed. I have ADHD, so please understand I am only
asking for help because I really, really, need it. I have absolutely
no desire to make money. I just want to make something beautiful for
my images and to give it to the world when it's done. I KNOW my
project has value to that end.
I won't bother you guys again if I have overstepped the limits of
'asking for help'. I'll just try on my own for as long as I can stay
sane with it, and failing that, I might have no choice but to put all
this money and my desire to build this behind me...I have no idea what
I will do if that happens.
I'll see if I can move this to my make-shift server so you can see it
in (non)action...
Shawn