Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 12-06-2005, 07:34 PM   #1
mspieg
Registered User
 
Join Date: Oct 2005
Posts: 14
Question Adding getURL's to a List component

Hi,
I have a List Component which is being populated with the following script:

rightList.addItem({label:currentTerm,link:"link1"} );

I would like to set it up so that when you click on one of the list items, it would launch a GetURL:"javascript". How can I pass the URL's to the List Item?

thanks!
mspieg is offline   Reply With Quote
Old 12-06-2005, 08:04 PM   #2
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

use an event listener for "change" (when a list item is clicked, and it isn't already clicked). The url will be in event.target.selectedItem.link, because you added it to "link" in your initObj.

ActionScript Code:
var listener:Object = new Object(); listener.change = function(event) {   trace("You selected: "+event.target.selectedItem.label);   getURL(event.target.selectedItem.link); } rightList.addEventListener("change",listener);
Paerez is offline   Reply With Quote
Old 12-08-2005, 06:55 PM   #3
mspieg
Registered User
 
Join Date: Oct 2005
Posts: 14
Default

Quote:
Originally Posted by Paerez
use an event listener for "change" (when a list item is clicked, and it isn't already clicked). The url will be in event.target.selectedItem.link, because you added it to "link" in your initObj.
Will this still work if you dont use initObj, if the list component is just placed on the stage?

thanks,
mspieg is offline   Reply With Quote
Old 12-09-2005, 04:01 PM   #4
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

I was calling:

{label:currentTerm,link:"link1"}

that your initObj. It is an object you created on the fly to pass into the addItem method and it had initializing variables. And yes, it will work if you place it on the stage.
Paerez 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Major Problems trying to capture "click" event in List component ManinBlaq Components 11 01-30-2007 07:12 PM
List Component Double-Click Fuzzplug Jones Components 3 04-18-2006 10:10 PM
2 Part Question: Tooltips for List Component . Word Wrap for List Component FaceEraser Components 0 09-12-2005 01:31 PM
2 Part Question: Tooltips for List Component . Word Wrap for List Component FaceEraser Components 0 09-12-2005 01:13 PM
using the List component in my class?? dangerhotrod Components 5 11-18-2004 07:34 AM


All times are GMT. The time now is 09:49 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.