I would create a new array collection that holds the dateAdded from your
entries ArrayCollection. Then to go to a specific page I would use
getItemIndex to find the page number and use goToPage with the int
returned.
private var datesAdded:ArrayCollection = new ArrayCollection();
public function buildBook():void
{
for (var i:int = 0; i < entries.length; i ++)
{
myBook.addChild(entries.getItemAt(i).dateAdded);
datesAdded.push(entries.getItemAt(i).dateAdded as String);
}
}
// Go to page 21220100345
myBook.goToPage(datesAdded.getItemIndex("21220100345");
--- In [email protected], Wally Kolcz <wko...@...> wrote:
>
> 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:ArrayCollection;
> ...
> 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(21220100345)
>