Playing with PXContainerView

5 views
Skip to first unread message

St3fX

unread,
Feb 28, 2011, 5:55:27 PM2/28/11
to pixlib
Hey List,

I'm trying to play with the PXContainerView but unfortunately it
does'nt appears on my stage.

I have a main class which extends PXBaseDocument where I load several
pngs in a QueueLoader to build my app.

After the queue was loaded, I'm building buttons with that code on the
Main class:
private function onQueueLoadInit( event :
PXLoaderCollectionEvent ) : void
{
for( var i : String in dict )
{
var dp : DisplayObject = dict[ i ];
var sb : SimpleButton = new SimpleButton( null, i, mc );
sb.show();
}

PXLogManager.INFO( PXViewLocator.getInstance().keys );
}

dict is a Dictionary I populated with all the PXGraphicsLoader loaded.
PXLogManager.INFO( PXViewLocator.getInstance().keys ); returns a list
off all PXContainerView registered correctly.

My PXContainerView is as this:
package
{
import flash.display.Graphics;
import net.pixlib.log.PXLogManager;
import net.pixlib.view.PXContainerView;
import net.pixlib.plugin.PXPlugin;
import net.pixlib.view.PXAbstractView;

import flash.display.DisplayObject;
import flash.display.Sprite;

/**
* @author stef
*/
public class SimpleButton extends PXContainerView
{
private var back : Sprite;

public function SimpleButton( viewOwner : PXPlugin = null,
viewName : String = null, dpo : DisplayObject = null )
{
super( viewOwner, viewName, dpo );
}

override protected function onInitView() : void
{
super.onInitView();
PXLogManager.DEBUG( content.stage + " - " + size );
}
}
}

in this class, PXLogManager.DEBUG( content.stage + " - " + size );
returns null for the content.stage and a good PXDimension for the
size.

What did I forgot?

thanks,

Stef

Mike

unread,
Mar 1, 2011, 4:04:09 AM3/1/11
to pixlib
Hi St3fX,

Did you add your loaded mcs to the display list ?

St3fX

unread,
Mar 1, 2011, 6:14:51 AM3/1/11
to pixlib
Hi Mike,

thanks for your answer.
I was simply thinking that the PXGraphicsLoader or the PXContainerView
was adding its content automatically.
Reply all
Reply to author
Forward
0 new messages