RE: [Flashcoders] Re:Trying to set multiple images to 'export for AS'with JSFL
Yes, you're correct. Thanks! Cheers, Craig Bowman -Original Message- From: Henrik Andersson [mailto:he...@henke37.cjb.net] Sent: Tuesday, December 01, 2009 1:31 AM To: bowm...@shaw.ca; Flash Coders List Subject: Re: [Flashcoders] Re:Trying to set multiple images to 'export for AS'with JSFL Craig Bowman wrote: It's NOT a bug. A bitmap can't be assigned the attributes you want directly and never has. It must be wrapped inside a symbol, like a MovieClip. Not true, there is a fully working Bitmap symbol type just for this. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Re:Trying to set multiple images to 'export for AS' with JSFL
It's NOT a bug. A bitmap can't be assigned the attributes you want directly and never has. It must be wrapped inside a symbol, like a MovieClip. If you are in the Flash IDE and place a bitmap on the stage in frame one you'd notice this immediately. So in JSFL : // given a library of bitMaps turn them into movieClip symbols and then // link them to SomeClass and export all for AS on first frame var lib = fl.getDocumentDOM().library, dom = fl.getDocumentDOM(); var itemCount=lib.items.length, prefix=mc_, it, loopName, i; for(i=0;iitemCount;i++) { loopName=prefix + (i + 1); lib.selectItem(lib.items[i].name); lib.addItemToDocument({x:0,y:0}); dom.convertToSymbol(movie clip,loopName,top left); dom.deleteSelection(); // keep the stage tidy lib.selectItem(loopName); it=lib.getSelectedItems()[0]; with(it) { linkageExportForRS = false; linkageExportForAS = true; linkageClassName = SomeClass; linkageExportInFirstFrame = true; } } JSFL isn't exactly always elegant for doing things because the original methodology behind the Flash IDE is too closely mirrored. Cheers, Craig Bowman ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] RE: Movieclip in a remote shared object
Yes it is. 1. Decorate your MovieClip. 2. After applying the Decorator design pattern, use the registerClassAlias to include the object specific information as SharedObjects use AMF. Cheers, Craig Bowman www.techyoumedia.com Hello, Is it possible to store Movieclip in a remote shared object? Ktt ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] RE: how to set DataGridColumn textAlign
In AS3: Alignment of text for a column in a DataGrid component is handled indirectly through the TextFormat object which is used in styling text by the cellRenderer of a DataGridColumn. I often create custom cellRenderers for the DataGrid to handle pictures, video, radio button groups, comboboxes, etc. and aligning various items used in and by the cellRenderers is handled in this manner. Also something to note: There are errors in the component architecture in the way certain calculations were set up between objects. For example, the HeaderRenderer class of the fl.controls.dataGridClasses has one of these in the drawLayout function. You can simply derive a new class from the HeaderRenderer and then do an override on the drawLayout function to make the necessary adjustments. Without that, your HeaderText isn't going anywhere, regardless of how you want it aligned. Cheers, Craig Bowman http://www.techyoumedia.com http://www.techyoumedia.com/ -- Date: Mon, 12 Oct 2009 12:06:05 -0500 From: Andrew Sinning and...@learningware.com Subject: [Flashcoders] how to set DataGridColumn textAlign To: Flash Coders flashcoders@chattyfig.figleaf.com Message-ID: 4ad361fd.9020...@learningware.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed I'm trying to set the textAlign of a column in the DataGrid component. There are examples of how to do this in Flex, but the required methods/properties seem to be missing from fl...DataGridColumn. Thanks! -- ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] RE: How to set a TextFormat to the label of a TileList
1. TileList uses the ImageCell cellrenderer so. 2. Grab a copy of this from the component source and rename the file, the class, and constructor function to something like TileCell. 3. Remove the fl.controls.listClasses from the package name and place it in your project source. 4. Add import flash.text.TextFormat; to your import statements in the TileCell.as file. 5. Create a variable in the file. Ie. protected var myTextFormat:TextFormat; 6. In the constructor instantiate the new format ie. myTextFormat=new TextFormat(); myTextFormat.font=Univers 55; myTextFormat.color=0xff; etcetera. 7. Go to the listData setter function and at the beginning add setStyle(textFormat, myTextFormat); 8. Finally on your tileList change the cellRenderer ie. myTileList.setStyle(cellRenderer, TileCell); 9. Enjoy! cheers, Craig Bowman ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Re: Flash CS3 DataGrid wordWraping in a cell (Sidney de Koning)
Sid: Make a class that extends the CellRenderer class and. ..ack its quicker to show you the code. See below. This will do it for you. package { import fl.controls.listClasses.CellRenderer; // make a cell renderer class that allow wrapping of text public class MultiLineCell extends CellRenderer { public function MultiLineCell() { // constructor textField.wordWrap = true; textField.multiline = true; textField.autoSize = left; } override protected function drawLayout():void { // allow text to flow according to column width textField.width = this.width; super.drawLayout(); } } // end of class } // end of package Now just assign it to the required column. Ie: myDataGrid.getColumnAt(5).cellRenderer=MultiLineCell; Cheers, Craig Bowman ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] RE: AS3 DataGrid header text alignment problem
FYI I went into the component source code, found the bug and fixed it. It meant deriving a new class from the HeaderRenderer class and then going into the drawLayout function and changing the line textField.width = tmpWidth; to textField.width = width - (txtPad * 2) - paddedIconW; Yes I know the precedence of multiplication means I didn't really need to put the parenthesis around txtPad * 2 but I like to make things more readable. Anyway, assigning the DataGrid's headerRenderer style to the new HeaderRenderer class has everything working properly. Craig Bowman ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] AS3 DataGrid header text alignment problem
In working with the AS3 DataGrid and assigning a TextFormat object to the headerTextFormat everything works but the align property. I have assigned a TextFormatAlign.RIGHT and TextFormatAlign.CENTER constant to the TextFormat object align property in succession with no luck. Assigning TextFormat objects to cellrenderers for the datagrid works perfectly fine and the align property of the TextFormat object works perfectly there, just not when assigning to the headerTextFormat. I first build my TextFormat object and set properties as desired including the align property. Ie. var myText:TextFormat = new TextFormat(); myText Text.size = 18; myText.font = Arial Black; myText.align=TextFormatAlign.RIGHT; myText.color=0x00; myGrid.setStyle(headerTextFormat,myText); This appears to be a bug which is consistent for AS3 in both CS3 and CS4. I also noticed in all of the examples provided by Adobe they never do anything with alignment on the header text because if they did they would have found this issue immediately. Unless I've missed something obvious, has anyone been able to get the DataGrid headerText to align other than left? Craig Bowman ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] AS3 DataGrid header text alignment problem.
(Please Disregard typo in previous posting) In working with the AS3 DataGrid and assigning a TextFormat object to the headerTextFormat everything works but the align property. I have assigned a TextFormatAlign.RIGHT and TextFormatAlign.CENTER constant to the TextFormat object align property in succession with no luck. Assigning TextFormat objects to cellrenderers for the datagrid works perfectly fine and the align property of the TextFormat object works perfectly there, just not when assigning to the headerTextFormat. I first build my TextFormat object and set properties as desired including the align property. Ie. var myText:TextFormat = new TextFormat(); myText.size = 18; myText.font = Arial Black; myText.align=TextFormatAlign.RIGHT; myText.color=0x00; myGrid.setStyle(headerTextFormat,myText); This appears to be a bug which is consistent for AS3 in both CS3 and CS4. I also noticed in all of the examples provided by Adobe they never do anything with alignment on the header text because if they did they would have found this issue immediately. Unless I've missed something obvious, has anyone been able to get the DataGrid headerText to align other than left? Craig Bowman ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders