FORUMS: list search recent posts

FLV Player trying to load selectedIndex that doesn't exist

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
BrentC
FLV Player trying to load selectedIndex that doesn't exist
on Jul 31, 2007 at 9:49:33 pm

I've built a video dictionary for American Sign Language that pulls it's data from an XML file. You can see the completed app here.

Basically I have an XML file that goes something like this:


<dictionary>
<letter label="A" >
<word label="Apple" url="apple.flv" />
...
...
</letter>
</dictionary>


In my Flash file, I have two listboxes. One is bound to the letter array, the other is bound to the word array. The contentPath of the video player is indexed to the selectedIndex of the listbox with the words.

Here's the problem. It all works fine until someone selects a letter that has less words than the word currently selected. For instance, S has a lot of words. Z doesn't have so many. When a user is on the 20th word of the S array, if they click on Z as their first letter, the video player tries to load the 20th item in the Z array, which doesn't exist. This makes the whole application lock up.

Any ideas on how I can fix this?


Return to posts index

BrentC
Re: FLV Player trying to load selectedIndex that doesn't exist
on Aug 1, 2007 at 11:57:26 pm

I'm thinking that a simple fix would be to make the index for the word array default to 0 each time a new letter array is chosen, but I don't know how to do that (afraid my scripting knowledge is nil). Can anyone at least suggest how I might accomplish this?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]