I dont need the interation. I need the value of the record as the Class instance name (id). For example. Using the code example I sent I would need the first recond to be:

var 2202101034523:Page = new Page();

That would be 2/20/2010 at 3:45am (example). I can do the conversion but have no idea on how to assign that ID in AS. Can I have a holder variable such as:

..in the loop..
var date:String = df.format(entries.getItemAt(i).dateAdded).toString();
var date:Page = new Page();

On 2/22/2010 9:45 AM, claudiu ursica wrote:
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 <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