Nov 8, 2009

The List Component - in Flash

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > Others

The List Component - in Flash

EinReaper
Hello!

I have a list component in a fla. When I click a button, I add items to the list. (using list.addItem )
The problem is that every time I add new items I want to refresh the list; this means that I want to delete all items that are in the list and leave only the new ones.
Is there anyway to do this using only one function?
(I know that I can use list.removeItem , but that would mean I have to delete every item in the list one by one).

Comment/Reply (w/o sign-up)

galexcd
You can use the removeAll() method to remove all items in a list. Here is more information on the method.

Comment/Reply (w/o sign-up)

EinReaper
Thank you.
removeAll() does indeed do the trick.
But now I have another problem: when I select a field from the list what's the variable that holds the data for this field? Any field has a label (the thing you see) and a data (the variable underneath).
I've tried list.data (where list is the instance name for my list), but this returns 'undefined'.
I have a similar situation for a ComboBox; if I use combobox.text it returns the label for the field I selected, but I don't know how to access the data.

Comment/Reply (w/o sign-up)

galexcd
QUOTE(EinReaper @ Oct 22 2008, 09:14 PM) *
Thank you.
removeAll() does indeed do the trick.
But now I have another problem: when I select a field from the list what's the variable that holds the data for this field? Any field has a label (the thing you see) and a data (the variable underneath).
I've tried list.data (where list is the instance name for my list), but this returns 'undefined'.
I have a similar situation for a ComboBox; if I use combobox.text it returns the label for the field I selected, but I don't know how to access the data.


i haven't mettled with the list component for some time but if I recall correctly list.data returns an array. Have you tried list.data[0]?

Comment/Reply (w/o sign-up)

EinReaper
I haven't tried that because I'm looking for a function that returns data for a selected item, not an item located at position i.
I have found something that might help: list.selectedItem.data . The problem is that this returns the correct value for list.selectedItem.label , but it returns 'undefined' for list.selectedItem.data.
I'm not sure what I'm doing wrong...

Later Edit: as it turns out list.selectedItem.data was the proper function to use. The problem was that I wasn't inserting data correctly into the items.

Comment/Reply (w/o sign-up)

Nabb
How are you using the addItem function call?

There are two ways to use it, the first is list.addItem("label","data");
The second is list.addItem({label:"label", data:"data"});

Both should work to all you to retrieve the data using list.selectedItem.data.

There is another method to add a label to the list but as far as I know, it doesn't allow you to store data with it. (list.label.push("label"), but list.data.push("data") fails)

Note that you can store data in an array elsewhere if desired and push to it seperately to calling addItem (or define a function which does both wink.gif), and retrieve the data from the array by using array[list.selectedIndex]..

...okay I see you've fixed your error (saw the update when using preview post), but I'll leave this post here to inform anyone who might later need this!

Comment/Reply (w/o sign-up)

EinReaper
Well, I was using the first method: list.addItem("label","data") , but for some reason it didn't work.
The second method works just fine: list.addItem({label:"label", data:"data"})

Comment/Reply (w/o sign-up)

sarankarthi
hey there
i need the vb.net code details to read the particular line of text document from the local computer.. please anybody could help me...

