Flash CS3 and the TileList

July 15th, 2007

**UPDATE July 19th**
This code uses FlashVars and SWFObject. I ran into a problem, as we continued to build, w/ getting data to show in the swf.
To fix this error switch out[as]
so.addParam(”wmode”, “transparent”);
[/as]with[as]
so.addParam(”wmode”, “opaque”);
[/as]or delete it all together

**UPDATE July 19th**

I’m working on a TileList for work for a peek at our Portfolios. Right now I’m trying to adapt the TileList to my liking with back and forth button instead of the scrollpanel. But I wanted to share the wealth w/ what I’ve dug up on this Flash CS3 component. I find most of what’s online to be really crappy and not too robust.

I’ve provided a zip to my work: titelist.zip

[as]

import fl.controls.ScrollBarDirection;
import fl.events.ListEvent;
import fl.controls.listClasses.*;
import flash.net.*;
import flash.events.*;
import fl.data.*;

var xml:XML;
// this set a var for parameter xmlData that is set in the
// SWFObject
var _xmlData:* = root.loaderInfo.parameters.xmlData;

// if someone for got to set the xmlData parameter
// load default xml
if(_xmlData == undefined)
{
_xmlData = “xml/default.xml”
}

trace(root.loaderInfo.parameters.xmlData);
// request xml file
var requester:URLRequest = new URLRequest(_xmlData as String);
//load xml file
var loader:URLLoader = new URLLoader(requester);

//set dataprovider to the loaded xml
function setItems(evt:Event):void
{
xml = XML(evt.target.data);
trace(xml);
list.dataProvider = new DataProvider(xml);
}

loader.addEventListener(Event.COMPLETE, setItems);

//on click of item go to data/url
function onItemClick(e:ListEvent):void
{
navigateToURL(new URLRequest(e.item.data),”_self”);

}

list.addEventListener(ListEvent.ITEM_CLICK, onItemClick);

// Set scroll bar direction
list.direction = ScrollBarDirection.HORIZONTAL;

// position TileList and set column and row values
list.move(0,0);
list.columnWidth = 122;
list.rowHeight = 112;

list.width = 366;
list.height = 112;
list.columnCount = 3;
list.rowCount = 1;
[/as]

Last 5 posts in as3

Last 5 posts in components

Last 5 posts in flash

Last 5 posts in flash CS3

Last 5 posts in work

Last 5 posts in XML

Entry Filed under: XML, as3, components, flash, flash CS3, work

4 Comments Add your own

Leave a Comment

Required

Required, hidden

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Trackback this post  |  Subscribe to the comments via RSS Feed