Welcome, Guest
  • Author Topic: Text doesn't wrap in Flash Component Ticker  (Read 5081 times)

    jiffyloop

    • Server what's that
    • *
    • Posts: 22
    • Flash-db Rules
      • View Profile
      • Email
    I've been having some problems getting the text to wrap using the Flash Ticker Component. Anyone else had this problem?? Is there a solution or is this a known bug??

    Jiffy Loop ???

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Text doesn't wrap in Flash Component Ticker
    « Reply #1 on: 02/20/03, 04:25 »
    I'm having the same problem when populating using a dataProvider with label/data objects. Using just labels works fine, but with label/data don't show text. Since I was in a hurry, I just write my own without further search, but I think there should be an answer. Post if you find something.

    Jorge

    jiffyloop

    • Server what's that
    • *
    • Posts: 22
    • Flash-db Rules
      • View Profile
      • Email
    Re:Text doesn't wrap in Flash Component Ticker
    « Reply #2 on: 02/20/03, 11:58 »
    Freddycodes on Actionscript.com told me this:


    myTicker.setDataAllProperty("multiline", true);
    myTicker.setDataAllProperty("wordWrap", true);
    myTicker.setDataAllProperty("autosize", "center");

    It works!!

    Jiffy Loop


    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Text doesn't wrap in Flash Component Ticker
    « Reply #3 on: 02/21/03, 09:56 »
    Well, setting an array of objects as dataProvider doesn't seem to work:

    [script]
    myList = new Array("Flash-Db", "Yahoo", "FlashKit");
    myUrl = new Array("http://www.flash-db.com", "http://www.yahoo.com", "http://www.flashkit.com");
    myDataProvider = new Array(); //array to hold objects

    for(i in myList){ //add objects with label/data property to the array
       var item = {}
       item.label=myList;
       item.data=myUrl;
       myDataProvider=item;
    }

    ticker.setDataAllProperty("multiline", true);
    ticker.setDataAllProperty("wordWrap", true);
    ticker.setDataAllProperty("autosize", "center");
    ticker.setDataProvider(myDataProvider);
    [/script]

    Using a simple array works fine

    [script]
    myUrl = new Array("http://www.flash-db.com", "http://www.yahoo.com", "http://www.flashkit.com");
    ticker.setDataProvider(myUrl);
    [/script]

    Jorge
    « Last Edit: 02/21/03, 09:56 by Jorge Solis »

    Louis Simpson

    • Server what's that
    • *
    • Posts: 25
      • View Profile
      • Email
    Re:Text doesn't wrap in Flash Component Ticker
    « Reply #4 on: 02/27/03, 01:05 »
    Jorge thats because the FTicker component setDataProvider doesn't take the data/label properties like the rest of them. It takes regular text field properties.

    [script]
    myList = new Array("Flash-Db Flash-Db Flash-Db ", "Yahoo Yahoo Yahoo Yahoo Yahoo ", "FlashKit");
    myUrl = new Array("http://www.flash-db.com", "http://www.yahoo.com", "http://www.flashkit.com");
    myDataProvider = new Array(); //array to hold objects

    for(i in myList){ //add objects with label/data property to the array
       myDataProvider.push({text:myList,url:myUrl});
    }
    ticker.setDataProvider(myDataProvider);
    ticker.setDataAllProperty("multiline", true);
    ticker.setDataAllProperty("wordWrap", true);
    ticker.setDataAllProperty("autosize", "center");
    [/script]

    Also you need to assign the dataProvider before formatting the text so it will properly format them
    « Last Edit: 02/27/03, 01:06 by Louis Simpson »

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Text doesn't wrap in Flash Component Ticker
    « Reply #5 on: 02/27/03, 03:56 »
    Great, now it works   :)!

    Thanks
    Jorge

    samson1

    • Server what's that
    • *
    • Posts: 44
      • View Profile
    Re: Text doesn't wrap in Flash Component Ticker
    « Reply #6 on: 11/14/05, 19:50 »
    How do I set line wrapping on a LABEL component, being fed from a dataset?  I tried using the above, but doesn't work.  e.g.

    descript_txt.setDataProvider(data1_ds);
    descript_txt.setDataAllProperty("multiline", true);
    descript_txt.setDataAllProperty("wordWrap", true);


    I also tried

    descript_txt.setStyle("multiline", true);
    descript_txt.setStyle("wordWrap", true);

    Still doesn't work. Any ideas?

    Geoff

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Text doesn't wrap in Flash Component Ticker
    « Reply #7 on: 11/15/05, 03:46 »
    You should use a Cellrenderer class (with an MC and a multiline textfield)

    Jorge