________
Zen

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : list, component, flash

  1. Mouse Over Alpha Fade
    Flash CS3 (10)
  2. Flash Action Scripting Help Needed
    (6)
    Hey all, I'm working with a art student on this flash based portfolio site and it requires some
    complicated action scripting. Either him nor I are efficient enough in flash so we need some advice
    from you experienced Flash experts out there. I worked with flash a long time ago and it was only on
    one project so I remember vaguely what movies and time lines are for lol. Basic stop and go to
    commands but that's about it. I can read up on anything I need but the thing is I have no idea
    where to begin. I have attached a PDF of my partners initial storyboard of the sc....
  3. Flash, Php And Facebook Integration
    Plea for good tutorials & resources on the above topic (0)
    Hi all, I'm working on a project. Basically I hope to build a generic web application
    framework that will allow Flash/AS3 applications to be easily integrated into the Facebook platform.
    I am currently surveying a number of technologies and I am trying to figure out what tools will best
    help me achieve that goal. Many of them are open source with some still in early development. Most
    lack extensive documentation so its very difficult to gauge the strengths and weaknesses of a tool
    without investing a good deal of time figuring out how to use them. Is anyone here....
  4. Flash As3 Question
    Alternitives to root (2)
    Hi. Basically, the MovieClip(root) thing is dodgy at the best of times. Besides - it's not
    recommended to use root at all. In fact, it's highly discouraged. I've seen plenty of posts
    about this, but for the life of me, I can't find anything about what else I should use. What
    alternative should I be using to access properties/mc's/etc from the root/parent time lines??
    edit:Cleanup/spelling fixes, etc.....
  5. Flash Problem
    sometimes the buttons will load the wrong link. (9)
    Its weird but sometimes when you hit the forums or roster button on my flash banner it will load:
    www.childrenofconan.trap17.com/index.html instead of what its suppost to. It works fine, but if you
    mess around and click the buttons for a little bit you will notice this happening. This is a problem
    because people visiting the site will sometimes click the button once and be like oh I guess the
    link is broken and never come back, if anyone has a solution to what could be the problem it would
    be awesome. This is one of my first custom flash banners and im just confused what....
  6. Flash - Streaming Flv With Interactible Objects
    Actionscript 3.0 - syncronising swf with flv (3)
    Hi Guys, I am trying to make a flash based web site. The idea is to have a flv video streaming
    which has people moving around and the people need to be clickable objects. I tried tracing the
    video by importing the flv to the flash time line and creating a button that follows a person in
    each frame. I then remove the flv video from the timeline and stream it using actionscript. This
    leads to synchronization issues. Does anyone know if this combination of swf and flv has ever been
    implemented? If so could you please refer me to the source or post a link to an example, i....
  7. Flash Coding
    (1)
    I don't know if this is the right section, but does anyone know how to do flash coding and/or
    know a good site to learn it from? I'm trying to make a game like Naruto-Arena . One of my
    friends told me it was made using flash coding and thats why I'm trying to learn it.....
  8. Move The Movie Clip In Flash
    Use the arrow key to move the Movie Clip. (2)
    Movie Clip 1.Create a Movie Clip and draw a Rectangle or your design in the Movie Clip. 2.Come Back
    to Scene 1. 3.Select the Movie Clip and set them instance name = “movie”. 4.Select the first Frame.
    5.Press F9 and Copy Code Below and paste it. CODE setInterval(function () {     if
    (Key.isDown(Key.RIGHT)) {         setDirection(0);         _root.movie._x += 3;     }     if
    (Key.isDown(Key.LEFT)) {         setDirection(1);         _root.movie._x -= 3;     }     if
    (Key.isDown(Key.DOWN)) {         _root.movie._y += 3;     }     if (Key.isDown(Key.UP)) {
            _root....
  9. Need Sugation About Flash
    (4)
    I was informed that in web programing Flash is more afster then Java applets or animated images. So
    that I am thinking about Flash. Now I know that there are many tutorial are available in www. Now
    can any body help me from where I should start. However I have some question on my mind Is it
    difficult to learn? What tools do I need to install? Can you recomended any tutorial? And
    finally my question is why flash is so famous, is it because of it is faster or have there any other
    reason?....
  10. Flash
    (3)
    Can anyone recommend a book or online guide to flash. i am currently designing a new website, and
    with it, i would like to add flash and all that jazz (kinda like this website ). i want to get an
    good understanding of flash and other things like flash so i can create and design flash based
    websites.....
  11. Flash Vs. Java Applets
    (2)
    As I started to learn Java, I came across a tutorial for making Java applets. As I read on, I found
    some similarities between Java applets and Flash movies. Right when I saw the source code for a
    checkerboard picture made in Java, I said to myself, Flash beats Java applets big time! It also took
    a while to load such a small applet when in Flash it instantly loaded. In my opinion, I think flash
    beats Java applets when it comes to convenience, appearance, load time, animation, and more (except
    AJAX). Here are two articles, first supporting java applets and the other flas....
  12. Flash Tutorial : Realistic Ball Movement
    Flash Tutorial (0)
    QUOTE Hi In this tutorial I am going to show you how to make a ball move around the screen
    realistically and if the ball hits a side of the stage it will bounce. Background colour white.
    550x400 50 fps The first thing you need to do is draw a circle on the stage (50x50) then select it
    and press F8. (You may want to put a line or something through the ball so that you can see it
    rotate). Set it as a MovieClip. Now double click on the circle to edit it, position the ball to be
    in the very center. Now go to the main screen and click on the first frame and open the ....
  13. Flash, Sqlserver And Asp
    (0)
    Hi everyones,



    I going to bang my head because I have been trying to show SqlServer 2000 data in (Flash Mx
    Professional 2004) DataGrid I am working with ASP.NET but I am still unable to....
  14. Here Is A Really Good Flash Tutorial Site
    (7)
    This site is the best for creating different flash elements and just learning to use macromedia
    flash in general. Click on the link below and you will be taken to step by step tutorials for many
    different flash objects. Flash tutorials ....
  15. Flash Player Simpleviewer Using Flickr And Picassa2
    (0)
    Ok i was told that I can dynamically upload my pictures using flickrviewer. I want to upload them
    to simpleviewer or a flash movie like simpleviewer. Right now what I do is use Picassa2 and make a
    flash movie with my pictures everytime i add new pictures. That is kind of a pain. I wanted to see
    if there was any way to dynamically insert them into the flash movie or if anyone knew how to use
    flickrview. I can't get it to work. here are the links to simpleviewer link and flcikrviewer
    site and flickr site . ....
  16. Playing Flash Movies Without The One-click Activation: Simple Insertion Of Javascript
    (5)
    In the past year or two iternet explorer and other browsers have updated their coding platforms.
    The bad thing is that if you have any flash objects at all within your web page you have to hit the
    space bar or click on the flash object to activate it. Once you activate it, you then can interact
    with the object or the object will then play on the website. I dont like how you have to activate
    the flash player first to interact with it. here is the code to prevent that. Believe me people
    notice how much better the site is after you do this. put under the flash player. ....
  17. Appeal For Flash-related Help [kinda Urgent]
    I could use some help! (0)
    I need a tiny bit of help with some flash files. I have taken up a project in php that I did not
    expect would involve any flash editing, but I am dealing with already existing .swf files that make
    calls to various php files. Now, here's the situation: I don't have the .fla files, only
    .swf. So I need someone who has access to a flash decompiler who can possibly help me out. After
    decompiling the files, I require that all the links/calls to php files, which are made using
    relative paths/addresses, be changed to absolute paths, like change something.php to www.som....
  18. How To Get High Quality Gif Images In Flash
    (11)
    Step 1- Make the Animation Get your animation ready. Make sure not to use any Movie Clips with self
    contained animation for it will be lost in the conversion to an animated gif. Step 2- Publish
    Settings Now that you have your animation you need to go to Publish Settings under File. Now
    uncheck all of the boxes except for gif. This will not effect you if you usually preview your movies
    by the Test Movie feature. If you do use Publish to preview your movies, simply recheck the .swf box
    after this tutorial. Now click the only remaining Gif tab at the top of the box. N....
  19. How Do I Start Making My Website In Flash
    Can't find tutorials in google :( (11)
    Hey everyone, I began making my website with Firworks, and Dreamweaver. But I really want to know
    how to make a website with Flash. I understand with this program you make 'movies'. I have
    done some tutorials too, and I get that. But what I want to know is, if the content in the different
    pages (like home, contact, links etc.) have to be one movie? Or do you use other programs. Like
    this site below, it's a beautiful site of the Luny Tunes (reggeaton music artistgroup): Luny
    Tunes But is the whole site a 'Movie', or is there some HTML in it as w....
  20. Macromedia Flash
    Who has ever used Macromedia Flash? (9)
    On Christmas, a relative of mine purchased Studio 8 from Macromedia, which is now Adobe. However
    when first running Flash 8, I was very confused...for all people who have ever used Flash, how do
    you make the images move? I tried following the tutorial, and tried "adding a motion tween", however
    I can't get it to work... /sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' />
    Thanks in advance! Stephen....
  21. Print With Flash And Datagrids Without Resizing!
    (4)
    hey hi guys..this is a code i used to print data from a datagrid and it is so useful in ur RIAs hope
    it helps... cheers! CODE mybtn.onPress=function(){ doPrint(mydg, true) } function
    doPrint(datagrid:mx.controls.DataGrid, fitPage:Boolean):Void { if (fitPage == undefined) fitPage =
    true; var pj:PrintJob = new PrintJob(); // position of currently visible rows stored var
    prev_vPosition:Number = datagrid.vPosition; var prev_width:Number = datagrid.width; var
    prev_height:Number = datagrid.height; var prev_vScroll = datagrid.vScrollPolicy; var
    prev_selectedInd....
  22. Flash
    (1)
    Does anyone know of a site that can teach you how to use it? Like i would like to read up on it and
    learn how to do it myself. I am just looking for a site that has turtorials and maybe software that
    i can test it out on and see how i do before i purchase anything. If anyone can help with this
    please let me know here, ty very much. -Storm....

    1. Looking for list, component, flash

Searching Video's for list, component, flash
See Also,
advertisement


The List Component - in Flash

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com