I'm working with the Coverflow library by Doug McCune available here - http://bit.ly/zCc11.
In the example included, he has created some panels inside a CoverFlowContainer. There are other examples of him populating the coverflow from an RSS feed on the page linked above but he doesn't include the source for these :(
I will eventually be retrieving data from a web service to add to the coverflow however I'm starting with this simple example:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" horizontalAlign="center" verticalAlign="middle" xmlns:containers="com.dougmccune.containers.*" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.TextArea;
public var articlePanel:Panel = new Panel();
public var articleTextArea:TextArea = new TextArea();
private function init() : void
{
articlePanel.addChild(articleTextArea);
articlePanel.title = "test tile"
articleTextArea.text = "article1" + "\n" + "www.article.com" + "\n" + "hello this is article 1";
coverflow2.addChild(articlePanel);
}
]]>
</mx:Script>
<mx:VBox id="box" verticalGap="0" height="306" width="100%" maxWidth="600" maxHeight="300" >
<containers:CoverFlowContainer id="coverflow2" width="100%" height="244"
horizontalGap="40" borderStyle="inset" backgroundColor="0x000000"
segments="6" reflectionEnabled="true">
<mx:Panel id="testpanel" width="200" height="200" title="Mxml title">
<mx:DataGrid width="100%" height="100%">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="col1"/>
<mx:DataGridColumn headerText="Column 2" dataField="col2"/>
<mx:DataGridColumn headerText="Column 3" dataField="col3"/>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
<mx:Panel id="buttonpanel" width="200" height="200" title="Mxml title">
<mx:Button id="myButton" label="Change title" click="buttonpanel.title = ('hello') "/>
</mx:Panel>
</containers:CoverFlowContainer>
</mx:VBox>
</mx:Application>
I've defined some panels in the mxml and set creationComplete=init() so that the new panel I've created in actionScript will be added to the coverflow container.
When I launch the application it displays the two pre-defined panels but not the one I have created in actionscript.
Any ideas? Is there a better way of doing this?
Cheers.