Formatting text
Date: Sep 4, 2007
Views: 1331
Question:
Hi, I receive this code from support to display HTML text in Flow list:
function dspText(event:Object) {
myFlow.selectItem(event.target);
myDescription.text = myFlow.getSelectedItem().description;
So, I add this code on the first frame of my .fla file, but I don't really know how to load the text and how to apply the styles on it.
function dspText(event:Object) {
myFlow.selectItem(event.target);
myDescription.text = myFlow.getSelectedItem().description;
So, I add this code on the first frame of my .fla file, but I don't really know how to load the text and how to apply the styles on it.
Answer:
| andreit (Admin) |
The code should be used in conjunction with the following tutorial http://www.afcomponents.com/tutorials/flow_list/32/. Text styles can be applied to the myDescription Text Field. Here is the complete code: //Display image description text function dspText(event:Object){ myFlow.selectItem(event.target); myDescription.text = myFlow.getSelectedItem().description; } // Add Event Listeners // display first image description myFlow.addEventListener("ITEM_LOAD_COMPLETE",dspText); // display description once image is clicked myFlow.addEventListener("ITEM_ON_PRESS", dspText); // display description once scroll bar is scrolled myScrollBar.addEventListener("scroll", dspText); |