FORUMS: list search recent posts

flash listbox

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Crystal lee
flash listbox
on Mar 28, 2011 at 3:42:05 pm

My single mouse click listener is acting like a double click when live. What am I doing wrong?

Flash CS3 AS3
Mac & PC.. all browsers



var myTextFormat:TextFormat = new TextFormat();
myTextFormat.size = 14;
myTextFormat.font = "Myriad Pro";
myTextFormat.color = 0x363636;
myTextFormat.leftMargin = 30;
lb.rowHeight = 30;

lb.setRendererStyle("textFormat", myTextFormat);

import fl.events.ListEvent;

var xml:XML;
var xmlPath:String = "html/pathtofile.xml";
var loader:URLLoader = new URLLoader();
var req:URLRequest = new URLRequest(xmlPath);
loader.addEventListener(Event.COMPLETE, xmlLoaded);
loader.load(req);

lb.addEventListener(MouseEvent.CLICK, Clicked)


function xmlLoaded(event:Event):void{
var item:Object;
xml = new XML(event.target.data);

for each(var movieItem:XML in xml.movies.movie){
item = new Object();
item.label = movieItem.title.toString();
item.data = movieItem.link.toString();
lb.addItem(item);
}
}

function Clicked(event:ListEvent):void{
var linkTo:String = lb.selectedItem.data.toString();
navigateToURL(new URLRequest(linkTo), '_parent');
}





Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]