Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-05-2005, 06:07 PM   #1
Dave At ADC
New AS Developer
 
Join Date: Jul 2005
Location: Centreville, Virginia
Posts: 196
Default Determine time before listbox click

I have a listbox that has several items that will load a path for a movie. If you click an item, the movie plays. I want this to detect the time before a user clicks on an item in the list box. If 10 seconds pass by and the user doesn't select an item, I want it to play my movieclip, PleaseSelectAVideo...

I assume I would start the timer on my stage level... from there it would detect some click on the list... maybe a selection? I dunno. I'm new to this so I'm not sure what events go on a listbox component (Since today is my first time trying to play with one.) If anyone knows how to do this, please lemme know.

Thanks
Dave At ADC is offline   Reply With Quote
Old 08-05-2005, 06:32 PM   #2
pdarley
Web Stuff
 
pdarley's Avatar
 
Join Date: Nov 2004
Location: Dallas, TX
Posts: 178
Default

I would use a setInterval. For instance;

On the timeline put:
ActionScript Code:
_global.timer = setInterval(callListBox,10000); function callListBox(){ clearInterval(_global.timer); //enter in statement to call the list box and play it }


Inside the list box on your buttons put:
ActionScript Code:
clearInterval(_global.timer);

I used global because I do not know how you have your pathing setup, but this shoudl do the trick ideally.
pdarley is offline   Reply With Quote
Old 08-05-2005, 07:01 PM   #3
Dave At ADC
New AS Developer
 
Join Date: Jul 2005
Location: Centreville, Virginia
Posts: 196
Default

How do I add that code to a specific button within my listbox? Whenever I try to click on it, it selects the listbox instance... Any ideas?
Dave At ADC is offline   Reply With Quote
Old 08-05-2005, 07:16 PM   #4
pdarley
Web Stuff
 
pdarley's Avatar
 
Join Date: Nov 2004
Location: Dallas, TX
Posts: 178
Default

Honestly I never ever....ever ever....use any of the MX components. Hopefully someone else can chime in.

Sorry man
pdarley is offline   Reply With Quote
Old 08-05-2005, 07:41 PM   #5
Paerez
Chick dig raccoons
 
Paerez's Avatar
 
Join Date: Apr 2005
Location: Maryland / Massachusetts
Posts: 1,104
Send a message via AIM to Paerez
Default

For lists, if a user selects an item, it fires the "change" event. So use this:

ActionScript Code:
// Name of your list on the stage var myList:List; var selectListener:Object = new Object(); selectListener.change = function(event) { // event.target is the same as myList // Clear interval // Play the movie } myList.addEventListener("change",selectListener);

Good Luck
Paerez is offline   Reply With Quote
Old 08-05-2005, 08:03 PM   #6
Dave At ADC
New AS Developer
 
Join Date: Jul 2005
Location: Centreville, Virginia
Posts: 196
Default

ActionScript Code:
// event.target is the same as myList

Eh, what? Sorry, my noobishness is beating me down on this.
Dave At ADC is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:24 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.