Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Highlighted
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Community Library 6 Updated

Revision 6 of the community library has been posted to Google Codes at:

http://code.google.com/p/playbook-as3-lib/downloads/list

 

It has been awhile for an update, but here is a high level list of the changes:

  • TextInput fontSize added.
  • TimePicker center colons added.
  • AirtimeAlertDialog removed (no longer needed).
  • Some TabletApplication functions renamed to be more consistent.
  • TabletPagedAppBarApplication class added to integrate application bar and pages into one application.
  • TabletApplication addLocaleListener added to manage device locale manager correctly.
  • Alert code added so items do not get re-added on the draw function.
  • Alerts will automatically rotate when the screen orientation changes.
  • Slight changes to default alert sizes due to orientation changes.
  • Pages will automatically adjust/resize when device orientation changes
  • TabletApplication can request an array of services.  This currently allows for AudioManager and Device functionality.

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.

Developer
Posts: 350
Registered: ‎01-21-2011
My Device: Curve 8900 (Personal) / Bold 9650 (Work)
My Carrier: Regional

Re: Community Library 6 Updated

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".

Developer
Posts: 350
Registered: ‎01-21-2011
My Device: Curve 8900 (Personal) / Bold 9650 (Work)
My Carrier: Regional

Re: Community Library 6 Updated

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\playbook\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?

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Community Library 6 Updated

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 );
            }
        }