When you iterate you can assign an id of "item_" and the current iterated item. 
I haven't used the component but I'm sure you can assign that id somehow to the 
page.
C





________________________________
From: Wally Kolcz <[email protected]>
To: [email protected]
Sent: Mon, February 22, 2010 4:14:43 PM
Subject: [flexcoders] Dynamically naming classes

   
I am using Ruben Swieringa's flip book 
(http://www.rubenswieringa.com/blog/flex-book-component-beta) to create 
a journal for a project which has a Book class and Page Class and a 
really cool goToPage() method. I am using a loop to add Pages based on 
an ArrayCollection record (dateAdded) and would like to name the Page 
instance the rendered version of the date. Problem is I cannot find 
anywhere to name the class based on a dynamical element. I googled all 
around for it, but haven't come up with a working solution in the Flex 
enviornment. I want to do something like this:

[Bindable] public var entries:ArrayCollec tion;
...
public function buildBook(): void {
for (var i:int = 0; i < entries.length; i ++){
var entries.getItemAt( i).dateAdded: Page = new Page();
...Add content, define styles, etc...
myBook.addChild( e.getItemAt( i).dateAdded) ;
}
}

The end result would be a page with the id of 21220100345 and I can do 
the flip to it using the .goToPage(212201003 45)


 


      

Reply via email to