|
1
on: July 28, 2010, 09:26:40 AM
|
||
| Started by jslice390 - Last post by HelenJames | ||
|
The similar subject was already observed somewhere at this thread
|
||
|
2
on: June 29, 2010, 08:50:08 PM
|
||
| Started by Ashera - Last post by Ashera | ||
|
I'm trying to make a list with a custom cell renderer, where each cell has two rows of data, in Flash CS4. If I change myList.cellClass to CustomCell, the list renders with some default height, and the list cells overlap each other.
I can set the __width and __height properties to change how much space the List thinks CustomCell needs, but it doesn't actually resize the component. Is there any way to get a custom Cell/ICellRenderer to resize its content? Is there a way other than setting the __height property to keep the cells from overlapping? Library symbol for CustomCell: - Rectangle background - 3 dynamic TextFields in two rows Things I've tried: - class CustomCell extends Cell -- I overrode layout() to assign the TextField properties. Can't resize the CustomCell itself, just the space it takes up. - class CustomCell extends StyledContainer implements ICellRenderer -- Results basically the same as above. - class CustomCell extends Sprite implements ICellRenderer -- CustomCell is automatically sized to fit the default List cell height and the List's width. No way to resize. |
||
|
3
on: June 18, 2010, 06:15:15 AM
|
||
| Started by epanda - Last post by Ricovitch | ||
|
Hello,
This is the first time i use this framework (i followed suggestion from minimalcomps author here : http://www.bit-101.com/blog/?p=2535) Seems a very nice library on the first glance. About the ComboBox, i got the same problem at first (nothing showing). In fact i was not seeing nothing, but just a label. I just wanted to add to this thread, that adding this line of code made the comboBox appear : combo.setSize (200, 22); That's maybe because i'm not using the Container class, but adding the ComboBox directly to my view ? |
||
|
4
on: June 10, 2010, 11:04:09 AM
|
||
| Started by shagga - Last post by shagga | ||
|
Hi there,
razor seems to be a very cool framework, i just had a few hours to try it out. Sadly i just can't seem to get the "styling", or "customization" of the components to work. ![]() Specifically, i am trying to have a ScrollBar on stage, but with custom graphics (.png files) as the up / down (left / right) buttons, thumb and background. (background could better be a drawn gradient in a shape or something, is that possible too?) I try to use code snippets from the examples, but any added rule to the standard stylesheet doesn't take any effect at all. In my test class: Code: protected var _scrollbar:ScrollBar; All in all, a little tutorial on this subject would be very awesome! // setStyles() gets called in the class constructor before calling super(); protected function setStyles():void { // NOTE: In our sample application we created a new ControlFactory // for each example. You can also get a reference to the global rootStyleSheet // from: Settings.rootStyleSheet OR ControlFactory.defaultFactory.rootStyleSheet var sheet:StyleSheet = ControlFactory.defaultFactory.rootStyleSheet; // sbCustomStyle = new StyleSheet(); sheet.addRule("_scrollbar", new StyleSheet({padding_l: 150})); sheet.addRule("_scrollbar Arrow", new StyleSheet(null)); sheet.addRule("_scrollbar UpButton", new StyleSheet({skinClass: ModuleAssets.sb_arrow_left}, SkinBitmap)); sheet.addRule("_scrollbar DownButton", new StyleSheet({skinClass: ModuleAssets.sb_arrow_right}, SkinBitmap)); sheet.addRule("_scrollbar Thumb", new StyleSheet({skinClass: ModuleAssets.sb_drag_bg}, SkinBitmap)); } override protected function construct():void { _stagingArea = new Pane(); _stagingArea.label = "Scrollbar Test"; addChild( _stagingArea ); _scrollbar = ControlFactory.defaultFactory.create(ScrollBar) as ScrollBar; _scrollbar.setScrollProperties(100,0,500); // pageSize, minimum value, maximum value _scrollbar.horizontal = true; _scrollbar.roundPosition = true; // round the scrollbar position to the nearest whole number _scrollbar.addEventListener(ScrollBar.E_SCROLL, onScrollBarScroll); _stagingArea.addChild(_scrollbar); } override protected function layout():void { _stagingArea.move(__width/4 + 10, __height/2+5); _stagingArea.setSize(__width *3/4 - 10, __height/2 - 5); _scrollbar.setSize(Math.floor(__width/2), 15); _scrollbar.move(20, 40); } ![]() Thank you! |
||
|
5
on: May 07, 2010, 01:46:01 AM
|
||
| Started by zjuyyl - Last post by zjuyyl | ||
|
Quote var sheet:StyleSheet = ControlFactory.defaultFactory.rootStyleSheet; // Create the stylesheet for the buttons. // The ButtonStyles class has constructor parameters for easily creating a button skin var buttonStyles:StyleSheet = new ButtonStyles(button_up, button_over, button_down, button_disabled); // Add some additional rules to the stylesheet we just created. // Passing a "*" for the rule name is the same as adding the styles to everything the stylesheet modifies // like a wildcard. buttonStyles.addRule("*", new StyleSheet({padding_l: 40, padding_t: -2, align: "left", bold: false, fontFace:"Maxine", fontSize:24, fontColor:0x0000cc, embedFonts: false, sharpText: false})); // Apply the stylesheet to every Button instance. sheet.addRule("myButton", buttonStyles); It seems that fontColor doesn't make sense. |
||
|
6
on: May 06, 2010, 09:53:11 PM
|
||
| Started by zjuyyl - Last post by zjuyyl | ||
|
thanks, I found that the App cant use as the default Application and the razor must do setSize in order to instance properly.
|
||
|
7
on: May 06, 2010, 08:48:57 AM
|
||
| Started by zjuyyl - Last post by ash | ||
|
Hi there,
The code is fine. You need to make sure that you created a new App(), set the size, and added it to the stage: Quote var app:App = new App(); app.setSize(400, 400); addChild(app); As for #2. Could you put code in the createChildren method to go out and get the correct localization? |
||
|
8
on: May 06, 2010, 12:14:45 AM
|
||
| Started by zjuyyl - Last post by zjuyyl | ||
|
1,about List
Quote package I use the sample code to create List, but not list was found in the stage.{ import flash.events.Event; import razor.controls.ComboBox; import razor.controls.List; import razor.core.Container; import razor.core.ControlFactory; import razor.skins.StyleSheet; import razor.skins.plastic.PlasticStyleSheet; import razor.skins.plastic.presets.Regular; public class App extends Container { public var controlFactory:ControlFactory; protected var list:List; protected var combo:ComboBox; protected var listProvider:Array = ["One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"]; public function App() { this.stage.nativeWindow.activate(); // NOTE: In our sample application we create a new ControlFactory // for each example. You normally wouldn't need to do this. controlFactory = new ControlFactory(); controlFactory.rootStyleSheet = new PlasticStyleSheet(); controlFactory.defaultStyle = new Regular(); super(); } override protected function construct():void { // Here we use our custom controlFactory instance. // You could also use the static ControlFactory.create(...) method list = controlFactory.create(List) as List; list.dataProvider = listProvider; list.addEventListener(List.E_SELECT, onListSelect); addChild(list); combo = controlFactory.create(ComboBox) as ComboBox; combo.dataProvider = listProvider; combo.addEventListener(ComboBox.E_SELECT, onComboSelect); combo.label = "Select one..."; addChild(combo); } override protected function layout():void { list.setSize(__width/2-20, __height - 20); list.move(10,10); combo.setSize(__width/2-20, 22); combo.move(__width/2+10,10); } protected function onListSelect(e:Event):void { combo.selectedIndex = list.selectedIndex; } protected function onComboSelect(e:Event):void { list.selectedIndex = combo.selectedIndex; } } } 2, about create component with params. I create a custom component with i18n, so I need preinit the lang values,how could I do that? |
||
|
9
on: April 24, 2010, 12:25:09 PM
|
||
| Started by epanda - Last post by epanda | ||
|
Hello I use the Google API weather and this works locally since
my pc. However, when I turned my flash anim free from my website, I get the following security problem: Quote securityErrorHandler: [SecurityErrorEvent type = "securityError" bubbles = false cancelable = false eventPhase = 2 text = "Error # 2048"] [/ quote] Yet at the root of my site I v' got a crossdomain.xml file that any permit. Quote - <cross-domain-policy> <allow-access-from domain="*" /> </ Cross-domain-policy> [/ Quote] It is noteworthy that my animated flash is not in the same directory as The crossdomain.xml policy file, maybe it come from there. Could someone help me, I do not understand what I'm authorize more Thank you |
||
|
10
on: April 16, 2010, 09:55:45 AM
|
||
| Started by Java - Last post by Java | ||
|
OK i don't knew it:)
|
||

