Skinning List component by code

i have two List component. i want them to have different
skins. i think this can be done using code but i m not abel to do
it.
what i tried was
myList1.setStyle("upSkin",myNewSkin1);
myList2.setStyle("upSkin",myNewSkin2); //myNewSkin1 &
myNewSkin2 are movieClips in my library that
//are exported for Action Script on the first frame.
but this dont work.
plz help
thanks in advance

i dont understand y i dont get a single response in this
forum since the last few days. is it that no one has faced this
issue before? sounds strange...

Similar Messages

  • List component skin or style problem

    I am building a scrolling list that pulls data from a xml
    file, and binds the data to a list component
    I am trying to figure out how to change the look of the list
    component.
    I need to create a rounded backgound for each list item and I
    would like to use a symbol for this.
    I can't find a setStyle property to change this and if I try
    to adjust the HaloTheme.fla there is no List symbol to change.
    How do I access the graphic being used by the list component?
    Thanks for any help

    You could write your own CellRenderer and apply it to the
    list.
    http://www.adobe.com/support/documentation/en/flash/fl8/samples.html#component_samples

  • How do you set the text of a Hyperlink component in code

    I am using Visual Web pack in NB 6.0. How do you set the text of a hyperlink component in code?
    Please see screenshots at
    http://coba.usf.edu/departments/isds/faculty/agrawal/projects/java/
    I have a hyperlink in a grid panel. I am using
    hyperlink1.setText("Hello"); in prerender(),
    but the Hyperlink shows up with the text "Hyperlink", whereas I was expecting "Hello". However,
    hyperlink1.setUrl("http://www.usf.edu"); works as expected.
    I tried nesting a static text in the hyperlink as suggested in the Creator guide (ed 2, Google project). I deleted the "Hyperlink" text in the properties editor but then the page turned out blank.
    Thanks
    Manish

    Hi Manish,
    Great to know you were able to fix your issue. The following blog entry has the list of resources you would like to look at for future.
    http://blogs.sun.com/NetBeansSupport/entry/useful_resources_for_visual_web
    Thanks
    K

  • Video, XML and List Component

    Hello all,
    I have this code that is suposed to take my simple little XML
    file and populate it into a List component which in turn when an
    item is click it will play the video assigned to it. I have a
    custom player built and it works perfectly when I just load in one
    movie by hard coding its path into my AS, however when I load the
    XML in it only will play the first movie in the list, and will not
    load in any other movie when selected.
    My code is below. anyone that can help it would be greatly
    appreciated. The XML code is at the bottom.

    funkysoul,
    First thanks for taking a look at what I have. To answer your
    question yes I have changed the start up movie in the Array (i.e.
    from 0 to 1 or 2 or 3) and it does play that movie first, but again
    when I click to load in another movie it does not play anything
    else.

  • List component question

    Hello,
    I have flash cs4, and I am using a list component. I know how to open swf when somebody clicks on the list, but is there any way to tell the component to open a .pdf file on  a new window using the list component?
    thanks for your guidance
    Cheers.

    You just need to link to the pdf like you would link to any web page.  The code you use depends on the version of actionscript you are using...
    AS2:  getURL("http://www.yourdomain.com/your.pdf", "_blank");
    AS3: navigateToURL(new URLRequest("http://www.yourdomain.com/your.pdf"), "_blank");

  • Highlight color in list component

    Hi there
    Can anybody tell me how to change the color from the default blue that the list component uses for the currently selected item.
    myList.highlightColor = something; ??
    Many thanks

    - Doubleclick your list.  -> goto frame 2
    - Doubleclick the 3. (Cell Renderer Skins)  -> goto frame 2
    and you will see
    there you can doubleclick preferred over, down states...

  • Highlight current Index label in list component

    Hi,
    I'm writhing http xml video playlist. i was took 'List' component for playlist.
    if i click on label, that is working (i mean playing video & highlighting label).
    but after video ending, video automatically playing but label not highlighting, How can i highlight current playing video label?
    Code:
    var videoURL:String = "playlist_http.xml";
    var bolLoaded:Boolean;;
    var intActiveVid:int;
    var urlLoader:URLLoader;
    var urlRequest:URLRequest;
    var xmlPlaylist:XML;
    var nConnection:NetConnection;
    var ns:NetStream;
    var video:Video = new Video();
    nConnection = new NetConnection();
    nConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    nConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    nConnection.connect(null);
    function connectStream():void
              ns = new NetStream(nConnection);
              ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
              ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, ayncErrorHandler);
              ns.checkPolicyFile = true;
              ns.client = this;
              vidDisplay.attachNetStream(ns);
              ns.play(videoURL);
              vidDisplay.smoothing = true;
              urlRequest = new URLRequest(videoURL);
              urlLoader = new URLLoader();
              urlLoader.addEventListener(Event.COMPLETE, playlistLoaded);
              urlLoader.load(urlRequest);
    function netStatusHandler(event:NetStatusEvent):void
              trace(event.info.code);
              switch (event.info.code)
                        case "NetConnection.Connect.Success" :
                                  connectStream();
                                  break;
                        case "NetConnection.Connect.Closed" :
                                  break;
                        case "NetStream.Play.Stop" :
                                  playNext();
                                  break;
                        default :
    function securityErrorHandler(event:SecurityErrorEvent):void
              trace("securityErrorHandler: " + event);
    function ayncErrorHandler(event: AsyncErrorEvent):void
              //Nothing
    //PlayList SetUp
    //=====================
    var listBox:List = new List();
    addChild(listBox);
    listBox.setSize(194, 339);
    listBox.move(484,0);
    function playlistLoaded(e:Event):void {
              xmlPlaylist = new XML(urlLoader.data);
              //trace(xmlPlaylist.vid[0].@src);
        for (var i:int=0;i<xmlPlaylist.vid.length();i++) {
                                  listBox.addItem({label:xmlPlaylist.vid[i].attribute("desc"), data:xmlPlaylist.vid[i].@src});
                                  listBox.addEventListener(Event.CHANGE, playVidlist);
                                  listBox.selectedIndex = 0;
    // set source of the first video but don't play it
              playVid(0, false);
              if(!bolLoaded) {
                        ns.play(videoURL);
                        bolLoaded = true;
              else{
                        ns.resume();
    function playVidlist(e:Event):void
              //intActiveVid=int(String(e.currentTarget.selectedItem.data));
              ns.play(String(e.currentTarget.selectedItem.data));
              lblDescription.text = e.currentTarget.selectedItem.label;
              if(!bolLoaded) {
                        ns.play(videoURL);
                        bolLoaded = true;
              else{
                        ns.resume();
    function playVid(intVid:int = 0, bolPlay = true):void {
              if(bolPlay) {
                        // play requested video
                        ns.play(String(xmlPlaylist..vid[intVid].@src));
              } else {
                        videoURL = xmlPlaylist..vid[intVid].@src;
              lblDescription.text = String(xmlPlaylist..vid[intVid].@desc);
              // update active video number
              intActiveVid = intVid;
    function playNext(e:MouseEvent = null):void {
              if(intActiveVid + 1 < xmlPlaylist..vid.length()){
                                  playVid(intActiveVid + 1);
    function playPrevious(e:MouseEvent = null):void {
              // check if we're not and the beginning of the playlist and go back
              if(intActiveVid - 1 >= 0)
                        playVid(intActiveVid - 1);

    Thankyou.... working good, but after adding next previous buttons that selection not working currectly.
    if i click some label, selection is working after if i click next not working selection.
    function playNext(e:MouseEvent = null):void {
               if(intActiveVid + 1 < xmlPlaylist..vid.length()){
                                  playVid(intActiveVid + 1);
      listBox.selectedIndex = intActiveVid + 1;
    function playPrevious(e:MouseEvent = null):void {
              if(intActiveVid - 1 >= 0)
    playVid(intActiveVid - 1);
    listBox.selectedIndex = intActiveVid - 1;

  • Arrays to List component

    I am fairly new AS3 coder now using Flash Builder and I can't work out how to display my data (a collection of actionscript arrays returned by a AS3 function) in a List component as a list of labels and images. My arrays look like this:
    var aNames:Array = new Array("John", "Ringo", "Paul");
    var aImages:Array = new Array("http://myserver.com/image1.jpg", "http://myserver.com/image2.jpg", "http://myserver.com/image3.jpg");
    Now I want to display them in a list component, each list item has the image on the left and then the name on the right.
    Can anyone provide an example please, I think I need to use an arraycollection and a custom item renderer inside the list and then have the lists dataprovider set to the arraycollection but have not been able to construct the code.
    Many thanks.

    You'll get better responses on the Flex general discussion forum for non-Flash Builder queries.
    -Anirudh

  • Problems With List Component Flash Cs3

    Hello Friends,
    I am working in Flash Cs3.
    I am having a List component in my application.
    I added 10 items into my list component. Now out of those 10 items, i want to disable particular list items like Item 4, Item 8, Item 9. How to do this using flash cs3 or flash 8.0.
    Item1   --  Enabled state
    Item2   --  Enabled state
    Item3   --  Enabled state
    Item4   --  Disabled state
    Item5   --  Enabled state
    Item6   --  Enabled state
    Item7   --  Enabled state
    Item8   --  Disabled state
    Item9   --  Disabled state
    Item10 --  Enabled state
    Any suggestions/ideas would be really appreciated.
    Regards,
    Rajesh

    Hello Friends,
    I got a partial solution for this. Now i can able to disable a particular list item using flash cs3. I achived this. But it was happening only after clicking the item values....
    But i need in a diff way like, as soon as you run the flash file it has to disable. how is this possible in flash cs3.
    this is the code :
        import fl.controls.List;
        import fl.controls.listClasses.CellRenderer;
        import fl.controls.listClasses.ListData;
        import fl.events.ListEvent;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.text.TextField;
            var sampleItem1:Object = { label:"John Alpha" };
            var sampleItem2:Object = { label:"Mary Bravo" };
            var sampleItem3:Object = { label:"Trevor Gamma" };
            var sampleItem4:Object = { label:"Susan Delta" };       
            var myList:List;
            var tf:TextField;
      ListDataExample()
             function ListDataExample() {
                createList();
                tf = new TextField();
                tf.x = 10;
                tf.y = 125;
                addChild(tf);
             function createList():void {
                myList = new List();
                myList.move(10,10);
                myList.addItem(sampleItem1);
                myList.addItem(sampleItem2);
                myList.addItem(sampleItem3);
                myList.addItem(sampleItem4);
                myList.rowCount = 4;
                myList.addEventListener(ListEvent.ITEM_CLICK,listItemSelected);
                addChild(myList);
             function listItemSelected(e:ListEvent):void {
                var cr:CellRenderer = myList.itemToCellRenderer(e.item) as CellRenderer;
                var listData:ListData = cr.listData;
       if(cr.listData.row == 2) {
        cr.enabled  = false
                tf.text = "Row selected: " + listData.row;
    waiting for your replies.
    Regards,
    Rajesh

  • Displaying Text in List Component

    I am using AS3 to load data from an XML document into an Array and use the Array as a dataProvider for a List Component. If I addChild the list to the main timeline, everything works fine. All 38 elements show up in the list with readable text. When I addChild the list into a MovieClip, all 38 rows of the list get created, but no text shows up. What the hell is going on? Does anyone know what the fix for this is and why in the world this is happening?
    Here's my code:
    TOCList = new List();
    TOCList.dataProvider= new DataProvider(TOCArray);
    TOCList.labelField="theLabel";
    TOCList.y=75;
    TOCList.width=250;
    TOCList.height=350;
    addChild(TOCList);
    When I change the addChild(TOCList) to navBar.sceneMenu.addChild(TOCList) the list shows up formatted correctly, just no text.

    I figured it out with help from another web site's forum and the problem was that the MovieClip that I was loading into was masked, so the font needed to be embedded and my code...
         var myFormat:TextFormat = new TextFormat();
        myFormat.font="Tahoma";
        TOCList.setStyle("embedFonts", true);
        TOCList.setStyle("textFormat", myFormat);
    ...wasn't working, but I didn't know, because the text wasn't showing.
    The fix was actually to use the StyleManager...
    StyleManager.setStyle( "textFormat", new TextFormat("Arial") );
    StyleManager.setStyle( "embedFonts", true );
    ...to force all components to this style.
    I have no idea why the above code doesn't work. If anybody knows, please tell me!!!

  • Animate List component

    hello everyone,
    I've been working with Flex 3 for over a year and really want
    to get into customizing components the best way possible, so i've
    been digging into the classes. my first task is to create a smooth
    tween when scrolling a List component instead of the default
    "jumping" motion. So i decided to extend the list and do some
    function overriding:
    override protected function moveRowVertically(i:int,
    numCols:int, moveBlockDistance:Number):void
    var r:IListItemRenderer;
    trace(String(listItems
    [j]));
    for (var j:int = 0; j < numCols; j++)
    r = listItems[j];
    prev_y
    = r.y + moveBlockDistance;
    //trace(r.y +" "+(r.y+ moveBlockDistance)+" "+prev_y);
    TweenMax.to(r,0.5,{y:(r.y +
    moveBlockDistance),ease:Sine.easeOut});
    //r.move(r.x, r.y + moveBlockDistance);
    rowInfo
    .y += moveBlockDistance;
    I've found moveRowVertically to be the method that actually
    does the vertical row movement (called from the scrollVertically
    method in the ListBase class). As you can see, i've added the
    TweenMax where the object's move method was. This works
    normally when the tween time is set to 0 sec, the List scroll
    effect is the same as the stock component. But when TweenMax.to is
    changed to 0.5 sec, the animation behaves strangely. I believe this
    is partly because when a new object appears in the list it is
    immediately added to the list, so the method that controls the
    addChild needs to have the TweenMax animation also applied to. But
    also, there is another problem, when you click the scroll arrow
    before the TweenMax animation is complete, this function uses the
    current y poisition (in the middle of the animation) as opposed to
    the end y position- when the animation is complete. This is why the
    TweenMax positions the items correctly when the TweenMax duration
    is set to 0.
    I
    have an example here.
    When you click the scroll arrow and wait for the animation to
    complete, it works as the code expects. But when you click too fast
    or scroll the scrollbar thumb, you can see the unexpected behavior.
    SO what I believe needs to be added to the code is an array
    that stores the end y coordinate and have the class use that
    instead of the current y coordinate. I believe the best way to do
    this is to store the end y coordinate in the listItems
    [j] array so that i could call: TweenMax.to(r.end_y +
    moveBlockDistance),ease:Sine.easeOut}); and all would be fine (for
    the objects in the display, hopefully). But i cannot find the
    original as file where the listItems property is (aka:
    listContent.listItems as defined in the listItems get and set
    methods in ListBase.as). Here i could extend this and define a
    custom property. But a more important question is this: is it
    possible to define a custom property on the fly, so i wouldn't have
    to extend the listContent object (therefore, extending ListBase,
    then List... on down the line)?
    thank you all for your help!

    Ok I found out that it works fine in IE but not in FirefoX
    HOWEVER it does work fine in Firefox from another computer! I tried
    clearing out the cache but NOTHING...chan ANYONE PLEASE HELP
    ME???

  • How can I select an item from a list component with a seperate button

    This is a repost, I decided it'd probably be better here than
    in the general discussion board. I will try to delete the other
    one.
    Hello Everyone,
    This is my first post here. I am trying to figure out how to
    select an item within a list component with a button. This button
    is calling a function. I have searched for the past 3 hours online
    and I can't find anything about it. I thought perhaps I could set
    the selectedItem parameter, but that is read only, and I believe it
    returns an object reference rather than something like a number so
    even if i could set it, it would be pointless. I also found a get
    focus button, thought that may lead me somewhere, but I think that
    is for setting which component has focus currently as far as typing
    in and things like that. I am lost.
    Basically I am looking for a way to type this
    myList.setSelected(5); where 5 is the 5th item in the list.
    Any help would be much appreciated.

    Never mind found it. It is the property called selectedIndex
    and it is writable

  • How to populate list component via xml file?

    There is a TextArea component that should show the name and
    the description of the item selected in the list component. But I
    dont know how to populate list with external XML and what should be
    the coding in flash as well as what should be written in the XML.
    Please help.

    Here's an xml file listing a couple of brother comedy teams:
    <?xml version="1.0" encoding="UTF-8"?>
    <team>
    <brothers>
    <Marx>
    <name>Groucho</name>
    <name>Chico</name>
    <name>Harpo</name>
    <name>Zeppo</name>
    <name>Gummo</name>
    </Marx>
    <Howard>
    <name>Moe</name>
    <name>Curly</name>
    <name>Shemp</name>
    </Howard>
    </brothers>
    </team>
    Open a new .fla and save it in the same folder as the .xml
    file. Place a List Component on the Stage and name it (in this
    case, "comicTeams_list"). In the first frame write the following
    ActionScript:
    //create XML object and load external xml file
    var broList:XML = new XML();
    broList.ignoreWhite = true;
    broList.onLoad = processList; // this is a function that will
    be written below
    broList.load("populateList.xml");
    function processList(success:Boolean):Void{
    if(success){
    loadList();
    }else{
    trace("Load failure");
    function loadList():Void{
    var broName:String;
    var listEntries =
    broList.firstChild.childNodes[0].childNodes[0].childNodes.length;
    for(var i:Number = 0;i<listEntries;i++){
    broName =
    broList.firstChild.childNodes[0].childNodes[0].childNodes
    .childNodes[0].nodeValue;
    trace(broName);
    comicTeams_list.addItem(broName);
    //to make something happen when you click on a name in the
    List, create a Listener and function
    var broListListener:Object = new Object();
    broListListener.change = someAction; //"someAction" is a
    function to be written shortly
    //add the Listener to the List
    comicTeams_list.addEventListener("change", broListListener);
    function someAction(evtObj:Object):Void{
    var pickedBrother:String = evtObj.target.selectedItem.label;
    //write actions here, referencing pickedBrother variable
    The names of the Marx Brothers will appear in the box.
    This is written in AS2. When you post a question, it's a good
    idea include which version of ActionScript you're using.

  • Count the rows in a list-component

    Hi,
    How can I count the rows with a value in a list component?
    I thought it would be RowCount but as I figured out that shows the number of shown rows, not the number of rows with a value.

    Hi,
    Try list.dataProvider.length

  • List component row manipulation

    I have two questions regarding as3 list component:
    - I'd like to highlight and keep selected the item a user last selected from my list component. I've combed the live reference as well as google and must be typing the wrong search words. I can tell what label and index an item was that was selected but am not finding a way to highlight and keep highlighted the user's choice in the list component.
    - Also, I'm exploring the notion of inline buttons within a list's rows. If a user hovers their mouse over a row, a set of small buttons come up the user can click on for further functionality. This may be more of a make your own component answer but I'm exploring it nonetheless. Any thoughts or comments on this?
    Thanks!

    no something else is going on. Or perhaps you didn't explain your problem clearly.
    After servlet b calls getList() you have two servlets each having a reference to the same list
    A------\
    List
    B------/

Maybe you are looking for