Pete, I'm an idiot. I checked again if the datagrid was populated before the selectedIndex was called. It wasn't... Now it is and it works... Thanks.
On 11/15/06, Carl Welch <[EMAIL PROTECTED]> wrote:
No, the dataGrid is definately filled before the selectedInex is called. On 11/15/06, Pete Miller <[EMAIL PROTECTED]> wrote: > Are you by any chance trying to set the selectedIndex before the > dataProvider array has been filled? Presumably myTrack_Pos is known > immediately via the URL query-string, but the datagrid needs time to > become populated (via XML?). > > >> -----Original Message----- > >> From: [EMAIL PROTECTED] [mailto:flashcoders- > >> [EMAIL PROTECTED] On Behalf Of Carl Welch > >> Sent: Wednesday, November 15, 2006 3:18 PM > >> To: Flashcoders mailing list > >> Subject: [Flashcoders] problems with dataGrid.selectedIndex > >> > >> Oi! > >> > >> I have built a mp3 player using xml to give me all of my links to > >> files, data, etc... > >> The data loads into a datgrid. > >> One of the requirements I needed to meet was to be able use a url > >> query-string to directly link to a mp3 to play on load: exampe: > >> > >> http://mysite/audio.php?titleid=10&trackid=71 > >> > >> This works fine. But I also need to hilite the correct row in the > >> datagrid when I use the query-string when the swf loads. Here's what > >> I'm using: > >> > >> songList_lb.selectedIndex = myTrack_Pos; > >> songList_lb.dispatchEvent({type:"change", target:songList_lb}); > >> > >> It seems like selectedIndex will only work if the user has already > >> clicked on the datagrid. But I want a row to be selected when the swf > >> loads before the user has had a chance to select anything... > >> > >> I hope I am making sense. Thanks. > >> > >> -- > >> Carl Welch > >> http://www.carlwelch.com > >> [EMAIL PROTECTED] > >> 805.403.4819 > >> _______________________________________________ > >> [email protected] > >> To change your subscription options or search the archive: > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> > >> Brought to you by Fig Leaf Software > >> Premier Authorized Adobe Consulting and Training > >> http://www.figleaf.com > >> http://training.figleaf.com > _______________________________________________ > [email protected] > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > -- Carl Welch http://www.carlwelch.com [EMAIL PROTECTED] 805.403.4819
-- Carl Welch http://www.carlwelch.com [EMAIL PROTECTED] 805.403.4819 _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com

