11-17-2011 12:16 PM
Revision 6 of the community library has been posted to Google Codes at:
http://code.google.com/p/playbook-as3-lib/download
It has been awhile for an update, but here is a high level list of the changes:
An example AS3 application is also provided that utilizes the library. It started as a test bed for the library and will be expanded to meet different tests and show examples of how certain things work. It currently has pages to test alert dialogs and a page to play with the video camera.
12-07-2011 04:36 PM
jtegen,
You've been busy! Library is quite different in this version than it was in version 5. Having said that, however, I really like what you've done. It'll take me a while to convert our app over to it, but I like what you've done. Despite taking so long to post, I think I speak for many when I say, "Thank you".
12-07-2011 05:49 PM
jtegen,
As a suggestion, in the next release a "NextPage" and "PreviousPage" feature would be nice. It'd make it easy to have a unified navigation bar using the TabletPagedAppBarApplication. I've faked it using a check against the current index and total number of indexes. It then either +1 or -1 the index if it's not at either end.
However, setPageIndex keeps returning a "Cannot access a property or method of a null object reference." error.
TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.lib.playbook.views::PageViewStack/setPageIndex()[C:\data\flex451\playbook-as3-lib\src\com\lib\pl aybook\views\PageViewStack.as:135] at KitchenSink/nextPage()[C:\Documents and Settings\jpinkerton\Adobe Flash Builder 4.6\Kitchen Sink\src\KitchenSink.as:89]
For reference, the code I'm using to advance an index:
private function nextPage(e:Event):void {
var i:int = this.page_stack.currentIndex;
if(i == pvsIndices) {
trace("End of line.");
} else {
trace("Leaving Index: " + i);
this.page_stack.setPageIndex(i + 1, PageViewStack.RIGHT_LEFT);
}
hideBar();
}
Is there a better method of doing this that I'm not aware of?
12-08-2011 08:53 AM
Good idea.
Not certain what line 135 is since in my code that is a blank line. I beleive the index you are passing is out of bounds. I added the following to the library, so you should be able to copy/paste this. I tested it and it worked fine.
////////////////////////////////////////////////////////////////////// public function nextPageIndex( direction : String ) : void { if( this._current_index + 1 == this._pages.length ) { this.setPageIndex( 0, direction ); } else { this.setPageIndex( this._current_index + 1, direction ); } } ////////////////////////////////////////////////// /////////////// public function previousPageIndex( direction : String ) : void { if( this._current_index - 1 < 0 ) { this.setPageIndex( this._pages.length - 1, direction ); } else { this.setPageIndex( this._current_index - 1, direction ); } }