Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 07:27
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  The Library
| |-+  Technical Reference Area (Moderators: Flash-db, Musicman, BurtonRider1983, vesa kortelainen, Ronald Wernecke, Jorge Solis)
| | |-+  Dynamic Menue using List-Component
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Dynamic Menue using List-Component  (Read 4215 times)
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« on: 01/23/07, 05:02 »

I just created a little thing, which might be useful for others as well Wink

Just put a List component into your Library (drag it on stage, then delete) and insert this code into the main timeline (not into the timeline of the component!).
Code:
import mx.managers.DepthManager;
 
list=Array({label:"Bilderdienst",data:"http://www.dibidi.de"},{label:"phn",data:"http://www.prohelpnet.de"});
l1=createChildAtDepth("List",DepthManager.kTop,{_x:100,_y:150,dataProvider:list,onChange:ausgabe,vScrollPolicy:"auto",backgroundColor:0xccddff,_alpha:50});
l1.setSize(100,list.length*25);
l1.addEventListener("change",readUrl);

function readUrl(){
 getURL(l1.selectedItem.data);
}

You can enter into the list array, whatever pleases you.
If it bcomes a few entries, you will need to handle the size.
If you limit the size of the listbox, you will get a scrollbar, if you have more entries.

Have fun playing around
Logged

happy flashing
Cool
Ronald
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!