Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default Re: ListBox component

    Hey Mike,

    After you have added your listbox to the stage, click on it.
    Add code bellow to the actions script window.

    on (load) {
    _parent.listArray = new Array()
    for(i=0;i<rowCount;i++){
    trace(getItemAt(i).label)
    _parent.listArray[i]=getItemAt(i).label
    }
    }

    -Max
    [url]www.flashforabuck.com[/url]


    Mike Horton wrote:
    > Hi, could anyone help me with this problem, its probably simple to most of
    > you Flash gurus but im not up on components that well. I want to get the
    > values from a listBox component (eg. the labels, Bill, John, Bob etc) and
    > put them into an array. I only seem to be able to use getItemAt() or
    > getSelectedItem() and these seem to be triggered when a user clicks the
    > list?
    >
    > Hope you can help
    >
    > Thanks
    >
    > Mike
    >
    >
    Max Guest

  2. Similar Questions and Discussions

    1. How to add avatars to people listbox component?
      Hi, I want to know how to add avatars to people list box , please give me suggestions how to do this. I need this very urgently. Thanks in...
    2. Need little help with listbox component (mx 2004)
      anyone know how to change the size/font of the text in a listbox component in flash mx 2004? thanks in advance. //bart
    3. Scroll with mousewheel on a listbox component
      Does anyone know how I can use the scroll wheel on my mouse to scroll down through a Flash listbox component? (on a flash page embeded in a HTML...
    4. Help with ListBox Component
      Can anyone point me to a tutorial for using the ListBox component? I'd like to use it for loading movies, or jumping to frames. Thanks Geoff
    5. ListBox component in Flash and how does one use it!?
      I have a large text to use. How do i use i listbox? Tomislav!
  3. #2

    Default ListBox component

    Hi, could anyone help me with this problem, its probably simple to most of
    you Flash gurus but im not up on components that well. I want to get the
    values from a listBox component (eg. the labels, Bill, John, Bob etc) and
    put them into an array. I only seem to be able to use getItemAt() or
    getSelectedItem() and these seem to be triggered when a user clicks the
    list?

    Hope you can help

    Thanks

    Mike


    Mike Horton Guest

  4. #3

    Default Re: ListBox component


    "Mike Horton" <mhorton@teknical.com> wrote in message
    news:c0ako4$7l1$1@forums.macromedia.com...
    > Hi Max thanks for your help, I finally got that bit working last night
    using
    > this method:
    >
    > Name = "bill,bob,jon,tom"
    >
    > var arrLabel = Name.split(",");
    > for(i=0; i<arrLabel.length; i++){
    > n.addItem(arrLabel[i])
    > }
    > b.onRelease = function(){
    >
    > if(t.text == arrLabel[0]){
    > trace("Same")
    >
    > }else{
    > trace("Not Same")
    > }
    > }
    >
    > What happens in this code is on the stage I have a listbox component
    called
    > "n" there is also an input text field called "t" and a button called "b".
    >
    > Is there an easier way?
    >
    > Thanks
    >
    > Mike
    >
    >
    Name = "bill,bob,jon,tom";

    arrLabel = Name.split(",");
    for(var ii=0; ii<arrLabel.length; ii++){
    n.addItem(arrLabel[ii])
    }

    b.onRelease = function(){
    for(var x=0;x!=arrLabel.length;x++){
    if(t.text == arrLabel[x]){
    trace("Same")
    }else{
    trace("Not Same")
    }
    }
    };

    hth


    Jack Guest

  5. #4

    Default Re: ListBox component


    "Mike Horton" <mhorton@teknical.com> wrote in message
    news:c0an22$bbd$1@forums.macromedia.com...
    > That's great thank you very much, that's a great technique ill have to
    > remember that one for future use.
    >
    > Thanks
    >
    > Mike
    >
    you're welcome Mike,

    i've added this to my code snippets ( W.I.P :) at
    [url]http://www.jackleaman.co.uk/flash_db/flash_db.html[/url]
    feel free to browse :)

    regards,
    Jack.


    Jack Guest

  6. #5

    Default Re: ListBox component

    Hi Max thanks for your help, I finally got that bit working last night using
    this method:

    Name = "bill,bob,jon,tom"

    var arrLabel = Name.split(",");
    for(i=0; i<arrLabel.length; i++){
    n.addItem(arrLabel[i])
    }
    b.onRelease = function(){

    if(t.text == arrLabel[0]){
    trace("Same")

    }else{
    trace("Not Same")
    }
    }

    What happens in this code is on the stage I have a listbox component called
    "n" there is also an input text field called "t" and a button called "b".

    What im stuck on now is I want to be able to check the value of the text
    field against the values in the array, so if someone types in "bill" it
    would say "this item exists" else it would say "this item does not exist".
    the only way I could think of doing it would be thike this:

    if(t.text == arrLabel[0] | t.text == arrLabel[1] | t.text ==
    arrLabel[2]){ and so on.....

    But the variable Name is set dynamically so I don't know how many items
    there will be.

    Is there an easier way?

    Thanks

    Mike


    "Max" <admin@flashforabuck.com> wrote in message
    news:c08v6c$st$1@forums.macromedia.com...
    > Hey Mike,
    >
    > After you have added your listbox to the stage, click on it.
    > Add code bellow to the actions script window.
    >
    > on (load) {
    > _parent.listArray = new Array()
    > for(i=0;i<rowCount;i++){
    > trace(getItemAt(i).label)
    > _parent.listArray[i]=getItemAt(i).label
    > }
    > }
    >
    > -Max
    > [url]www.flashforabuck.com[/url]
    >
    >
    > Mike Horton wrote:
    > > Hi, could anyone help me with this problem, its probably simple to most
    of
    > > you Flash gurus but im not up on components that well. I want to get the
    > > values from a listBox component (eg. the labels, Bill, John, Bob etc)
    and
    > > put them into an array. I only seem to be able to use getItemAt() or
    > > getSelectedItem() and these seem to be triggered when a user clicks the
    > > list?
    > >
    > > Hope you can help
    > >
    > > Thanks
    > >
    > > Mike
    > >
    > >
    >

    Mike Horton Guest

  7. #6

    Default Re: ListBox component

    That's great thank you very much, that's a great technique ill have to
    remember that one for future use.

    Thanks

    Mike


    "Jack" <jackleaman@hotmail.com> wrote in message
    news:c0alit$91g$1@forums.macromedia.com...
    >
    > "Mike Horton" <mhorton@teknical.com> wrote in message
    > news:c0ako4$7l1$1@forums.macromedia.com...
    > > Hi Max thanks for your help, I finally got that bit working last night
    > using
    > > this method:
    > >
    > > Name = "bill,bob,jon,tom"
    > >
    > > var arrLabel = Name.split(",");
    > > for(i=0; i<arrLabel.length; i++){
    > > n.addItem(arrLabel[i])
    > > }
    > > b.onRelease = function(){
    > >
    > > if(t.text == arrLabel[0]){
    > > trace("Same")
    > >
    > > }else{
    > > trace("Not Same")
    > > }
    > > }
    > >
    > > What happens in this code is on the stage I have a listbox component
    > called
    > > "n" there is also an input text field called "t" and a button called
    "b".
    > >
    > > Is there an easier way?
    > >
    > > Thanks
    > >
    > > Mike
    > >
    > >
    >
    > Name = "bill,bob,jon,tom";
    >
    > arrLabel = Name.split(",");
    > for(var ii=0; ii<arrLabel.length; ii++){
    > n.addItem(arrLabel[ii])
    > }
    >
    > b.onRelease = function(){
    > for(var x=0;x!=arrLabel.length;x++){
    > if(t.text == arrLabel[x]){
    > trace("Same")
    > }else{
    > trace("Not Same")
    > }
    > }
    > };
    >
    > hth
    >
    >

    Mike Horton Guest

  8. #7

    Default Listbox component

    HI there..

    I know that this must be basic --- When I use the List componen
    and added some labeles eg: Start movie 1, Start movie 2, Start Movie 3,,,

    How do I them apply the _root.pictures1. gogotoAndPlay("go")
    _root.pictures2. gogotoAndPlay("go")
    _root.pictures3. gogotoAndPlay("go")



    Its quite simple but can someone help, didnt have luck findin
    some tutors


    Have a nice day:-

    Flemmmin



    pauk Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139