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

Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified

Re: How to create a library for playbook ?

I found a solution to have a dynamic library by using swf.  Idea is simple:

1)  first we have to bulit the library as flex project and get an swf

2) import the swf to the src folder

3) using Loader call the .as classes inside the app. Ex:

in constructor of main sprite add the following          


//--> load library
            var request:URLRequest = new URLRequest("Library.swf");
            var loader:Loader = new Loader();
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
//<-- load library



then for loadHandler have following:


function loadHandler(event:Event):void
    var SwF:Object = event.target.content;
    var s:Sprite = SwF.newPage(stage.stageWidth,stage.stageHeight);

 After app compilation we will get a *.bar file whihch can be unzipped and our library.swf could be change with a new one . As result of zip the *.bar back and pull it to playbook we will get new features added for our app.


Solved. Thank you for every body.


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

Re: How to create a library for playbook ?

Have you looked at Module's?  A modile can implement an interface so not to break on load if something changes in the library.




Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How to create a library for playbook ?

I would expect, given the hashes that are in the MANIFEST.MF file, that unzipping a .bar, replacing any file with another one, and rezipping without updating the MANIFEST.MF file, would result in a broken package that will not install.  Have you actually succeeded at doing that operation, or was it just a guess so far that it would work if one did that? 


(If it worked, and you did update the hash, can you describe how you recalculated them?  I haven't seen it documented yet.)

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified

Re: How to create a library for playbook ?

Hi Peter. Every thing is working fine on my side , i digged a while to have that done. I was starting dirst using *.swc which works fine for static library. My target is to have a library whihch if it's replaced from the *.bar file with something new is working by having new features added in. A few tricks and logic and every thing could be done .