Dynamic viewstack/tabbar
hello,
i'm trying following work:
private function createtabbedviews(viewcount:int):void {
var viewstack:viewstack = new viewstack();
var tabs:tabbar = new tabbar();
var i:int;
var stacktraceview:stacktrace;
viewstack.id = "viewstack";
tabs.dataprovider = "viewstack";
(i = 0; < viewcount; i++) {
stacktraceview = createstacktraceview(dataprovider .stackwalk);
stacktraceview.label = "stacktrace " + (i + 1).tostring();
viewstack.addchild(stacktraceview);
}
this.addchild(viewstack);
this.addchild(tabs);
}
this function should create tabbar , viewstack based on arraycollection (dataprovider.stackwalk). works, line 'tabs.dataprovider = "viewstack";' throws error telling me can't find 'viewstack'. doing wrong here?
bonus question: i'd viewstack use 100% of available width, neither 'viewstack.width = "100%"' or 'viewstack.setstyle("width", "100%")' work. help?
regards,
ruud
i'm trying following work:
private function createtabbedviews(viewcount:int):void {
var viewstack:viewstack = new viewstack();
var tabs:tabbar = new tabbar();
var i:int;
var stacktraceview:stacktrace;
viewstack.id = "viewstack";
tabs.dataprovider = "viewstack";
(i = 0; < viewcount; i++) {
stacktraceview = createstacktraceview(dataprovider .stackwalk);
stacktraceview.label = "stacktrace " + (i + 1).tostring();
viewstack.addchild(stacktraceview);
}
this.addchild(viewstack);
this.addchild(tabs);
}
this function should create tabbar , viewstack based on arraycollection (dataprovider.stackwalk). works, line 'tabs.dataprovider = "viewstack";' throws error telling me can't find 'viewstack'. doing wrong here?
bonus question: i'd viewstack use 100% of available width, neither 'viewstack.width = "100%"' or 'viewstack.setstyle("width", "100%")' work. help?
regards,
ruud
i haven't looked @ in depth, first thing jumped out @ me this:
tabs.dataprovider = "viewstack";
you don't want pass string, want pass value: tabs.dataprovider = viewstack because have variable called viewstack - don't need assign id (you can, use id in mxml variable).
also use: viewstack.percentwidth = 100; viewstack.percentheight = 100;
tabs.dataprovider = "viewstack";
you don't want pass string, want pass value: tabs.dataprovider = viewstack because have variable called viewstack - don't need assign id (you can, use id in mxml variable).
also use: viewstack.percentwidth = 100; viewstack.percentheight = 100;
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment