tag:blogger.com,1999:blog-55864520998625408572024-03-08T07:13:48.380-05:00The Flex Non-DocsFor all those secrets in Flex, those that aren't known, those that aren't published, or those that are just hard to find for some unknown reason, like percentWidth.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.comBlogger48125tag:blogger.com,1999:blog-5586452099862540857.post-22748616511941300722007-06-24T11:14:00.000-04:002007-06-24T12:10:01.037-04:003rdParty.libraries<a href="http://code.google.com/p/as3httpclient/">as3httpclient</a> - extend HTTP/HTTPS API (Abdul Qabiz)<br /><a href="http://code.google.com/p/israfil-mojo/">israfil-mojo</a> - Maven 2 plugin (Israfil Consulting Services)<br /><a href="http://code.google.com/p/xpath-as3/">xpath-as3</a> - XPath (Peter Hall)<br /><a href="http://code.google.com/p/as3-rpclib/">as3-rpclib</a> - an RPC library (akeemphilbert)<br /><a href="http://code.google.com/p/flexlib/">flexlib</a> - Component Library (Adobe People)<br /><a href="http://code.google.com/p/as3corelib/">as3corelib</a> - Utility Library (Adobe People) *May be integrated into flex 3<br /><a href="http://www.aswing.org/">ASwing</a> - GUI Framework (Team)<br /><a href="http://code.google.com/p/adobe-php-sdk/">adobe-php-sdk</a> - (Mike Potter - Adobe, et al)<br /><a href="http://code.google.com/p/as3flexunitlib/">as3flexunitlib</a> - Unit Testing Framework (Adobe)<br /><a href="http://code.google.com/p/as3xmpp/">as3xmpp</a> - XMPP Library (Daniel Dura)<br /><br />Sites:<br />http://www.riaforge.org<br />http://osflash.orgDanhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com42tag:blogger.com,1999:blog-5586452099862540857.post-79025811302829485272007-05-27T12:04:00.000-04:002007-05-27T12:34:17.423-04:00metadata.EmbedGeneral Properties:<br /><blockquote>_column<br />_file<br />_line<br />_pathsep<br />_resolvedSource<br />exportSymbol (name given to symbol which can be referenced your app?)<br />mimeType (Documented)<br />source (Documented)<br />symbol (Documented)<br /></blockquote>Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-73248354249823324972007-05-27T11:49:00.000-04:002007-05-27T11:58:26.583-04:00metadata.DeprecatedDeprecated appears to function the same way as Exclude/ExcludeClass. Adding the Deprecated tag to a class, method, or property removes the item from the asdocs. It also removes the item from the Content Assist of FlexBuilder although it can still be used if manually typed. I expected the compiler to throw a warning telling me that I was using a deprecated function, but I could not get this to occur.<br /><br />Based on what I've found, I'd expect the tag to be used in one of the following ways:<br /><br /><code>[Deprecated] // no additional data<br />[Deprecated("This use is Deprecated")] // a message to display with the warning<br />[Deprecated(replacement="Use function x instead")] // identification of item that replaced deprecated item</code>Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com1tag:blogger.com,1999:blog-5586452099862540857.post-28476080610174741492007-05-20T12:30:00.000-04:002007-05-20T12:49:12.251-04:00mx.rpc.soap.WebService.ActionScriptExample<?xml version="1.0" encoding="utf-8"?><br /><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="creationApplicationListener(event)"><br /> <mx:Script><br /> <![CDATA[<br /> import mx.events.FlexEvent;<br /> import mx.rpc.events.FaultEvent;<br /> import mx.rpc.events.ResultEvent;<br /> import mx.rpc.soap.LoadEvent;<br /> import mx.rpc.soap.WebService;<br /><br /> public var _webService:WebService; // web service<br /> public var _webServiceLoaded:Boolean = false; // flag noting when wsdl has been loaded<br /><br /> public function initWebService():void {<br /> // initializes webservice<br /> if (!_webService) {<br /> _webService = new WebService();<br /><br /> // assign wsdl url<br /> _webService.wsdl = "http://www.domain.com/HelloWorld/Service.asmx?WSDL"; // replace this url<br /><br /> // add listeners<br /> _webService.addEventListener(LoadEvent.LOAD, load_listener);<br /> _webService.addEventListener(ResultEvent.RESULT, result_listener);<br /> _webService.addEventListener(FaultEvent.FAULT, fault_listener);<br /><br /> // load wsdl<br /> _webService.loadWSDL();<br /> }<br /> }<br /><br /> public function callHelloWorld():void {<br /> initWebService(); // init webservice<br /> if (_webServiceLoaded) { // is wsdl is loaded<br /> _webService.HelloWorld(); // call web service method called "HelloWorld" with no parameters<br /> } else { // else<br /> callLater(callHelloWorld); // wait a frame and try again<br /> }<br /> }<br /><br /> public function load_listener(event:LoadEvent):void {<br /> _webServiceLoaded = true; // mark wsdl as loaded so we know we can use the web service<br /> }<br /><br /> public function result_listener(event:ResultEvent):void {<br /> trace(event.result); // traces result of webservice method which in this example is "Hello World"; <br /> }<br /><br /> public function fault_listener(event:FaultEvent):void {<br /> trace(event.fault); // traces information about failure <br /> }<br /><br /> public function creationApplicationListener(event:FlexEvent):void {<br /> // once application is loaded, call web service<br /> callHelloWorld();<br /> }<br /><br /> ]]><br /> </mx:Script><br /></mx:Application>Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com5tag:blogger.com,1999:blog-5586452099862540857.post-79003202895125972972007-05-14T19:16:00.000-04:002007-06-02T21:39:47.275-04:00FAQ.limitationsflash.display.BitmapData has a a 2880 limitation on both its width and height. (<a href="http://livedocs.adobe.com/flex/201/langref/flash/display/BitmapData.html">LiveDocs Reference</a>)<br /><br />Children of the flash.dispay.Stage (and there are unconfirmed reports that children of all all flash.display.DisplayObjectContainers) have a minimum/maximum x/y value of +/-8191. Exceeding this limitation causes the child to not be displayed. (<a href="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg62017.html">Reference</a>)<br /><br />"The minimum swf is about 135." I'm guessing this is for a Flash swf and not a flex swf. (<a href="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg63373.html">Reference</a>)<br /><br />The maximum upload/download file size <span style="font-style: italic;">officially</span> supported by FileReference is 100 MB (<a href="http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html#download%28%29">LiveDocs</a>). It has been widely reported that Flex/Flash unofficially will allow much larger file sizes without any problem.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com2tag:blogger.com,1999:blog-5586452099862540857.post-13562829399384980992007-05-12T22:29:00.000-04:002007-05-20T12:59:01.382-04:00toplevel.XML.toString()The short version: If the XML node is a simple text node, the text of the node is returned. Otherwise the entire node is returned as a String. To always return the entire node, use <code>XML.toXMLString()</code>.<br /><br />The long version: <a href="http://livedocs.adobe.com/flex/201/langref/XML.html#toString()">check XML.toString() on the livedocs</a>.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com1tag:blogger.com,1999:blog-5586452099862540857.post-91455002937924451362007-05-12T21:52:00.000-04:002007-05-14T19:16:52.156-04:00toplevel.XML.Traversing XML structuresI have found Adobe's documentation on "<a href="http://livedocs.adobe.com/flex/201/html/13_Working_with_XML_169_08.html">Traversing XML Structures</a>" to cause a little confusion. Nothing Adobe says is wrong. There aren't any features that they've hidden from you. But if you only read parts of the documentation you can get confused fairly easily.<br /><br />Confusion can be boiled down to one concept in the "Accessing parent and child nodes" substopic. To paraphrase, if you have the variable:<br /><br /><code>var myXML:XML = <order><book><title>Dictionary</title></book></order>;</code><br /><br />since there is only one book tag and that book tag has only one child, you don't have to use indexes when traversing the XML. In other words, you can use either of the following:<br /><br /><code>myXML.book[0].title[0];<br />myXML.book.title;</code><br /><br />Well it depends on how you are using the variables. The top statement returns an object of XML type. The bottom statement returns an object of XMLList type. This can be important depending on what you are using the result for. For example, let's say you are trying to determine if <code>myXML.book[0]</code> has any title children, you have a few options. Two of them are:<br /><br /><code>var test1:Boolean = (myXML.book[0].title[0] != null);<br />var test1:Boolean = (myXML.book[0].title.length() != 0);</code><br /><br />Notice that if <code>myXML.book[0]</code> has no children and you try to check that is has children using <code>(myXML.book[0].title != null)</code>, the check will always evaluate to true because the left side of the statement will always evaluate to an XMLList even if the XMLList has a length of 0.<br /><br />This is more important because almost all XML and XMLList functions (such as the attribute (@), decendent (..), etc) work this way and return XMLLists. The only common function that returns an XML object is getting an XML node by index. So if you're having trouble using these function, make sure this confusion isn't what is tripping you up.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.comtag:blogger.com,1999:blog-5586452099862540857.post-28243196397898356722007-05-05T15:38:00.000-04:002007-05-05T15:52:17.860-04:00flash.text.TextField.pasteRichText()Definition: <code>internal function pasteRichText(richText:String):Boolean</code><br /><code>richText</code> in <a href="http://nondocs.blogspot.com/2007/05/flashtexttextfieldflashrichtext.html">flashrichtext</a> format.<br /><br />This function is only used if <code>TextField.useRichTextClipboard</code> is true and the text to be pasted was copied from a field where <code>useRichTextClipboard</code> was true.<br /><br />This funcation is called when the user pastes flashrichtext into a TextField and appears to simply be a proxy function for <code><a href="http://nondocs.blogspot.com/2007/05/flashtexttextfieldinsertxmltext.html">insertXMLText()</a></code><br /><br />To override this function see <a href="http://nondocs.blogspot.com/2007/04/how-tohack-internal-namespace.html">How To.Hack the "internal" namespace</a>Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-7461072834321081732007-05-05T15:07:00.000-04:002007-05-05T15:37:50.955-04:00flash.text.TextField.copyRichText()Definition: <code>internal function copyRichText():String</code><br />The value returned is in <a href="http://nondocs.blogspot.com/2007/05/flashtexttextfieldflashrichtext.html">flashrichtext</a> format.<br /><br />This function is only used if <code>TextField.useRichTextClipboard</code> is true.<br /><br />This function does not appear to actually perform the copy function. Instead it simply returns the value to copy which is just the result of <code><a href="http://nondocs.blogspot.com/2007/05/flashtexttextfieldgetxmltext.html">getXMLText</a>(selectionBeginIndex,selectionEndIndex)</code>. This means that you cannot programmatically force a copy using this function. If this function returns null, plain text is copied.<br /><br />To override this function see <a href="http://nondocs.blogspot.com/2007/04/how-tohack-internal-namespace.html">How To.Hack the "internal" namespace</a>Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-11659929351375618922007-05-05T14:44:00.000-04:002007-05-05T14:56:58.155-04:00flash.text.TextField.insertXMLText()Definition: <code>insertXMLText(beginIndex:int, endIndex:int, richText:String, pasting:Boolean=false):void</code><br /><br />This function replaces the text between <code>beginIndex</code> and <code>endIndex</code> with <code>richText</code>. <code>richText</code> must be in <a href="http://nondocs.blogspot.com/2007/05/flashtexttextfieldflashrichtext.html">flashrichtext</a> format.<br /><br />This function is implemented using <code>setTextFormat()</code>, <code>setSelection()</code>, and <code>replaceText()</code>.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com1tag:blogger.com,1999:blog-5586452099862540857.post-35422420563732543422007-05-05T14:40:00.000-04:002007-05-05T14:44:33.897-04:00flash.text.TextField.getXMLText()Definition: <code>getXMLText(beginIndex:int=0, endIndex:int=int.MAX_VALUE):String</code><br /><br />This function returns the the given range of text in <a href="http://nondocs.blogspot.com/2007/05/flashtexttextfieldflashrichtext.html">richTextFormat</a><br /><br />This function uses <a href="http://nondocs.blogspot.com/2007/05/flashtexttextfieldgettextruns.html">getTextRuns()</a> to determine the formating and <a href="http://nondocs.blogspot.com/2007/05/flashtexttextfieldgetrawtext.html">getRawText()</a> to determine the text.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com2tag:blogger.com,1999:blog-5586452099862540857.post-62857243590899401272007-05-05T14:33:00.000-04:002007-05-05T14:39:39.022-04:00flash.text.TextField.getRawText()This function returns the entire text of the TextField as an unformatted String. In other words, it appears to be the same as the <code>text</code> property. I can only assume that this function somehow accesses the internal representation of the TextField, while the <code>text</code> property accesses some cached version of the text, however I have nothing to back this up at the moment. Neither <code>text</code> nor <code>getRawText()</code> are implemented using each other.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-38860122485822699392007-05-05T11:05:00.000-04:002007-05-05T14:30:29.082-04:00flash.text.TextField.flashrichtextflashrichtext is an xml schema that flash sometimes adheres to when passing around formated text.<br /><br />An example of the flashrichtext format of "<u><span style="color: rgb(0, 0, 0);">Hello </span><span style="color: rgb(255, 0, 0);">World</span></u>" looks like this:<br /><code><flashrichtext version="1"><br /> <textformat font="Arial" size="14" color="0" bold="false" italic="false" underline="true" url="" target="" align="left" leftmargin="0" rightmargin="0" indent="0" leading="2" blockindent="0" kerning="false" letterspacing="0" display="block">(Hello )</textformat><br /> <textformat font="Arial" size="14" color="16711680" bold="false" italic="false" underline="true" url="" target="" align="left" leftmargin="0" rightmargin="0" indent="0" leading="2" blockindent="0" kerning="false" letterspacing="0" display="block">(World)</textformat><br /></flashrichtext></code><br />As you can see, the root node is "flashrichtext." Each child node represents a run of text (a continuous segment of text which has a single text format). The attributes of the node define the format using the same formating names as flash.text.TextFormat, and the text of the node is the text itself surrounded by parentheses.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com3tag:blogger.com,1999:blog-5586452099862540857.post-15321028397915068682007-05-05T10:37:00.000-04:002007-05-05T10:48:41.089-04:00flash.text.TextField.getTextRuns()<code>Definition: getTextRuns(beingIndex:int = 0, endIndex:int = int.MAX_VALUE):Array</code><br /><br />getTextRuns returns an Array of <a href="http://nondocs.blogspot.com/2007/05/flashtexttextrun.html">flash.text.TextRun</a> objects. A TextRun represents a continuous segment of text which has a single text format. In other words, this function parses text in a TextField by its formating. All you have to do is iterate through the Array that is returned. There is no setter equivalent (i.e. setTextRuns()).Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-9731538897855220452007-05-05T10:19:00.000-04:002007-05-05T14:31:39.017-04:00flash.text.TextRunGenerally, you don't instantiate this class yourself. Instead you retrieve and Array of TextRun objects by calling flash.text.TextField.getTextRuns(beginIndex:int, endIndex:int). A text run simply represents a continuous segment of text which has a single text format. So the string "<span style="color: rgb(255, 0, 0);">12</span><u><span style="color: rgb(255, 0, 0);">34</span>56</u>789" would have 4 TextRuns: "<span style="color: rgb(255, 0, 0);">12<span style="color: rgb(0, 0, 0);">", "</span></span><u><span style="color: rgb(255, 0, 0);">34</span></u><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">", "</span></span><u>56</u><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">", "</span></span>789".<br /><br />The estimated source of the TextRun class is:<br /><code>public dynamic class TextRun extends Object {<br /> public beginIndex:int;<br /> public endIndex:int;<br /> public textFormat:flash.text.TextFormat;<br />}</code><br /><br />For more information see <a href="http://nondocs.blogspot.com/2007/05/flashtexttextfieldgettextruns.html">flash.text.TextField.getTextRuns()</a>.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com1tag:blogger.com,1999:blog-5586452099862540857.post-70168272995256552612007-05-03T22:57:00.000-04:002007-05-12T23:20:48.362-04:00FAQ.textTextArea, TextInput, Label, Text (all in the mx.controls package) all use mx.core.UITextField to render text. If there was a method that you wish were in one of these text controls, it may be in flash.text.TextField (which is the grandparent of UITextField). There is a lot of information about how text operates in flash under <a class="toggle">"flash.text.TextField</a>" on this site. But before you look through the undocumented features (see the navigation menu to your right), check the documented ones <a href="http://livedocs.adobe.com/flex/201/langref/flash/text/TextField.html">here.</a> Documented highlights include:<br /><blockquote>getCharBoundries, getCharIndexAtPoint, getFirstCharInParagraph, getLineIndexAtPoint, getLineIndexOfChar, getLineLength, getLineMetrics, getLineOffset, getLineText, getParagraphLength</blockquote>You can access the UITextField of these mx controls by extending the control and accessing the protected <code>textField</code> property or you can call <code>mx_internal::getTextField()</code>. See <a href="http://nondocs.blogspot.com/2007/04/mxcoremxinternal.html">mx.core.mx_internal</a> for how the later works.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-41563156727346135802007-05-03T19:31:00.000-04:002007-05-03T19:32:06.848-04:00Other.law.bloggingI don't have many comments on this, but the following article is good:<br /><br /><a href="http://www.avivadirectory.com/blogger-law">http://www.avivadirectory.com/blogger-law</a>Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-83051980178428206082007-05-01T20:22:00.000-04:002007-05-21T12:39:30.521-04:00SDK.mxmlc/compilerThe advanced options for the compiler aren't in the docs. But Renaun Erickson has a list of them <a href="http://renaun.com/blog/2006/08/09/84/">here</a>.<br /><br />Yet another list of things that I have to figure out.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-27689801871262960092007-04-29T12:35:00.000-04:002007-04-29T13:08:39.194-04:00How To.Hack the "internal" namespaceIf you're looking for for information on <code>mx_internal</code> go see <a href="http://nondocs.blogspot.com/2007/04/mxcoremxinternal.html">mx.core.mx_internal</a>.<br /><br />This isn't so much undocumented as it is a hack. I wouldn't do it, but it's still fun.<br /><br />Actually this technique seems pretty obvious once it occurs to you. Since something under the internal namespace can only be accessed from within the same package, just put your own class with proxy functions in that package.<br /><br />So the obvious question becomes, what if the the internal function you want to access is in an swc? If this is a case you can't just insert a class into it. But you can create mimic the package structure in your own project and put the class there. This will work fine.<br /><br />So let's say you want to call <code>form.invalidateLabelWidth()</code> which happens to be marked internal. In your own project simply create the directory structure, mx.containers. In this new containers folder put create a class "FormInternalProxy", and then create the function:<br /><br /><pre><code>public static function invalidateLabelWidth(form:Form):void {<br /> form.invalidateLabelWidth();<br />}</code></pre><br /><br />It's that simple. I'm still looking into if something like this can be used to access private functions, but so far class naming conflicts seem to prevent it.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com2tag:blogger.com,1999:blog-5586452099862540857.post-75924070539486060982007-04-28T22:49:00.000-04:002007-04-29T12:35:30.875-04:00SDK.swfxprinterJoe Berkovitz has reported on a little tool that dumps information about an swf (or swc) into a tidy XML. His post is here:<br /><br /><a href="http://joeberkovitz.com/blog/2007/04/08/secret-life-of-swfs/">http://joeberkovitz.com/blog/2007/04/08/secret-life-of-swfs/</a><br /><br />But what can we do with this new found feature?<br /><br />The -showoffset option allows us to see many bytes each class takes up in the file (which can be very useful for optimization), and the location in the file. The location is information flash and the flex compiler may need by I haven't found a way for the location to be useful to us yet.<br /><br />The -asm option returns (in very complex XML form) the definitions of the classes, methods and properties regardless of the namespace of entities. This could be good for hacking someone else's compiled classes, but only for functions that aren't private and not documented, and most good programmers won't leave those types of functions lying around unless they really need to. (Additionally, there are usually other, more efficient, ways to find these functions in my opinion, such as seeing what "Content Assist" comes up with.) Additionally, this only gives you the definition, we still don't know how to use the newly found entities.<br /><br />I tried running this on the globalplayer.swc and very little interesting came out of it. There don't appear to be any hidden namespaces. There are a couple functions hidden in the internal (not mx_internal) namespace, but half of these have proxy functions in the public namespace and the other half involve low level features such as adding event listeners that I can't find a reason to mess with.<br /><br />All in all, it's an interesting tool, but I'm still looking for more uses.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-27391904845940364302007-04-25T21:28:00.000-04:002007-04-25T23:32:09.139-04:00metadata.PercentProxyPercentProxy is very simple. As you probably know, UIComponents allow you to define the width and height in MXML as pixels or percent:<br /><br /><code><mx:UIComponent width="50"/><br /><mx:UIComponent width="75%"/></code><br /><br />This is accomplished because the 'width' property/accessors in UIComponent has the metatag <code>[PercentProxy("percentWidth")]</code> which redirects any width value set in MXML with <code>'%'</code> on the end to the percentWidth property. So in the examples above, <code>"50"</code> sets <code>width</code> to 50 and <code>"75%"</code> sets <code>percentWidth</code> to 75.<br /><br />Below is an example of creating a percent proxy for the amount of rows to be shown based on a list's dataprovider length:<br /><br />MyList.as:<br /><pre><code>package <br />{ <br /> import mx.controls.List;<br /><br /> public class MyList extends List<br /> { <br /> <br /> [PercentProxy("rowsPercent")]<br /> override public function get rowCount():int {<br /> return super.rowCount;<br /> }<br /> <br /> override public function set rowCount(value:int):void {<br /> super.rowCount = value;<br /> }<br /> <br /> public function get rowsPercent():Number {<br /> return 100 * (rowCount / dataProvider.length);<br /> }<br /> <br /> public function set rowsPercent(value:Number):void {<br /> rowCount = dataProvider.length * (value/100);<br /> }<br /> <br /> }<br />}</code></pre><br /><br />ListTest.mxml:<br /><pre><code><?xml version="1.0" encoding="utf-8"?><br /><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" xmlns:local="*"><br /> <local:MyList width="100"><br /> <mx:Array><br /> <mx:String>row1</mx:String><br /> <mx:String>row2</mx:String><br /> <mx:String>row3</mx:String><br /> <mx:String>row4</mx:String><br /> <mx:String>row5</mx:String><br /> <mx:String>row6</mx:String><br /> <mx:String>row7</mx:String><br /> <mx:String>row8</mx:String><br /> <mx:String>row9</mx:String><br /> <mx:String>row10</mx:String><br /> </mx:Array><br /> </local:MyList><br /> <local:MyList width="100" rowCount="3"><br /> <mx:Array><br /> <mx:String>row1</mx:String><br /> <mx:String>row2</mx:String><br /> <mx:String>row3</mx:String><br /> <mx:String>row4</mx:String><br /> <mx:String>row5</mx:String><br /> <mx:String>row6</mx:String><br /> <mx:String>row7</mx:String><br /> <mx:String>row8</mx:String><br /> <mx:String>row9</mx:String><br /> <mx:String>row10</mx:String><br /> </mx:Array></local:MyList> <br /> <local:MyList width="100" rowCount="50%"><br /> <mx:Array><br /> <mx:String>row1</mx:String><br /> <mx:String>row2</mx:String><br /> <mx:String>row3</mx:String><br /> <mx:String>row4</mx:String><br /> <mx:String>row5</mx:String><br /> <mx:String>row6</mx:String><br /> <mx:String>row7</mx:String><br /> <mx:String>row8</mx:String><br /> <mx:String>row9</mx:String><br /> <mx:String>row10</mx:String><br /> </mx:Array><br /> </local:MyList><br /></mx:Application></code></pre>Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0tag:blogger.com,1999:blog-5586452099862540857.post-31436400140208922552007-04-24T22:17:00.000-04:002007-04-24T22:34:55.508-04:00metadata.SWFIn ActionScript projects you can set the width, height, background color and frame rate of the project by using the SWF tag. It should be placed directly before the root class This, like many other undocumented metatags, is a shortcut for compiler parameters. Example:<br /><br /><code>[SWF(width="800", height="600" frameRate="30", backgroundColor="#FFFFFF")]<br />public class MyRootClass extends Sprite {<br />...<br /></code><br /><br />An Adobe reference can be found <a href="http://www.morearty.com/blog/2006/06/27/setting-the-width-and-height-of-a-pure-actionscript-application/">here</a>.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com1tag:blogger.com,1999:blog-5586452099862540857.post-27478019790664157382007-04-22T22:28:00.001-04:002007-05-12T23:13:06.727-04:00metadata.FrameThe closest thing we have to official documentation of the Frame metatag is at <a href="http://blogs.adobe.com/rgonzalez/2006/06/modular_applications_part_2.html">http://blogs.adobe.com/rgonzalez/2006/06/modular_applications_part_2.html</a>. Important highlights include, "Note that the metadata is actually just an inline alias for the 'frames" compiler configuration option, which lets you explicitly specify the frame classes.' and "The rules [for the Frame tag] are a bit weird." <br /><br />Examples from the mx framework are:<br /><code>[Frame(factoryClass="mx.managers.SystemManager")] //mx.core.Application<br />[Frame(factoryClass="mx.core.FlexApplicationBootstrap")] // mx.core.SimpleApplication<br />[Frame(factoryClass="mx.core.FlexModuleFactory")] // mx.modules.Module and mx.modules.ModuleBase</code><br /><br />Really you should read Roger's post if you want to know what's going on, but I'll give you the short version: The factory class defines the loader of the application /module which will load the application/module after the factory is initialized. So for Application, the factory class is defined as mx.managers.SystemManager. So when you start a flex application, SystemManager is instantiated which initializes many things and then starts the Application.<br /><br />So this tells us about the factoryClass property, but we still have the extraClass property to discuss. You'll notice that the generated Class for your application (if you use the -keep-generated-actionscript option on your compiler) contains:<br /><br /><code>[Frame(extraClass="_{MyApp}_FlexInit")]</code><br /><br />So here's what it is as best as I can figure out. This is also a inline shortcut for the compiler...almost. The -includes class option allows you to link classes to your project. Using this compiler option means you don't have to explicitly import the included class nor explicitly force code to link to the included class to use functions such as flash.utils.getDefinitionByName(). <br /><br />The extraClass tag does the same thing with one exception. The compiler option also causes default styles to be generated on compile (from framework.swc I think), while the inline tag does not generate these defaults. So if you want use the extraClass property of the Frame metatag, make sure you are not linking to a file which has default styles in the mx framework.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com3tag:blogger.com,1999:blog-5586452099862540857.post-86041207757834827892007-04-21T22:55:00.000-04:002007-04-21T23:29:46.176-04:00metadata.TransientI've never seen an authoritative source fully explain Transient, but we have a lot of things that give us the main idea. It appears data marked as Transient is ignored in many cases, mostly having to do with Flex Data Services. The short description of this tag appears to be that if you don't want a property saved or used by FDS, mark it as Transient. Here's the supporting evidence:<br /><br />Peter Farland of Adobe has stated while referring to RemoteObject:<br />"If you're worried that you'll need to send this type back to the server and you don't want these newly added dynamic properties to be sent to the server, then [...] you could simply declare that a particular concrete property on your client type was "transient" using [Transient] metadata - these properties wouldn't be included when instances were sent back to the server." (<a href="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg57899.html">full message here</a>)<br /><br />Additionally, Seth Hodgson of Adobe stated:<br />"Try tagging the properties that you don't want managed in your [Managed] AS class as [<span id="st" name="st" class="st">Transient</span>]. This should prevent changes to them from being logged/committed." (<a href="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg38984.html">full message here</a>)<br /><br />The only reference in the mx package is in mx.utils.ObjectUtil.getClassInfo(). This method returns information about a class and one of the parameters of the method defines whether or not to ignore properties marked by the Transient tag.<br /><br />The docs refer the concept of transience but they do not refer to the Transient tag specifically.<br /><br />*Interesting note: "transient" is a reserved word for possible future use.Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com2tag:blogger.com,1999:blog-5586452099862540857.post-75150548177110465342007-04-21T20:35:00.000-04:002007-05-26T19:13:04.939-04:00metadata.MaxChildrenButtonBar, LinkBar, and TabBar all have the metatag:<br /><br /><code>[MaxChildren(0)]</code><br /><br />I think it's a legacy artifact (i.e. It does nothing).Danhttp://www.blogger.com/profile/06759273451883424290noreply@blogger.com0