<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-33682522</id><updated>2011-11-27T16:39:19.735-07:00</updated><category term='externalinterface'/><category term='Adobe'/><category term='javascript'/><category term='Java'/><category term='BlazeDS'/><category term='flex'/><category term='iframe'/><category term='sample work'/><category term='AIR'/><category term='Generator'/><title type='text'>Vic on Flex</title><subtitle type='html'>Documenting my journey of knowledge into the world of Adobe Flex.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>57</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-33682522.post-47413239149307407</id><published>2009-02-11T23:25:00.002-07:00</published><updated>2009-02-12T00:01:31.295-07:00</updated><title type='text'>BlazeDS Getting Started App Revisited</title><content type='html'>As some of you may or may not have noticed, I don't get a chance to blog much these days... managing a fair sized team of developers and maintaining our streak of successful projects tends to keep me very busy.  But in recent weeks I've started doing some BlazeDS project work again, and I find that to get my head back "in the game" I like to have a project I can pull up and jump right into, so to speak. &lt;br /&gt;&lt;br /&gt;If you've been following my blog you'll know that although I'm a huge Flex guy, Java tends to be something I perceive more as a necessity in getting the job done.  I've never been a full time hard core Java developer (my brother takes the honors in that category) and so, most of my posts regarding Java or Hibernate are through the eyes of someone who HAS to know enough to be dangerous.&lt;br /&gt;&lt;br /&gt;Now I know that anyone could probably do this, but I figured I'd just put it out there, and maybe save someone the trouble... I've put together a little zip file that contains a Tomcat 5.5.x web app, which consists of a Flex project and a Java project, both of which can be opened in Eclipse.   Basically the 2 apps work together to demonstrate:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;using JNDI to declare database and SMTP services&lt;/li&gt;&lt;li&gt;launching HSQLDB in memory inside the web app (gets tiring installing mysql just to play around - I borrowed this from the BlazeDS turnkey solution and tweaked it a bit)&lt;/li&gt;&lt;li&gt;using a .property file to store configuration values and then retrieving those from Java&lt;br /&gt;&lt;/li&gt;&lt;li&gt;doing a very simple "is flex talking to blaze" function&lt;/li&gt;&lt;li&gt;doing a quick "is blaze talking to the db" function&lt;/li&gt;&lt;li&gt;doing a quick "send email from Flex thru Java to me" function&lt;/li&gt;&lt;li&gt;uploading files from Flex to Java and from html to Java&lt;/li&gt;&lt;li&gt;the minimum number of jar files needed to pull this off (updated to Blaze 3.2.x)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; For me personally these are all really nice to have right at my fingertips.  There's additional notes in the zip in the index.htm.  Enjoy.  You can find the zip file here:  &lt;a href="http://www.crazedcoders.com/demos/blazeMsg.zip"&gt;http://www.crazedcoders.com/demos/blazeMsg.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Keep in mind you may need to adjust your paths in your Flex, as chances are your Tomcat install won't be in the same location as I have it on my Mac.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-47413239149307407?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/47413239149307407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=47413239149307407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/47413239149307407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/47413239149307407'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2009/02/blazeds-getting-started-app-revisited.html' title='BlazeDS Getting Started App Revisited'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-4075634601250786751</id><published>2008-08-28T13:45:00.003-06:00</published><updated>2008-08-28T13:50:46.748-06:00</updated><title type='text'>Flexbuilder Debug Mode Dog Slow on Mac using Firefox</title><content type='html'>Quick find today.&lt;br /&gt;&lt;br /&gt;Little while back debugging in FB 3.0.x became a brutal exercise in futility.  Finally reached a point where I couldn't debug at all.  At the time I was running FF2.x.  Initially upgraded to FB3 with no change, well no change, except that suddenly I wasn't entering debug mode (bug: had GreaseMonkey Add-On installed - removing it fixed that).  Once I was entering Debug again, it would grind my Mac to a halt.  Switched to Safari and it worked perfectly.  Figured out that Piclense / CoolIris addon for Firefox was in fact the culprit.  I uninstalled that add-on and suddenly Debug mode was working just fine again.  Lesson learned:  If debugging against Firefox, be wary what add-ons you have installed.  Hopefully this little lesson will help others.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-4075634601250786751?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/4075634601250786751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=4075634601250786751' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4075634601250786751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4075634601250786751'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2008/08/flexbuilder-debug-mode-dog-slow-on-mac.html' title='Flexbuilder Debug Mode Dog Slow on Mac using Firefox'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-5231107380575776424</id><published>2008-08-13T15:04:00.003-06:00</published><updated>2008-08-13T15:27:49.809-06:00</updated><title type='text'>Why no Sandbox Violation running from Bin?</title><content type='html'>Ever noticed that once you copy your html/swf files from the bin folder in your flex project to another file location, or just move the bin folder itself, your flex application no longer happily makes the remote data calls that only worked a minute ago in Flexbuilder?  Well we ran into an interesting issue, when trying to push custom HTTP headers to a server.  It worked fine while debugging in flexbuilder, and even double clicking on the html file in the bin folder worked.  Yet the minute I moved the bin folder to say "program files\my proggy", the application would give a nasty error like this:&lt;br /&gt;&lt;br /&gt;Error #2170: Security sandbox violation: file:///program files/my proggy/APITest.swf cannot send HTTP headers to http://myservice/DIRTNAPPY/.&lt;br /&gt;&lt;br /&gt;I did some research, and there's actually tons of information out there that deals with this issue.  First and foremost this article &lt;a href="http://www.adobetutorialz.com/articles/1785/1/Local-Sandboxes"&gt;http://www.adobetutorialz.com/articles/1785/1/Local-Sandboxes&lt;/a&gt; does a very good job of explaining exactly what is happening behind the scenes.&lt;br /&gt;&lt;br /&gt;Essentially Flexbuilder tells Flash that it should trust the bin folder... if you do a search on your development machine for the file flexbuilder_plugin.cfg, you should find it in a folder called FlashPlayerTrust in roughly the same area you normally find SharedObject files.  If you open this file in a text editor, you should see pretty much every path to every bin folder for every flex project you have ever worked on. And suddenly everything gets so much clearer. &lt;br /&gt;&lt;br /&gt;So I created a new file and placed it next to this flexbuilder_plugin.cfg file, and called it MyProggy.cfg.  Flash is configured to read in all files in this folder and parse all paths out of it, and any applications run from these paths will be considered "&lt;a href="http://injun.ru/flash10api/flash/system/Security.html#LOCAL_TRUSTED"&gt;localTrusted&lt;/a&gt;" and will act as they would when run from Flexbuilder.  Inside this text file I put one line: "c:\program files\my proggy" and saved it.  I then had to restart Firefox for the change to take effect.  I also had added a text label to my application and bound the text property to {Security.sandboxType}.&lt;br /&gt;&lt;br /&gt;Launching the app again from c:\program files\my proggy now showed the app running in localTrusted mode, and sure enough all my data calls worked just fine.  Keep in mind, that all this only works when you intend to host your application on users machines, rather than on a webserver.  It's simple enough to add the necessary text file when your application is being installed.&lt;br /&gt;&lt;br /&gt;I should add that as a back up plan, you might want to consider trapping the Sandbox Error and then communicating to the user that they'll need to right click on the application, select Settings / click Advanced / then click on Global Security Settings Panel and add the appropriate path to the list of "always trust files in these locations".  (still easier than making them go and create this text file themselves and saving it to the right location).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-5231107380575776424?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/5231107380575776424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=5231107380575776424' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/5231107380575776424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/5231107380575776424'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2008/08/why-no-sandbox-violation-running-from.html' title='Why no Sandbox Violation running from Bin?'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-4529645213558449273</id><published>2008-08-08T18:01:00.002-06:00</published><updated>2008-08-08T18:14:40.439-06:00</updated><title type='text'>mx.controls.Text: preventing scroll on select</title><content type='html'>A minor annoyance in Flex that I've lived with for many moons now is that even though I will provide enough vertical space to show all the text or htmlText in a Text Control, when a user attempts to select the text, often times, the text will scroll up, hiding the first line.  The easiest fix is to set selectable='false', and in most cases this will do the trick.  There are times however, when a client will demand that text remain selectable.  And that same client will be the first to complain about the apparently unnecessary scrolling of text.&lt;br /&gt;&lt;br /&gt;I played around with this, but seriously, the mx.controls.Text class really doesn't give one much to work with.  On browsing through the sdk source, I discovered I'd probably have better luck working with the wrapped UITextField.  In the end I tapped into the scroll event and the alwaysShowSelection attribute of the UITextField to get me where I needed to go.&lt;br /&gt;&lt;br /&gt;It's been a long week so I'm just going to post up a link to the solution &lt;a href="http://www.crazedcoders.com/demos/scrollmebaby/test.html" target="_new"&gt;here&lt;/a&gt;, and the source code &lt;a href="http://www.crazedcoders.com/demos/scrollmebaby/srcview/index.html" target="_new"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-4529645213558449273?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/4529645213558449273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=4529645213558449273' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4529645213558449273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4529645213558449273'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2008/08/mxcontrolstext-preventing-scroll-on.html' title='mx.controls.Text: preventing scroll on select'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-785777157851305931</id><published>2008-07-10T10:59:00.005-06:00</published><updated>2009-09-19T00:23:24.556-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sample work'/><title type='text'>Dogtagit Flex 3 Project</title><content type='html'>I've been working closely with &lt;a href="http://www.threecast.com/"&gt;Threecast&lt;/a&gt; on a project for some time now, and they've made a demo site available for me to showcase.  It's hosted on port 8888, so you're best off to try this at home.  The application is built on SqlServer, .Net, Weborb and Flex 3 using Cairngorm.  Feel free to have a look around, and play with it.  This version has the login disabled and the data is reset on a regular basis - it's primarily just for preview purposes.  You can view the site here:&lt;br /&gt;&lt;a href="http://demo.dogtagit.com:8888/beta/main.html"&gt;&lt;br /&gt;http://demo.dogtagit.com:8888/beta/main.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And if you want to sign up and try it out for yourself, you can go to their home page &lt;a href="http://www.dogtagit.com/victorblog"&gt;www.dogtagit.com&lt;/a&gt; here and sign up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-785777157851305931?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/785777157851305931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/785777157851305931'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2008/07/dogtagit-flex-3-project.html' title='Dogtagit Flex 3 Project'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-1378824488497298973</id><published>2008-05-30T11:34:00.004-06:00</published><updated>2008-05-30T11:52:16.762-06:00</updated><title type='text'>Sometimes cornerRadius just isn't enough</title><content type='html'>Two tips for coders new to Flex... if you want to have rounded corners in mx.containers like VBox, HBox, Canvas, etc, set the &lt;span style="font-weight: bold;"&gt;borderStyle&lt;/span&gt; to &lt;span style="font-style: italic;"&gt;solid&lt;/span&gt; and the &lt;span style="font-weight: bold;"&gt;borderThickness&lt;/span&gt; to &lt;span style="font-style: italic;"&gt;0&lt;/span&gt;, and then set your &lt;span style="font-weight: bold;"&gt;cornerRadius&lt;/span&gt; to whatever you want.  If the &lt;span style="font-weight: bold;"&gt;borderStyle&lt;/span&gt; is left at &lt;span style="font-style: italic;"&gt;none&lt;/span&gt; (default), the &lt;span style="font-weight: bold;"&gt;cornerRadius&lt;/span&gt; attribute seems broken and ineffective.&lt;br /&gt;&lt;br /&gt;The second tip, if you want rounded corners at the top and bottom of your Panel, there's a property called &lt;span style="font-weight: bold;"&gt;roundedBottomCorners&lt;/span&gt; which defaults to &lt;span style="font-style: italic;"&gt;false&lt;/span&gt;.  When set to &lt;span style="font-style: italic;"&gt;true&lt;/span&gt;, you will see rounding both top and bottom.&lt;br /&gt;&lt;br /&gt;Here's an example &lt;a href="http://www.crazedcoders.com/demos/rounded/"&gt;http://www.crazedcoders.com/demos/rounded/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I should point out that this has been blogged previously &lt;a href="http://weblogs.macromedia.com/mc/archives/2005/10/round-cornered.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-1378824488497298973?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/1378824488497298973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=1378824488497298973' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1378824488497298973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1378824488497298973'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2008/05/sometimes-cornerradius-just-isnt-enough.html' title='Sometimes cornerRadius just isn&apos;t enough'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-4559064262794005210</id><published>2008-04-11T10:49:00.002-06:00</published><updated>2008-04-11T11:04:50.903-06:00</updated><title type='text'>Invalid Embed directive in stylesheet</title><content type='html'>On a few occasions now, for no really apparent reason, suddenly our Problem Pane will be spammed with tons of messages all sort of looking like this:&lt;br /&gt;&lt;br /&gt;Invalid Embed directive in stylesheet - can't resolve source 'Embed(source = "/assets/common.swf", symbol = "AccordionHeader_disabledOverSkin")'.&lt;br /&gt;&lt;br /&gt;In the past, sometimes it would only happen on a mac, other times windows machines.  I've tried deleting my bin folder, cleaning the project, recompiling the swf's, moving the swf's around, changing the syntax in the css ever so slightly.  I've googled this on many occasions and found no clear answer.   Today I decided that I needed to know what caused this and if in fact I figured it out, to share it with you.&lt;br /&gt;&lt;br /&gt;What ended up being the root cause of our problem is that in several places in the application we were referencing image assets directly in our assets folder, i.e.  /assets/delete.png, which is often the case when our designers aren't keeping up with asset creation and developers just throw some image up as a placeholder for the time being.   Now it just so happened that ONE of these references was incorrect and its Embed pointed to a file that did not exist.  I discovered this when I commented out our style css references in the application, and saw the error only then.  It was this broken reference that caused the above error.  I fixed the reference to point to the right file, did a Project clean, and all the Invalid Embed Directive errors went away. &lt;br /&gt;&lt;br /&gt;I should note that we had over 100 references to symbols in our css, and by default Flexbuilder only shows the first 100 errors. Unluckily the "unable to resolve 'assets/deleted.png' for transcoding   in ...." was error number 138 and did not show up in the list.  I had to change my preferences to show all 138 errors.&lt;br /&gt;&lt;br /&gt;So the lesson learned is that when you get spammed with this error, it could well be that only one Embed tag somewhere in your app is actually broken, and that your css and swf is probably just fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-4559064262794005210?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/4559064262794005210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=4559064262794005210' title='33 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4559064262794005210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4559064262794005210'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2008/04/invalid-embed-directive-in-stylesheet.html' title='Invalid Embed directive in stylesheet'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-3909320617693937454</id><published>2008-02-17T16:28:00.010-07:00</published><updated>2011-01-05T13:25:20.193-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='AIR'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Adobe'/><category scheme='http://www.blogger.com/atom/ns#' term='Generator'/><category scheme='http://www.blogger.com/atom/ns#' term='BlazeDS'/><title type='text'>Working With BlazeDS Beta 1</title><content type='html'>Last week we successfully ported an &lt;a target="_new" href="http://www.crazedcoders.com/air/?vac=lone"&gt;AIR application&lt;/a&gt; from amfphp to BlazeDS.  The code for this application was almost completely generated by a new generator we're working on (coming soon!).  With the announcement of BlazeDS, we kinda shelved our &lt;a target="_new" href="http://viconflex.blogspot.com/2008/01/amfphpflexcairngorm-codegen-source.html"&gt;php generator&lt;/a&gt; and redirected our efforts in doing the same thing for BlazeDS.   In the process, we put together our own version of the blazeds.war file that ships with BlazeDS beta 1, which we use as the starting point for all our BlazeDS projects. Here's a list of the changes we've made:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Modified the context.xml found in the META-INF folder - the packaged one was producing Valve Errors&lt;/li&gt;&lt;li&gt;Added the missing my-streaming-amf channel to services-config.xml, which I found in the BlazeDS samples war's config file&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Incorporated the latest Flex 3 Compiler Module files to allow server-side compilation of mxml files&lt;/li&gt;&lt;li&gt;Created a very simple java class and a corresponding destination which will verify Blaze backend functionality&lt;/li&gt;&lt;li&gt;Created a very simple Flex application that calls the above java class function test(string)&lt;/li&gt;&lt;li&gt;Added 2 jars to WEB-INF, one is crazedTemplate.jar, which our new codegenerator (coming soon) uses, the other is sharpertools.jar, which the jar requires.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;You can choose to go ahead and just use the application as is. It's only been tested on Tomcat / Win / OSX 10.5.2. If you don't intend on using our generator (coming soon!) to generate your java and AS3 Classes then you can go ahead and delete the 2 jars mentioned above. I really like this separation of compiler and essentially what was FDS. When FDS was originally released, it did both runtime compiles as well as Remoting, Messaging, Proxy and Managed Data Services. In our case, we never deployed anything that required runtime compilation AND furthermore, with each subsequent Flex release (2.01, Hotfix 1, 2 and 3), converting FDS projects that were set to compile on the server wasn't trivial. So we stopped using it. If I was super Java savvy I might have been able to figure out what parts I could yank out of my FDS application, but generally it seemed better to just leave it alone.&lt;br /&gt;&lt;br /&gt;Now, with Blaze and the compiler war being separate, I've gone through the web.xml in this project and put comments to show which pieces are required by the compiler module and which pieces are required by Blaze. To get this back to being a pure Blaze non-Flex 3 Compiler Module, you'd just need to remove the appropriately marked sections from the web.xml and then remove all folders and files from WEB-INF/flex with the exception of:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;services-config.xml&lt;/li&gt;&lt;li&gt;remoting-config.xml&lt;/li&gt;&lt;li&gt;proxy-config.xml&lt;/li&gt;&lt;li&gt;messaging-config.xml&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Some of our clients have asked what the differences exactly are between BlazeDS and LCDS (prev. known as FDS). If you do enough research on the web, you can find several answers. From what I've seen, here's some differences I've found so far:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;   BlazeDS does not support the RTMP Channel typically used by LCDS for data push (RTMP typically means firewall port challenges all around anyway!)&lt;/li&gt;&lt;li&gt;BlazeDS does support AMF Streaming which offers data push like RTMP, however not nearly as scalable (100's vs 10000's of concurrent users)&lt;/li&gt;&lt;li&gt;BlazeDS does support proxy so you can bypass the all too familiar sandbox issues when accessing remote data where no crossdomain.xml is present&lt;/li&gt;&lt;li&gt;BlazeDS does not come packaged with the Compiler Module&lt;/li&gt;&lt;li&gt;BlazeDS does not have managed dataservices. This means that you don't need the fds.swc (DataService &amp;amp; [Managed]) in your flex projects.. you will use either Consumer, Producer or RemoteObject Classes&lt;/li&gt;&lt;li&gt;BlazeDS does support AMF3, RemoteClasses &amp;amp; Messaging with a "lite" version of push via amf streaming&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;To download the blazeBlank application click &lt;a target="_new" href="http://www.crazedcoders.com/demos/blazeBlank.zip"&gt;here&lt;/a&gt;.  (as new builds of Flex 3 and BlazeDS are released I'll try to keep this application updated).  This application currently uses Flex 3 Beta 3 and BlazeDS Beta 1.  Be sure to visit the url  /{context}/TestApp/Main.mxml to ensure that the application is working properly. (i.e. http://localhost:8600/blazeBlank/TestApp/Main.mxml)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-3909320617693937454?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/3909320617693937454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=3909320617693937454' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/3909320617693937454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/3909320617693937454'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2008/02/working-with-blazeds-beta-1.html' title='Working With BlazeDS Beta 1'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-741927800044797321</id><published>2008-01-18T01:02:00.001-07:00</published><updated>2011-01-05T13:26:26.509-07:00</updated><title type='text'>Flex 3 (Beta 3) Badge.swf don't like spaces!</title><content type='html'>We just recently were challenged with trying to update to the latest Flex beta, and there have been a few changes to the way the seamless install badge.swf works.  For one thing, this program now goes out and talks to an air.swf hosted by Adobe.  The second, and far more annoying "feature" was that if you had an AIR file name like "Sample Application.air" and tried to publish that using the sample batch.swf provided in the SDK, the AIR Installer would fail, choking on the space.&lt;br /&gt;&lt;br /&gt;I've hacked the badge.fla file using regex to put replace spaces with %20, and this seems to have fixed the problem for now.  I also downloaded a copy of the air.swf from the Adobe site, threw it in the same folder as my badge.swf and changed the code to use that one instead.&lt;br /&gt;&lt;br /&gt;You can get the whole bag of goodies &lt;a target="_new" href="http://www.crazedcoders.com/demos/BatchB3M6.zip"&gt;here&lt;/a&gt;. I've included all the source and a ready to use badge.swf, as well as a working sample.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-741927800044797321?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/741927800044797321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=741927800044797321' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/741927800044797321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/741927800044797321'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2008/01/flex-3-beta-3-badgeswf-dont-like-spaces.html' title='Flex 3 (Beta 3) Badge.swf don&apos;t like spaces!'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-236882178063712127</id><published>2008-01-05T04:34:00.000-07:00</published><updated>2008-01-05T04:44:39.596-07:00</updated><title type='text'>amfphp/flex/cairngorm Codegen - Source Available on Google Code</title><content type='html'>I've had quite a few people ask if they could get their hands on the php source for the code generator tool I published back in October &lt;a href="http://viconflex.blogspot.com/2007/10/not-another-flex-amfphp-cairngorm.html"&gt;here&lt;/a&gt;.  My intention has always been to eventually get this out to the community, however the last couple months have been just crazy, with one release after another getting pushed out the door.  So much demand for AIR and Flex applications, so little time...&lt;br /&gt;&lt;br /&gt;Anyway, we finally had some time to get this thing cleaned up and out on Google code... you can find the source files at &lt;a href="http://code.google.com/p/flexamfphpcairngormgenerator/source"&gt;http://code.google.com/p/flexamfphpcairngormgenerator/source&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-236882178063712127?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/236882178063712127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=236882178063712127' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/236882178063712127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/236882178063712127'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2008/01/amfphpflexcairngorm-codegen-source.html' title='amfphp/flex/cairngorm Codegen - Source Available on Google Code'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-607101035260386016</id><published>2007-12-13T16:25:00.000-07:00</published><updated>2007-12-13T16:45:39.992-07:00</updated><title type='text'>DataServiceTransaction &amp; LCDS</title><content type='html'>Just a quick blog note on something that I've now wasted a good day on twice, only because I never blogged it last time.  The challenge is say you need to make changes to data in a database, maybe across multiple tables, and using DataServices just doesn't make sense.  For example, cloning x number of records.  It's easy enough to create your Java remote objects and call them from Flex, but then in an FDS/LCDS implementation how do you push those changes out to Flex clients?&lt;br /&gt;&lt;br /&gt;There's some documentation on this, scattered vaguely across the web, and there's a good chance that perhaps this has already been blogged - but I just couldn't find it.  The trick is that there are 2 sides to this story, one, you must perform your operations on the database &lt;span style="font-weight:bold;"&gt;directly&lt;/span&gt;, and then two, you must INFORM FDS that changes have occurred.   So say I want to create a new Author record, this is what that might look like:&lt;br /&gt;&lt;pre&gt;public void createAuthor(){  &lt;br /&gt;  DataServiceTransaction dtx = DataServiceTransaction.begin(false);&lt;br /&gt;                //create record and save:&lt;br /&gt;  Author auth = new Author();&lt;br /&gt;  auth.setFirstName("Ernest");&lt;br /&gt;  auth.setLastName("Hemingway");&lt;br /&gt;  AuthorDAO dao = new AuthorDAO();  &lt;br /&gt;  dao.create(auth);&lt;br /&gt;                //let LCDS know:&lt;br /&gt;  dtx.createItem("author", auth);&lt;br /&gt;  dtx.commit();&lt;br /&gt; }&lt;/pre&gt;  So I just do my regular db insert, then I use a DataServiceTransaction to let FDS know that I've created an Item.  Alternatively, I could use this approach:&lt;pre&gt;public void createFDSItem(){&lt;br /&gt;  DataServiceTransaction dtx = DataServiceTransaction.begin(false);&lt;br /&gt;  Author auth = new Author();&lt;br /&gt;  auth.setFirstName("victor");&lt;br /&gt;  auth.setLastName("javarubba");&lt;br /&gt;  AuthorDAO dao = new AuthorDAO();&lt;br /&gt;  dao.create(auth);&lt;br /&gt;  dtx.refreshFill("author", null);&lt;br /&gt;  dtx.commit();&lt;br /&gt; }&lt;/pre&gt;  This approach might be a bit of overkill and might be better suited when doing mass updates across many records.  I did a little bit of testing and it seemed that for the most part calling CreateItem() was faster that the refreshFill() in pushing the new record to the Flex Client.&lt;br /&gt;&lt;br /&gt;What cost me so much grief is that I was falsely led down the garden path to believe that calling dtx.createItem("author", auth) would not only inform FDS but also actually create the item.  This is not the case.  There! Officially blogged!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-607101035260386016?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/607101035260386016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=607101035260386016' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/607101035260386016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/607101035260386016'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/12/dataservicetransaction-lcds.html' title='DataServiceTransaction &amp; LCDS'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-4691309231537313398</id><published>2007-11-13T13:26:00.000-07:00</published><updated>2007-11-13T13:46:35.103-07:00</updated><title type='text'>Losing the RollOverColor in TileList</title><content type='html'>In one of our projects we have a custom effect that plays over each tile as a user mouses over the items in a tilelist. Not getting too much into details, I basically overlay a canvas that appears and disappears as the mouse moves over the tile, giving the illusion that each tile sort of explodes. So the one thing I don't need is the rollOverColor effect, which defaults to a nasty baby blue. Usually I just set the rollOverColor to the same color as the background but that's not working so well on this project, since the background can be an assortment of wallpapers.&lt;br /&gt;&lt;br /&gt;Unfortunately there doesn't seem to be any way to disable the rollOverColor, and maybe someone can shed some light on an easier solution. I ended up extending TileList with my own mxml component and overriding the drawitem function, as follows:&lt;br /&gt;&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;mx:TileList xmlns:mx=&amp;quot;http://www.adobe.com/2006/mxml&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt; &amp;lt;![CDATA[&lt;br /&gt; import mx.controls.listClasses.IListItemRenderer;&lt;br /&gt;      &lt;br /&gt;    protected override function drawItem(item:IListItemRenderer,&lt;br /&gt;                      selected:Boolean = false,&lt;br /&gt;                      highlighted:Boolean = false,&lt;br /&gt;                      caret:Boolean = false,&lt;br /&gt;                      transition:Boolean = false):void{&lt;br /&gt;                                 &lt;br /&gt;           super.drawItem(item,false,false,caret,transition)      &lt;br /&gt;          }&lt;br /&gt; ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;/mx:TileList&amp;gt;&lt;/pre&gt;&lt;br /&gt;As you can see, I override the selected and highlighted parameters with false, thereby eliminating the selected and roll over effect.  Seems to work quite well.  I now use this mxml component instead of TileList throughout my applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-4691309231537313398?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/4691309231537313398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=4691309231537313398' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4691309231537313398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4691309231537313398'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/11/losing-rollovercolor-in-tilelist.html' title='Losing the RollOverColor in TileList'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-6479892736210200106</id><published>2007-11-09T01:03:00.001-07:00</published><updated>2007-11-09T01:09:41.099-07:00</updated><title type='text'>Where or where has my intellisense gone?</title><content type='html'>I'm working on a flex 3 app using the latest flexbuilder 3 beta, both the plugin and standalone versions.  For some reason, in some mxml files my intellisense just seems to not work at all.  While in other mxml files the intellisense works fine.  Turns out that in this latest beta release, Flexbuilder gets cranky if you use double quotations in Metadata Event tags:&lt;br /&gt;&lt;br /&gt;[Event("forward", type="mx.events.Event")] will kill your intellisense and your control clicks.  You will feel very lonely.&lt;br /&gt;&lt;br /&gt;[Event('forward', type='mx.events.Event')] will make everything right again, blue coding skies ahead.&lt;br /&gt;&lt;br /&gt;On a side note, the single quote is actually only necessary on the type attribute, intellisense seems to work fine if you use double quotes on the Event name itself.&lt;br /&gt;&lt;br /&gt;Hopefully this will be fixed in the next release.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-6479892736210200106?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/6479892736210200106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=6479892736210200106' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6479892736210200106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6479892736210200106'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/11/where-or-where-has-my-intellisense-gone.html' title='Where or where has my intellisense gone?'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-7768174842295959012</id><published>2007-11-01T10:26:00.000-06:00</published><updated>2007-11-01T10:42:39.213-06:00</updated><title type='text'>Using floating IFrames in Flex 3 Beta: wmode buh-bye?</title><content type='html'>Just a quick one today... we're porting some work to Flex 3 where we do the floating Iframe thing, and noticed some strange behaviour changes.  In Firefox, the floating Iframe would briefly flash into view and then disappear, while in IE the Iframe would appear, however if we clicked into the IFrame embedded html page and then clicked outside it somewhere on the flex app, the IFrame would disappear from view.&lt;br /&gt;&lt;br /&gt;Took a little bit of sniffing around but in the end the culprit was the html-template\index.template.html file.  For some reason, and it might well be a very good reason, the property &lt;strong&gt;wmode &lt;/strong&gt;is no longer included in the flash player tags ("wmode", "opaque" in AC_FL_RunContent() &amp;&amp; wmode="opaque" in &amp;lt;EMBED&amp;gt;) in FlexBuilder 3. Once we added those back in, the floating IFrame started working again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-7768174842295959012?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/7768174842295959012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=7768174842295959012' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/7768174842295959012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/7768174842295959012'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/11/using-floating-iframes-in-flex-3-beta.html' title='Using floating IFrames in Flex 3 Beta: wmode buh-bye?'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-4404718626354438952</id><published>2007-10-25T16:56:00.000-06:00</published><updated>2007-10-25T23:33:08.052-06:00</updated><title type='text'>Not another Flex, AmfPHP, Cairngorm CodeGen!  MAKE IT STOP!</title><content type='html'>Haven't blogged in quite some time and this is a project that's been half done for far too long.  Like everyone else we decided to build our own code generator, just something fairly straightforward that would generate all the DAO code, the Cairngorm code, and a nice little interface to test all the main CRUD and DAD functions we have come to know and love.  Lately we've been busy souping up the generated UI, not so much in terms of style... beauty does not live here... functionality however does.&lt;br /&gt;&lt;br /&gt;You can get all the gory details by clicking on this link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.crazedcoders.com/php/codegen.php"&gt;http://www.crazedcoders.com/php/codegen.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We built this code to use AMFPHP, Cairngorm, PHP and Flex 2.01.  We've put in place validators, datepickers, checkboxes and textinputs on our forms and generated full Command/Event/Model/Controller classes.  We've implemented binding on the generated view form fields.  Our code generator will detect relationships between tables and render comboboxes accordingly, for example, if there's a foreign key on a customer table linked to a country table,  the customer view will have a combobox linked to the model.countries collection.  But I must stop, I'm getting too technical...&lt;br /&gt;&lt;br /&gt;Basically, if the generator runs successfully, you're a few clicks away from being able to manage the data in your database from Flex.  The generated code is zipped up for you to download.  Inside the zip you will find a complete and ready to import Flexbuilder Project and the php packages ready to copy into your amfphp services folder.  Further details can be found by clicking on the link.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-4404718626354438952?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/4404718626354438952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=4404718626354438952' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4404718626354438952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4404718626354438952'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/10/not-another-flex-amfphp-cairngorm.html' title='Not another Flex, AmfPHP, Cairngorm CodeGen!  MAKE IT STOP!'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-4523163008925371558</id><published>2007-05-30T00:39:00.000-06:00</published><updated>2007-05-30T00:53:50.634-06:00</updated><title type='text'>Flash.media.Sound &amp; Memory Issues in Flex</title><content type='html'>Taking a short break from my module woes, I've been working with audio in Flex.  In my app I was building a preview intro scan of my listed mp3's.  What I noticed is that as the list of mp3's got longer, the memory that my browser was eating up got larger.  I haven't really found any articles addressing best practices regarding handling audio in Flex, however I would venture a guess that this has been addressed many times in the past by Flash Developers.&lt;br /&gt;&lt;br /&gt;I'm pretty tired so I'll keep this simple.  Best way &lt;span style="font-style:italic;"&gt;I have found&lt;/span&gt; to ensure that an audio stream is destroyed and the memory returned when you stop it:&lt;pre&gt;&lt;br /&gt;      private var mySound:Sound = new Sound();&lt;br /&gt;      private var audio:SoundChannel = new SoundChannel();&lt;br /&gt;&lt;br /&gt;      private function startPlaying():void{&lt;br /&gt;        mySound = new Sound(new URLRequest("music/sample.mp3"));&lt;br /&gt;        mySound.addEventListener(Event.COMPLETE, completeSound);&lt;br /&gt;        audio = mySound.play();&lt;br /&gt;      }&lt;br /&gt;              &lt;br /&gt;      private function stopPlaying():void{&lt;br /&gt;        audio.stop();&lt;br /&gt;        mySound.removeEventListener(Event.COMPLETE,completeSound);&lt;br /&gt;        mySound = null;&lt;br /&gt;      }&lt;br /&gt;&lt;/pre&gt;Trick is to declare the variables outside the function, ensure you configure a sound channel (audio) for your sound, and make sure you that you can reference both from the stop function.  Then you need to stop the audio, remove any event listeners, and set sound to null.  I found it's also a good idea to do your URLRequest inline, as it seems to get destroyed at the same time as mySound.&lt;br /&gt;&lt;br /&gt;Short, simple.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-4523163008925371558?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/4523163008925371558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=4523163008925371558' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4523163008925371558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4523163008925371558'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/05/flashmediasound-memory-issues-in-flex.html' title='Flash.media.Sound &amp; Memory Issues in Flex'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-1782155516021671483</id><published>2007-05-12T23:36:00.001-06:00</published><updated>2011-01-05T13:31:15.845-07:00</updated><title type='text'>Can Cairngorm and Modules play nice? Sample App</title><content type='html'>First I'd like to say thanks to those of you that commented on my previous blog entry.  I was inspired to go back and take another look at ApplicationDomain.  To be honest, I can't get it to work for me.  So I'm just going to put up my prototype application with source code and let you play with it.   There is a shell application and 3 very simple modules.  The challenge is to have a controller in the shell and still have the modules all work independently of each other.    The sample app as it sits on the server works because it's essentially Cairngorm free.  Good luck!&lt;br /&gt;&lt;br /&gt;Source can be found &lt;a href="http://www.crazedcoders.com/demos/ModuleAppDomains/srcview/ModuleInAppDomain.zip"&gt;here&lt;/a&gt;.  Demo can be viewed &lt;a href="http://www.crazedcoders.com/demos/ModuleAppDomains/" target="_new"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-1782155516021671483?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/1782155516021671483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=1782155516021671483' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1782155516021671483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1782155516021671483'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/05/can-cairngorm-and-modules-play-nice_12.html' title='Can Cairngorm and Modules play nice? Sample App'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-6253425638290039881</id><published>2007-05-12T14:18:00.000-06:00</published><updated>2007-05-12T14:53:53.718-06:00</updated><title type='text'>Can Cairngorm and Modules play nice?</title><content type='html'>Let me say, first off, that my wife gave birth to a beautiful baby girl on Wednesday morning, and they are doing just fine. I've been relocated to the spare bedroom so that I can actually function during the day, however I'm missing about 30 hours of sleep this week that I'll never get back. Having said that, I am blogging today because even though I've sort of fixed my latest issues, I'm not entirely sure I've used the best approach.&lt;br /&gt;&lt;br /&gt;This is really a sequel to my previous blog... I am still fighting with getting modules to load properly and independently of each other and the shell flex application. Here's the deal...&lt;br /&gt;&lt;br /&gt;I have one complex flex module that is built on the Cairngorm 2.2 framework. In itself, the module works fine, and after the progress from the other day, loading multiple instances of the module into a simple shell works fine too. However, when I tried loading multiple instances of the module into the actual application, things died. Why? Because the shell is built on the Cairngorm framework as well. The minute I add in the &amp;lt;services:AppController id="appController"&amp;gt; line to my shell app, subsequent instances of the module don't load properly. I determined that the shell needed to use a different controller than the module, but that wasn't enough (though still necessary). There were funky things happening again when events were triggered - weird casting errors, events firing across multiple module instances, shared models, etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;A couple of observations:&lt;/strong&gt;&lt;br /&gt;CairngormEventDispatcher basically returns a singleton. If the shell app gets an instance of this class, then any Modules that load will use the same instance. So, adding the appcontroller to the application will in fact get an instance of the dispatcher. Running through the debugger, I noticed that as I loaded each new instance of the same module, event listeners were added to the singleton's eventDispatcher. So, say your module was listening for the ContactEvent.LOAD_CONTACT event. If you loaded 3 instances of that module, your controller would execute 3 commands, once for each module.&lt;br /&gt;&lt;br /&gt;When an event is received by a command, and you try to cast that event back to its origin, i.e. ContactEvent(event), it will only work in the module that actually originated the event. The other modules will throw the following exception:&lt;br /&gt;" cannot convert com.crazedCoders.moduleTest.event::ContactEvent@4b23281 to com.crazedCoders.moduleTest.event.ContactEvent." Trying to test for it, i.e. if(event is ContactEvent) doesn't work since the event is in fact a ContactEvent. Very frustrating.&lt;br /&gt;&lt;br /&gt;If you do not use any Caingorm in your shell application, you will not run into these issues, so for some that might be the quick solution.  Sadly I was not afforded that luxury, so I had to find another way.&lt;br /&gt;&lt;br /&gt;Since I was trying to treat each Module as an autonomous mini-application, I decided that I needed a CairngormEventDispatcher specifically for each Module and the Application.  I created a Factory Class that would do just that.  Here's the code:&lt;pre&gt;package com.adobe.cairngorm.control{&lt;br /&gt;  import mx.modules.ModuleManager;&lt;br /&gt;  public class CairngormEventDispatcherFactory&lt;br /&gt;  {&lt;br /&gt;  private static var instances : Array = new Array;&lt;br /&gt;  public static function getDispatcher(obj:Object) : CairngormEventDispatcher&lt;br /&gt;  {&lt;br /&gt;  // in order for each module developed using cairngorm to be able&lt;br /&gt;  // to work independently of the shell and other modules,&lt;br /&gt;  // we need to create a hash map of cairngormeventdispatchers&lt;br /&gt;  // that are keyed on module instance or application.&lt;br /&gt;  // This prevents cross module listening for events,&lt;br /&gt;  // which is beneficial especially when loading multiple instances&lt;br /&gt;  // of the same module&lt;br /&gt;  var ed:Object = ModuleManager.getAssociatedFactory(obj);&lt;br /&gt;  var parent:String = "application";&lt;br /&gt;  if(ed != null){&lt;br /&gt;    trace(ed.name); &lt;br /&gt;    parent = ed.name;&lt;br /&gt;  }&lt;br /&gt;  if(instances[parent] == null){&lt;br /&gt;    var cgDispatcher:CairngormEventDispatcher = new CairngormEventDispatcher();&lt;br /&gt;    instances[parent] = cgDispatcher;&lt;br /&gt;    return cgDispatcher;&lt;br /&gt;  }&lt;br /&gt;  else{&lt;br /&gt;    return instances[parent];&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;It took me a while, but eventually I stumbled upon ModuleManager.getAssociatedFactory(object).  This function *seems* to be able to figure out within the context of which Module (if any) the object was instantiated.  If an object belongs to the shell, it returns null, if not, then it returns a ton of information, including a name property that contains a unique name i.e. instance77 for the loaded module.  I create a new instance of the CairngormEventDispatcher for each instance and stuff it in the static associative array, then I replace the usual&lt;em&gt; CairngormEventDispatcher.getInstance().dispatchEvent(...)&lt;/em&gt; with&lt;br /&gt;&lt;em&gt;CairngormEventDispatcherFactory.getDispatcher(this).dispatchEvent(...));&lt;/em&gt;&lt;br /&gt;Now the application shell and each module gets it's own singleton, and the overlap seems to be taken care of.&lt;br /&gt;&lt;br /&gt;Again, I welcome any feedback.  I'm not particularily fond of this solution, and I hope someone out there can offer a better one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-6253425638290039881?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/6253425638290039881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=6253425638290039881' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6253425638290039881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6253425638290039881'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/05/can-cairngorm-and-modules-play-nice.html' title='Can Cairngorm and Modules play nice?'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-814819629434802113</id><published>2007-05-07T22:01:00.000-06:00</published><updated>2007-05-07T22:23:44.905-06:00</updated><title type='text'>Loading Multiple Independent Instances of a Module</title><content type='html'>So, it's Monday night... my wife's contractions are 13 minutes apart, and it seems I have nothing better to do than blog.  Of course, this is more akin to the calm before the storm that will be the next 24 hours and probably the next six months.  Eventually I will once again emerge from the dark precipice that lies ominously before me.  But on to modules.&lt;br /&gt;&lt;br /&gt;I love Cairngorm... I just upgraded all my projects 2.2 and it was painless, nothing like child labor, I'm told.  I am working on a project where we have to build all these pretty much independent modules, and in these modules we stick to Cairngorm as well.&lt;br /&gt;&lt;br /&gt;The first problem we ran into occurred when attempting to load 2 instances of the same module.  ModuleManager, as it turns out, keys modules by url.  So if you try to load the same module twice, you're just getting a reference to the same one.  There is no way around this (or so I thought)  This has a number of repercussions:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Only one ServiceLocator instance can be instantiated&lt;/strong&gt;&lt;/span&gt; - this wonderful little Error message pops up the minute you load a second instance of the module.  Quick workaround is to declare the system locator code much like you do model:&lt;br /&gt;&lt;em&gt;private var dataServices:ServiceLocator = ServiceLocator.getInstance();&lt;br /&gt;&lt;/em&gt;and abstain from using the mxml format:&lt;br /&gt;&lt;em&gt;&amp;lt;business:Services id="dataServices" /&amp;gt;&lt;/em&gt;&lt;/li&gt;&lt;li&gt;All your module instances will share the same model... so if you say do a search, get a searchresult back and stick that in your model, all your modules will display the same search results, which defeats the purpose of having separate file/image search browsers (for example).&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Here's a couple other funky things I tried:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Created 2 modules pretty much identical, Mod1.swf and Mod 2.swf.  I loaded them up and they both worked fine and independently&lt;/li&gt;&lt;li&gt;Created a copy of Mod1.swf and called it Mod1a.swf.  I loaded them up and they both worked fine.&lt;/li&gt;&lt;li&gt;Tried loading two Mod1.swf and suddenly no independence, plus the ServiceLocator error.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I tried wiring up my own ModuleManager, but after a good couple hours I gave up... I was getting all sorts of weird behaviour.  I figured out that everything is based around the url that you pass to ModuleManager or ModuleLoader.  I was pretty much ready to give up when I had this really silly notion, I did this: &lt;pre&gt;private var count:int;&lt;br /&gt;private var spaces:String = "";&lt;br /&gt;private function LoadModule():void{&lt;br /&gt;  for (var x:int; x &lt; count; x++) spaces += " ";&lt;br /&gt;  var info:IModuleInfo = ModuleManager.getModule("mod1.swf" + spaces);&lt;br /&gt;  info.addEventListener(ModuleEvent.READY, done);&lt;br /&gt;  info.load();&lt;br /&gt;  count ++;&lt;br /&gt;}&lt;br /&gt;private function done(event:ModuleEvent):void{&lt;br /&gt;  var visual:DisplayObject = event.module.factory.create() as DisplayObject;&lt;br /&gt;  tabber.addChild(visual);&lt;br /&gt;}&lt;/pre&gt;Much to my surprise, this hack worked.  The modules loaded successfully and ran independently.  Of course, I probably need to test this some more, but I figured I'd blog it quick before the trauma of childbirth hopefully graces me with some convenient and kind short term memory loss.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-814819629434802113?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/814819629434802113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=814819629434802113' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/814819629434802113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/814819629434802113'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/05/loading-multiple-independent-instances.html' title='Loading Multiple Independent Instances of a Module'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-1899350864443388976</id><published>2007-04-27T00:33:00.000-06:00</published><updated>2007-04-27T01:07:08.457-06:00</updated><title type='text'>Mapping VO's from Flex to PHP using AMFPHP</title><content type='html'>I sometimes wonder why it is that I never seem to blog till shortly after the midnight hour...  oh well... life just gets too crazy when the sun is up.  So as it happens, one of my minions spent the better part of today putting together php classes, using a nifty code generator found called &lt;a href="http://titaniclinux.net/daogen"&gt;DAO Generator&lt;/a&gt; by the guys over at Titantic Linux.  It seems to do a pretty decent job of generating the sql necessary to create the db table, and then builds three additional files, the VO, a datasource file, and then finally a DAO file that has a ton of functions in it. (and I mean a ton!)&lt;br /&gt;&lt;br /&gt;Going to take a moment here to give credit where credit is due... Michael Ramirez's tutorial on &lt;a href="http://www.howtoforge.com/amfphp_adobe_flex2_sdk"&gt;Using Amfphp 1.9 with the Adobe Flex 2 SDK&lt;/a&gt; is what really got us started in the right direction, it's pretty detailed and yet easy to follow.  We quickly were able to get our AMFPHP up and running with the tutorial files as outlined by Michael.  Tickled pink by the code generator we figured we could easily start building our own php gateway.  But enough background... on to the thick of things.&lt;br /&gt;&lt;br /&gt;Passing VO's from PHP seems to be very well covered in numerous articles on the web, and it involves mainly adding a var $_explicitType="tutorials.Person" to the php VO, with a value that corresponds to the [RemoteClass(alias="tutorials.Person")] in the Flex VO.  Pretty straightforward and foolproof.  But no one seems to spend any time talking about going back the other way.&lt;br /&gt;&lt;br /&gt;Generally when a VO is passed from Flex to AMFPHP, it is treated as an Associative Array.  In Michael's examples, he treats the ValueObject that is passed back to Save function as just that $valueObject["lastName"].  But we were pretty keen on using the generated code, which actually uses the syntax $valueObject-&gt;getLastName().   And this of course, failed, because the $valueObject being passed to PHP from Flex was not in fact being mapped back to the right VO, or any php VO for that matter.&lt;br /&gt;&lt;br /&gt;Turns out, after much googling, that only under certain conditions will AMFPHP successfully map an incoming Flex VO to the corresponding PHP VO.  In the globals.php, found at the root of the AMFPHP folder structure, you'll find the following line:&lt;br /&gt;&lt;br /&gt; $voPath = "services/vo/";&lt;br /&gt;&lt;br /&gt;Meanwhile we had been placing our VO in the same folder as our Datasource and DAO files, something like com/crazedCoders/testapp, and this was off the services/ folder, not the services/vo folder.  In fact we didn't even have a /vo folder.  I found this little tidbit of information: &lt;em&gt;"As for incoming class mapping, remember that if amfphp doesn't find the class to be mapped in the services/vo folder, it will simply deserialize the object as though it were untyped, that is, as an associative array. "&lt;/em&gt; in this &lt;a href="http://www.5etdemi.com/blog/archives/2007/01/why-you-shouldnt-use-class-mapping-and-vos-in-amfphp/"&gt;blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It took a little bit of playing around but ultimately, without making any changes to the core AMFPHP files, I was able to get the reverse mapping working successfully.  This is what that looked like:&lt;pre&gt;//file: src/tutorials/Person.as&lt;br /&gt;package tutorials{   &lt;br /&gt;[RemoteClass(alias="tutorials.Person")]   &lt;br /&gt;[Bindable]  &lt;br /&gt;public class Person    {       &lt;br /&gt;   public var firstName:String;       &lt;br /&gt;   public var lastName:String;       &lt;br /&gt;   public var phone:String;       &lt;br /&gt;   public var email:String;   &lt;br /&gt;}}&lt;/pre&gt; and then in php:&lt;pre&gt;&amp;lt;?php&lt;br /&gt;//file: services/vo/tutorials/Person.php&lt;br /&gt;class Person { &lt;br /&gt;  var $firstName; &lt;br /&gt;  var $lastName; &lt;br /&gt;  var $phone; &lt;br /&gt;  var $email;   &lt;br /&gt;// explicit actionscript package &lt;br /&gt;  var $_explicitType = "tutorials.Person";}&lt;br /&gt;  function formatLastName(){&lt;br /&gt;      $lastName = strtolower($lastName); }&lt;br /&gt;?&amp;gt;&lt;/pre&gt;To test the mapping I added the following function to a PersonService.php file:&lt;pre&gt;//file: services/tutorials/PersonService.php&lt;br /&gt;  function modify($person){ &lt;br /&gt;    //this will call a function on person and return it &lt;br /&gt;    $person-&gt;formatLastName();&lt;br /&gt;    return $person;  &lt;br /&gt;}&lt;/pre&gt;Only if the valueobject was mapped correctly would it be able to call the function on the PHP VO.  In Flex I just created a Person object, passed it in to the remoteobject call, and observed the formatting of the last name on the Person object that was returned.&lt;br /&gt;&lt;br /&gt;Again, I hope this will save others the time that it took me to figure this out.  Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-1899350864443388976?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/1899350864443388976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=1899350864443388976' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1899350864443388976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1899350864443388976'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/04/mapping-vos-from-flex-to-php-using.html' title='Mapping VO&apos;s from Flex to PHP using AMFPHP'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-4073232602140862837</id><published>2007-04-25T16:26:00.001-06:00</published><updated>2011-01-05T13:37:35.900-07:00</updated><title type='text'>SizeableTitleWindow &amp; Custom Skins</title><content type='html'>Most of you are probably familiar with the SizeableTitleWindow.as that the CF code generator for Flexbuilder spits out, along with a plethora of other useful tidbits of code.  In fact that was the only reason I initially installed Coldfusion and the tools - I saw a modal resizable window in Flex and absolutely had to have it!&lt;br /&gt;&lt;br /&gt;That was like 8 months ago.  Recently I started working a lot more closely with skinning and runtime loading of css.  I created some really funky UI's using run time style sheets that I found at http://www.scalenine.com, in particular I like using the Obsidian Theme Skin.  However, this skin, like many others, replaces the skins for the Panel control - which, though very cool, breaks the resize function of the SizeableTitleWindow.&lt;br /&gt;&lt;br /&gt;In simple terms, an event listener attached to the MouseOver event checks the coordinates of the mouse and if the coordinates fall within the right range, a cursor image is assigned.  When the user clicks the mouse, the mouse down event checks which cursor is active and acts accordingly. The only problem is that all the coordinate calculations are based on event.localX and event.localY and those relate to event.target.  However when using skins, the event.target isn't the SizeableTitleWindow but rather the skin, so it throws everything off.  The result?  The east and south cursors don't appear and even when they do, the drag functionality is buggy at best.&lt;br /&gt;&lt;br /&gt;I fixed the problem by replacing all localX and localY with event.currentTarget.mouseX and event.currentTarget.mouseY.  Also I no longer check to see if event.target is SizeableTitleWindow, and that seems to have fixed it.&lt;br /&gt;&lt;br /&gt;You can find this code in action &lt;a href="http://www.crazedcoders.com/demos/sizeablewindow/"&gt;here&lt;/a&gt; and the source &lt;a href="http://www.crazedcoders.com/demos/sizeablewindow/srcview/ModuleWindowManager.zip"&gt;here&lt;/a&gt;.   Enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-4073232602140862837?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/4073232602140862837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=4073232602140862837' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4073232602140862837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4073232602140862837'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/04/sizeabletitlewindow-custom-skins.html' title='SizeableTitleWindow &amp; Custom Skins'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-1709033370674017528</id><published>2007-04-20T18:19:00.000-06:00</published><updated>2007-04-20T19:01:22.107-06:00</updated><title type='text'>Flex Modules, Compile and Run Time CSS</title><content type='html'>I've recently become involved in building a very module based Flex app, where the question of css and css inheritance came up, particularly with respect to how Flex handles run time loading of style sheets when they are loaded within not only the shell application but also the therein loaded modules.&lt;br /&gt;&lt;br /&gt;Essentially, there are 3 rules that prevail:&lt;br /&gt;&lt;ol style="font-style: italic;"&gt;&lt;li&gt;The most recent style to be loaded always wins.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Run time overrides compile time styles&lt;br /&gt;&lt;/li&gt;&lt;li&gt;StyleManager is a global Manager &lt;/li&gt;&lt;li&gt;Style inheritance is granular to the attribute level&lt;/li&gt;&lt;li&gt;Compile time css will only compile styles found in Application&lt;/li&gt;&lt;/ol&gt;Let me explain further, and to do so I'm just going to use our trusty &amp;lt;mx:Button&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The most recent style loaded always wins&lt;/span&gt;&lt;br /&gt;Say you load a runtime style sheet with the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Button &lt;/span&gt;{&lt;br /&gt;   fillColors: #ff0000, #ff0000, #ffffff, #eeeeee; /*red */&lt;br /&gt;   letterSpacing:3;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Then in a (rather large) module you load another runtime style sheet with this:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Button&lt;/span&gt; {&lt;br /&gt;   fillColors: #006600, #009900, #ffffff, #eeeeee; /*green*/&lt;br /&gt;   letterSpacing:1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You'll notice that the first color style is applied right away, to any buttons in the shell application.  However, when the second module finishes loading, all Buttons will change from Green to Red, and spacing will be reduced to 1.  To make it even more interesting, you could add an additional module of roughly the same size as the first and have it load its own style sheet.  Then the end result is pretty much random, whichever module takes the longest to load wins, the shell run time style never to be heard from again.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Run time overrides compile time styles&lt;/span&gt;&lt;br /&gt;In your shell application you add the following:&lt;br /&gt;&amp;lt;style&amp;gt;&lt;br /&gt; Button{&lt;br /&gt;        fillColors: #9900ff, #9900ff, #ffffff, #eeeeee;&lt;br /&gt;        letterSpacing:1;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;br /&gt;Once your app loads the run time css, this will be overwritten.   Now if you have a huge run time css swf with massive fonts or images embedded in, there's a chance you might even see your original color first and then have it overwritten later.  This can cause for some funky effects in your app, in which case you might want to attach an eventListener to StyleEvent.COMPLETE, and hide your interface until that event has triggered using a ViewState or the like.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;StyleManager is a global Manager&lt;/span&gt;&lt;br /&gt;It that does &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; distinguish between &amp;lt;Applications&amp;gt; and &amp;lt;Modules&amp;gt;.  Say you create a custom style class called .myDogAteMyHomeworkButton for Buttons in your module.  You then place a corresponding style entry in your compile time or run time styles for this module.  Now someone else happens, just happens to use the same exact style class in their module.  Or the shell application developers happens to do so.  Well again, the last one loaded wins.  Your custom style class is never safe.  But then again neither are their's.  The best thing you can do is be very very unique in your style class naming conventions, and hope for the best.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Style inheritance is granular to the attribute level&lt;/span&gt;&lt;br /&gt;Getting back to our original example, you'll notice the style attribute letterSpacing was defined explicitly in both style sheets.  Because inheritance is on the attribute level, if you do not specify an attribute in say your run time style sheet for your application, then that attribute can be set in compile time style tags and it will override the default values.  What's the lesson to be learned here?  If you want to make sure that your runtime css has the final word, then get detailed and explicitly list every style attribute and its value, even if the default will suffice.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Compile time css will only compile styles found in Application&lt;/span&gt;&lt;br /&gt;Ever seen this warning "The type selector 'HDividedBox' was not processed, because the type was not used in the application."?  Until the dawn of Modules, this was a message I generally ignored.  Made sense to me, if I didn't have an HDividedBox anywhere in my application, why include the style?  But what would happen to modules that perhaps do use the HDividedBox control but rely solely on the shell application styles for their look and feel?  The application doesn't know at runtime that one or more of its modules will need this style defined, so therefore it just ignores it.  End result, your HDividedBox in your module will not be styled properly.  The solution?  Use run time stylesheets.  (and that's how this all began!)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-1709033370674017528?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/1709033370674017528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=1709033370674017528' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1709033370674017528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1709033370674017528'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/04/flex-modules-compile-and-run-time-css.html' title='Flex Modules, Compile and Run Time CSS'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-6253400458865080222</id><published>2007-04-10T00:32:00.000-06:00</published><updated>2007-04-10T01:08:16.214-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='iframe'/><category scheme='http://www.blogger.com/atom/ns#' term='externalinterface'/><title type='text'>A closer Look at IFrames and ExternalInterface in Flex</title><content type='html'>Well I've been super busy as usual, working on some pretty cool stuff, still managing to only put food on the table but also sticking to my guns and doing only Flex projects. Of course, my blogging has suffered dearly.&lt;br /&gt;&lt;br /&gt;In one of my current projects, I am faced with the challenge of somehow embedding IFrames inside my flex app, however without having any control over the html wrapper that my Flex app will sit in. Sure I could 'advise' users on adding the appropriate javascript functions and the hidden div element at the bottom of the body, as we've seen in other Flex Iframe examples out there. But I figured there had to be a way to do this without needing to rely on this external dependency.&lt;br /&gt;&lt;br /&gt;As it turns out I can do inline Javascript function calls within my ExternalInterface.call, an example of this would be:&lt;br /&gt;&lt;pre&gt;ExternalInterface.call("function(){return window.location.href;}");&lt;/pre&gt;which is a simple little function to quickly get the address of the current page. Another handy example is this one:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ExternalInterface.call("function(){document.location.href=document.location;}");&lt;/pre&gt;This is a quick way for a user to 'logout' of the flex application, it simply reloads the web page. So as you can see, we can do a great deal without ever needing to touch the html wrapper. So why not do the same thing with Iframe support? Here's what I came up with:&lt;br /&gt;&lt;pre&gt;ExternalInterface.call("function(){" +&lt;br /&gt;          "var tempIFrame=document.createElement('div');" +&lt;br /&gt;         "tempIFrame.setAttribute('id','vyFrame');" +&lt;br /&gt;         "tempIFrame.style.position='absolute';" +&lt;br /&gt;         "document.body.appendChild(tempIFrame);" +&lt;br /&gt;         "tempIFrame.style.backgroundColor='transparent';" +&lt;br /&gt;         "tempIFrame.style.border=0;" +&lt;br /&gt;         "tempIFrame.style.visibility='hidden';}"); &lt;/pre&gt;I am going to try and create a div element in memory and append it to the DOM.  It's best to run this code during the application preinitialize() event. However, before I move on to explain the rest I just want to mention that I did run into some issues here with IE6. As you'll notice I appendChild and then I set the styles. Turns out that if I manipulate a new element too much prior to adding it to the DOM, it just gets all flaky and will not work. Believe me, this was not an easy bug to track down!&lt;br /&gt;&lt;br /&gt;Now, we need to change the remaining externalInterface calls as well... things like move, hide, show and source. Building on the example at &lt;a href="http://www.deitte.com/archives/2006/08/finally_updated.htm" target="_new"&gt;deitte.com&lt;/a&gt; that first got me started ages ago,  I changed all the calls as they are found in his IFrame.mxml component:&lt;br /&gt;&lt;br /&gt;ExternalInterface.call("moveIFrame",globalPt.x ,&lt;br /&gt;      globalPt.y, this.width, this.height);&lt;br /&gt;&lt;b&gt;Becomes:&lt;/b&gt;&lt;pre&gt;ExternalInterface.call("function(){" +&lt;br /&gt;     "var frameRef=document.getElementById('vyFrame');" +&lt;br /&gt;     "frameRef.style.left=" + globalPt.x + ";"+&lt;br /&gt;     "frameRef.style.top=" + globalPt.y + ";" +&lt;br /&gt;     "var iFrameRef=document.getElementById('vyIFrame');" +&lt;br /&gt;     "iFrameRef.width=" + this.width + ";" +&lt;br /&gt;    "iFrameRef.height=" + this.height + ";}");&lt;/pre&gt;ExternalInterface.call("loadIFrame", source);&lt;br /&gt;&lt;b&gt;Becomes:&lt;/b&gt;&lt;pre&gt;ExternalInterface.call("function(){vyFrame.innerHTML='" +&lt;br /&gt;     "&amp;lt;iframe id=\"vyIFrame\" src=\"" +  source +&lt;br /&gt;     "\" frameborder=\"0\"&amp;gt;&amp;lt;/iframe&amp;gt;';}");&lt;/pre&gt;ExternalInterface.call("showIFrame");&lt;br /&gt;&lt;b&gt;Becomes:&lt;/b&gt;&lt;pre&gt;ExternalInterface.call("function(){" +&lt;br /&gt;     "document.getElementById('vyFrame').style.visibility='visible';}");&lt;/pre&gt;ExternalInterface.call("hideIFrame");&lt;br /&gt;&lt;b&gt;Becomes:&lt;/b&gt;&lt;pre&gt;ExternalInterface.call("function(){" +&lt;br /&gt;    "document.getElementById('vyFrame').style.visibility='hidden';}");&lt;/pre&gt;&lt;br /&gt;After a bit of testing I did manage to get this to work, sort of.  I ended up spending some time playing with the compiler options in Flexbuilder.  I found that if I turned off history management, my Iframes wouldn't appear.  However removing the script reference to history.js seemed to have no real effect.  For those of you that are not Flash-savvy :) it turned out that the only things to really watch out for, and again I am at the mercy of the users who embed my flex app into their html pages, is that the AC_FL_RunContent() has a final parameter setting of "wmode", "opaque" and the object embed tag also contains wmode="opaque". If this setting is not there or set incorrectly the Iframe will appear behind your flash player.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-6253400458865080222?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/6253400458865080222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=6253400458865080222' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6253400458865080222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6253400458865080222'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/04/closer-look-at-iframes-and.html' title='A closer Look at IFrames and ExternalInterface in Flex'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-9127242459374524612</id><published>2007-02-15T15:15:00.000-07:00</published><updated>2007-02-15T15:32:51.834-07:00</updated><title type='text'>Export Data from Flex App using Coldfusion</title><content type='html'>It's been a while since I blogged, just so amazingly busy these days that I barely have time to breathe, let alone blog.  I'm currently up to my neck in building a flex app that uses Coldfusion 7.02 and DB2 v8/9 on the back end.  I've never used Coldfusion before so it's been one hell of a time.  I managed to figure something out today that I think is definitely worth sharing.  In the app I was required to find a way for users to 'export' or 'save' their work to their drive, in a format they could easily open directly.  That eliminated shared objects and I wasn't allowed to use a third party tool like swfStudio to build a helper app and use Localconnection to get the job done (can't wait for Apollo!)&lt;br /&gt;&lt;br /&gt;I don't have much time so I'm going to just paste code and explain a bit.&lt;br /&gt;&lt;br /&gt;Step 1.  Enable session management in the CF app.  Create an Application.cfm file in the root of your CF application, put this in it:&lt;pre&gt;&amp;lt;CFAPPLICATION NAME="Name" SESSIONMANAGEMENT="Yes"&amp;gt;&lt;/pre&gt;Step 2.  Create a CFC that takes whatever data you wish to save and sticks it in a session variable, return a boolean to let Flex now this worked(Export.cfc):&lt;pre&gt;&amp;lt;cfcomponent&amp;gt;&lt;br /&gt; &amp;lt;cffunction name=&amp;quot;toXml&amp;quot; access=&amp;quot;remote&amp;quot; returntype=&amp;quot;boolean&amp;quot; output=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;  &amp;lt;cfargument name=&amp;quot;data&amp;quot; type=&amp;quot;string&amp;quot; required=&amp;quot;yes&amp;quot; default=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;cfset session.exportData = #arguments.data#&amp;gt;&lt;br /&gt;  &amp;lt;cflog text=&amp;quot;data to be exported: #session.exportData#&amp;quot;/&amp;gt; &lt;br /&gt;  &amp;lt;cfreturn true&amp;gt;&lt;br /&gt; &amp;lt;/cffunction&amp;gt;&lt;br /&gt;&amp;lt;/cfcomponent&amp;gt;&lt;/pre&gt;Step 3.  Create a CFM file in the application root that will grab the session variable and output it to http, while flagging it as an attachment (this causes nice save as popup to appear).  In my example I'm creating an xml file and I ran into issues with whitespace, hence the cfsetting.. this fixed the problem for me (getFile.cfm)&lt;pre&gt;&amp;lt;cfsetting enablecfoutputonly=&amp;quot;true&amp;quot; showdebugoutput=&amp;quot;No&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;cfheader name=&amp;quot;Content-Disposition&amp;quot;&lt;br /&gt;value=&amp;quot;attachment; filename=export.xml&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;cfcontent type=&amp;quot;xml/text&amp;quot; reset=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;cfscript&amp;gt;&lt;br /&gt; WriteOutput(session.exportData);&lt;br /&gt;&amp;lt;/cfscript&amp;gt;&lt;br /&gt;&amp;lt;cfexit /&amp;gt;&lt;/pre&gt;Step 4.  In flex declare the remote object that will call the cfc:&lt;pre&gt; &amp;lt;mx:RemoteObject &lt;br /&gt;      id=&amp;quot;exportManager&amp;quot; &lt;br /&gt;      destination=&amp;quot;ColdFusion&amp;quot; &lt;br /&gt;      source=&amp;quot;com.sample.utils.Export&amp;quot; &lt;br /&gt;      showBusyCursor=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;     &amp;lt;mx:method name=&amp;quot;toXml&amp;quot; result=&amp;quot;login_result(event)&amp;quot; fault=&amp;quot;serverFault(event)&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/mx:RemoteObject&amp;gt;&lt;/pre&gt;Step 5.  Add your code to call it and handle the result. The result, on success, will make an httpservice call to the CFM you created:&lt;pre&gt;private function test():void{&lt;br /&gt;   exportManager.toXml("&lt;?xml version='1.0' encoding='utf-8'?&gt;" +&lt;br /&gt;        "&lt;exporttests&gt;" +&lt;br /&gt;        "&lt;test id="'1'"&gt;The application has successfully exported this file&lt;/test&gt;" +&lt;br /&gt;        "&lt;test id="'2'"&gt;Eventually the actual data will be passed into this function&lt;/test&gt;" +&lt;br /&gt;        "&lt;/exporttests&gt;");&lt;br /&gt;}&lt;br /&gt;private function login_result(event:ResultEvent):void{&lt;br /&gt;   if(event.result == "true"){&lt;br /&gt;        var request:URLRequest = new URLRequest("getFile.cfm");&lt;br /&gt;        flash.net.navigateToURL(request, "_self");&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;Conclusion.  Basically that's it.  I had issues with the session not persisting from setting the variable to getting it, but adding the application.cfm fixed that.  I can now push any xml data to the browser for saving.  There's lots of other possibilities here as well, such as exporting to Excel or Word, but there's other articles out there that you can google which explain how to do those specific tasks in Coldfusion.  Hope this helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-9127242459374524612?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/9127242459374524612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=9127242459374524612' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/9127242459374524612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/9127242459374524612'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2007/02/export-data-from-flex-app-using.html' title='Export Data from Flex App using Coldfusion'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-312262354902416727</id><published>2006-12-31T02:02:00.000-07:00</published><updated>2006-12-31T02:17:33.346-07:00</updated><title type='text'>Setting up Db2 v9 as a Coldfusion Datasource</title><content type='html'>In the last few weeks I've had the opportunity to get to know Coldfusion just a little bit better.   One of the first challenges I faced is getting CF talking to Db2, so I could take advantage of the CF Extensions for Flexbuilder and that funky Wizard.  To be precise I used ColdFusion MX 7.02 and DB2 Community Express Edition v9.1&lt;br /&gt;&lt;br /&gt;This doesn't just apply to Flex, but maybe others might find this useful.  Keep in mind I have only tested this in Windows:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Install the db2 client or get access to a machine that does.  I installed db2  in the default folder on my dev machine to get this working.&lt;/li&gt;&lt;li&gt;Copy C:\Program Files\IBM\SQLLIB\java\db2java.zip to C:\CFusionMX7\lib.  &lt;em&gt;Important&lt;/em&gt;: Make sure db2jdbc.dll is in the path somewhere or copy it to same folder!&lt;/li&gt;&lt;li&gt;Restart Coldfusion MX.  Login to CF Admin.  Go to Datasources.&lt;/li&gt;&lt;li&gt;Add new Datasource:&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;driver type&lt;/strong&gt; Other&lt;/li&gt;&lt;li&gt;&lt;strong&gt;CF DataSource Name&lt;/strong&gt;: [sourcename]&lt;/li&gt;&lt;li&gt;&lt;strong&gt;JDBC url:&lt;/strong&gt;  jdbc:db2:[dbname]&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Driver Class:&lt;/strong&gt; COM.ibm.db2.jdbc.app.DB2Driver&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Driver Name:&lt;/strong&gt; DB2Driver&lt;/li&gt;&lt;li&gt;&lt;strong&gt;username:&lt;/strong&gt; [name]&lt;/li&gt;&lt;li&gt;&lt;strong&gt;password:&lt;/strong&gt; [password]&lt;/li&gt;&lt;li&gt;[Submit]&lt;/li&gt;&lt;/ul&gt;Couple things to note.  Out of the blue the other day suddenly I started getting this db2jdbc not found in java path error... I figure something I installed hooped my system path.  Instead of messing around with why, I figured out that just copying the dll into my CF lib folder fixed the problem.   The ...app.DB2Driver is specific to Windows OS I believe.  The username and password are usually a Windows account... probably best to use the account that has admin rights to db2 at least until you get it working. &lt;br /&gt;&lt;br /&gt;I also did spend a good chunk of time trying to get the built in driver to talk to db2... I personally had no luck whatsoever, and I have read in other places that the drivers generally are only backwards compatible... the driver that ships with CF is definitely not v9, I think it might be v7... not sure though.  I did test the backward compatibility claim by using the v9.1 jdbc driver against a db2 v8.x datasource and it worked fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-312262354902416727?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/312262354902416727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=312262354902416727' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/312262354902416727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/312262354902416727'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/12/setting-up-db2-v9-as-coldfusion.html' title='Setting up Db2 v9 as a Coldfusion Datasource'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-1221139135510195648</id><published>2006-12-31T01:37:00.000-07:00</published><updated>2006-12-31T02:01:25.889-07:00</updated><title type='text'>DoubleClickEnabled &amp; other little Flex tips</title><content type='html'>Want to code against double clicks in Flex?  Don't forget to set this property to true!&lt;br /&gt;&lt;br /&gt;Adding child objects to a canvas or some other container and need to keep the scroll moving down so users can see the new objects?  Put this in a function:&lt;br /&gt;&lt;em&gt;canvas.verticalScrollPosition = canvas.maxVerticalScrollPosition + 45;&lt;/em&gt;&lt;br /&gt;And remember to CallLater, this gives Flex a chance to lay the new object out and get you the right maxVerticalScrollPosition!&lt;br /&gt;&lt;br /&gt;Are those child objects some kind of data entry control?  Attach an event listener to the event&lt;br /&gt;FocusEvent.FOCUS_IN for the object and point it to a function that does this:&lt;br /&gt;&lt;em&gt;private function test(event:FocusEvent):void{&lt;br /&gt;canvas.verticalScrollPosition = event.currentTarget.y - canvas.height + 45;&lt;br /&gt;}&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Having issues with the &lt;strong&gt;custom Item Renderer&lt;/strong&gt; in your TileList not updating when the underlying data changes?  Make sure you're not using an ArrayCollection, it doesn't quite work every time.&lt;br /&gt;&lt;br /&gt;Pulling data from a .Net webservice and having to parse out the date from the xml with your own Date Utility?  Just remember that in AS3  months, hours, minutes and seconds are 0 based... in other words, October is month 09, not 10.  That took me a while to clue in to.&lt;br /&gt;&lt;br /&gt;Want to display hierarchical data relationships in a tree view?  Stick the child objects in an arraycollection and assign it to a property called &lt;strong&gt;children &lt;/strong&gt;in the parent object.  This can be repeated down the chain as often as you like but remember it can get a bit slow quickly.  Then point the Tree dataProvider property at the topmost object of the hierarchy.&lt;br /&gt;&lt;br /&gt;Sometimes building a Flex front end on a .Net webservice back end can get complicated, especially when the developer (me) doesn't have access to the webservice.  If the .Net webservice is designed right, simply taking the resulting xml of the webservice calls and using HttpService calls to load the xml works.  When it comes time to use the webservice directly, simply replace the HttpService calls with WebService calls.   Works like a charm!&lt;br /&gt;&lt;br /&gt;Here's something silly.  I stuck aTabNavigator in my view, and tried to capture the click event on the tabs.  I tried pretty much every event I could find but not a single one would trigger when clicking on the tab.  I replaced the tabNavigator with a TabBar and a ViewStack, and then was able to trap the tabIndexChange event to get the desired result.&lt;br /&gt;&lt;br /&gt;Not my usual blog style but things are pretty busy these days.  I hope to blog more again in the new year.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-1221139135510195648?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/1221139135510195648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=1221139135510195648' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1221139135510195648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1221139135510195648'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/12/doubleclickenabled-other-little-flex.html' title='DoubleClickEnabled &amp; other little Flex tips'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-4268537176775668418</id><published>2006-12-07T14:32:00.001-07:00</published><updated>2011-01-05T13:38:42.738-07:00</updated><title type='text'>Autosizing Datagrid with Horizontal Scrolling</title><content type='html'>Today I was tasked with creating a spreadsheet like datagrid, one with more columns than what the available real estate would be able to show.  The datagrid was to always use the maximum screen space available so that for those users with huge budgets and subsequently huge monitors would not need to scroll.  For all other, more mortal users, the datagrid should simply scroll off to the right, with a nice horizontal scroll bar.&lt;br /&gt;&lt;br /&gt;I figured this would be easy.  Turns out it's a bit tricky.  If I set the maxWidth of my datagrid to something smaller than the sum of my column widths, the desired behaviour would occur.  I'd get a nice horizontal scroll bar and the columns would span out to the right.  The problem with maxWidth is that it does not accept percentage values.  So if I want the datagrid to use up 100% of the width of the parent container, I can't use maxWidth.&lt;br /&gt;&lt;br /&gt;I tried sticking the datagrid in a canvas, thinking i'd be able to use the scrolling of the canvas to quasi hover/move over the datagrid rendered in its entirety underneath, but the vertical scrolling didn't really work out well.  Perhaps someone else might have more luck with this approach.  I kinda wanted to get back to using the scrollbars in the datagrid, as it seemed that this HAD to be possible!&lt;br /&gt;&lt;br /&gt;I figured the solution had to lie in maxWidth.  I put the datagrid inside a canvas and made the canvas size percentage based.  I then, in a resize() function triggered by creationComplete of the app, assigned the value of the width of the canvas to the maxWidth property of my datagrid.  This seemed to work.  I also tried to have the resize event of the app call this function instead but I'd get null errors.   Turned out I needed to assign the event listener on creationComplete.&lt;br /&gt;&lt;br /&gt;Everything looked good, the datagrid was resizing with the canvas.  At certain times however the datagrid seemed to lag behind and not fill the canvas properly.  Using callLater fixed this.  Here's the &lt;a href="http://www.crazedcoders.com/demos/hzscrollgrid/"&gt;Demo&lt;/a&gt;.  Right click on the demo to get the source.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-4268537176775668418?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/4268537176775668418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=4268537176775668418' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4268537176775668418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4268537176775668418'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/12/autosizing-datagrid-with-horizontal.html' title='Autosizing Datagrid with Horizontal Scrolling'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-6896751675694017363</id><published>2006-12-05T14:57:00.000-07:00</published><updated>2006-12-05T15:28:35.748-07:00</updated><title type='text'>Many-to-Many using FDS &amp; Hibernate</title><content type='html'>&lt;a href="http://www.brightworks.com/flex_ability/?p=18"&gt;Douglas McCarroll&lt;/a&gt; recently sent me an email asking if I'd had any luck getting Hibernate, Hibernate Tools for Eclipse and FDS to work with many to many relationships.  I quickly threw together an example that I had built for a client a couple weeks ago, but in that particular case it wasn't a true many-to-many... I had a student, course and registration table but my registration table had it's own unique ID so really, it was just a combination of 2 one-to-many relationships.  For most situations this would probably work however, as he pointed out, some clients might already have a db in place and would be unwilling to make a change just to accommodate the poor starving flex programmer.&lt;br /&gt;&lt;br /&gt;Now back in the summer I did attempt to get a true many-to-many relationship to work using Hibernate Tools.  What I didn't realize at the time is that the tools didn't yet support this feature.  Then i saw this &lt;a href="http://www.hibernate.org/hib_docs/tools/eclipse/newandnoteworthy/hibernate-eclipse-news-3.2.0.beta7.html"&gt;link&lt;/a&gt; and decided to give it another go.&lt;br /&gt;&lt;br /&gt;I will be using mysql for this example.  It is based loosely off the crm db that ships with FDS.  Here's the scripts for the 3 tables in play:&lt;pre&gt;CREATE TABLE  `crm`.`employee` (&lt;br /&gt;  `id` int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;  `First_Name` varchar(45) NOT NULL default '',&lt;br /&gt;  `Last_Name` varchar(45) NOT NULL default '',&lt;br /&gt;  `Email` varchar(45) NOT NULL default '',&lt;br /&gt;  `Phone` varchar(45) NOT NULL default '',&lt;br /&gt;  `Title` varchar(45) NOT NULL default '',&lt;br /&gt;  PRIMARY KEY  (`id`)&lt;br /&gt;) ENGINE=InnoDB DEFAULT CHARSET=utf8;&lt;br /&gt;&lt;br /&gt;CREATE TABLE  `crm`.`event` (&lt;br /&gt;  `id` int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;  `name` varchar(200) NOT NULL default '',&lt;br /&gt;  `eventDate` datetime NOT NULL default '0000-00-00 00:00:00',&lt;br /&gt;  `eventTime` varchar(45) NOT NULL default '',&lt;br /&gt;  PRIMARY KEY  (`id`)&lt;br /&gt;) ENGINE=InnoDB DEFAULT CHARSET=utf8;&lt;br /&gt;&lt;br /&gt;CREATE TABLE  `crm`.`eventemployee` (&lt;br /&gt;  `eventID` int(10) unsigned NOT NULL default '0',&lt;br /&gt;  `employeeID` int(10) unsigned NOT NULL default '0',&lt;br /&gt;  PRIMARY KEY  (`eventID`,`employeeID`),&lt;br /&gt;  KEY `FK_eventemployee_1` (`employeeID`),&lt;br /&gt;  CONSTRAINT `FK_eventemployee_1` FOREIGN KEY (`employeeID`) REFERENCES `employee` (`id`),&lt;br /&gt;  CONSTRAINT `FK_eventemployee_2` FOREIGN KEY (`eventID`) REFERENCES `event` (`id`)&lt;br /&gt;) ENGINE=InnoDB DEFAULT CHARSET=utf8;&lt;/pre&gt;As you can see I have 3 tables, an Employee table, an Event table and an EventEmployee table.  The EventEmployee table only has 2 fields, each a foreign key to the corresponding table.&lt;br /&gt;&lt;br /&gt;The next step was to ensure I had the right version of the Hibernate Tools installed in Eclipse (3.2.0.beta7 or greater).  I'm not going to spend any time on explaining how to configure the Hibernate Tools.. needless to say I got the Tool configured to reverse-engineer my db and it created these .hbm.xml files:&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE hibernate-mapping PUBLIC &amp;quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&amp;quot;&lt;br /&gt;&amp;quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;!-- Generated Dec 5, 2006 1:55:21 PM by Hibernate Tools 3.2.0.beta8 --&amp;gt;&lt;br /&gt;&amp;lt;hibernate-mapping&amp;gt;&lt;br /&gt;    &amp;lt;class name=&amp;quot;samples.crm.Employee&amp;quot; table=&amp;quot;employee&amp;quot; catalog=&amp;quot;crm&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;        &amp;lt;id name=&amp;quot;id&amp;quot; type=&amp;quot;java.lang.Integer&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;id&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;generator class=&amp;quot;native&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/id&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;firstName&amp;quot; type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;First_Name&amp;quot; length=&amp;quot;45&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;            &amp;lt;/column&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;lastName&amp;quot; type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;Last_Name&amp;quot; length=&amp;quot;45&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;            &amp;lt;/column&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;email&amp;quot; type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;Email&amp;quot; length=&amp;quot;45&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;            &amp;lt;/column&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;phone&amp;quot; type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;Phone&amp;quot; length=&amp;quot;45&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;            &amp;lt;/column&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;title&amp;quot; type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;Title&amp;quot; length=&amp;quot;45&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;            &amp;lt;/column&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;set name=&amp;quot;events&amp;quot; inverse=&amp;quot;true&amp;quot; table=&amp;quot;eventemployee&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;key&amp;gt;&lt;br /&gt;                &amp;lt;column name=&amp;quot;employeeID&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;                &amp;lt;/column&amp;gt;&lt;br /&gt;            &amp;lt;/key&amp;gt;&lt;br /&gt;            &amp;lt;many-to-many entity-name=&amp;quot;samples.crm.Event&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;column name=&amp;quot;eventID&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;                &amp;lt;/column&amp;gt;&lt;br /&gt;            &amp;lt;/many-to-many&amp;gt;&lt;br /&gt;        &amp;lt;/set&amp;gt;&lt;br /&gt;    &amp;lt;/class&amp;gt;  &lt;br /&gt;&amp;lt;/hibernate-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE hibernate-mapping PUBLIC &amp;quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&amp;quot;&lt;br /&gt;&amp;quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;!-- Generated Dec 5, 2006 1:55:21 PM by Hibernate Tools 3.2.0.beta8 --&amp;gt;&lt;br /&gt;&amp;lt;hibernate-mapping&amp;gt;&lt;br /&gt;    &amp;lt;class name=&amp;quot;samples.crm.Event&amp;quot; table=&amp;quot;event&amp;quot; catalog=&amp;quot;crm&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;        &amp;lt;id name=&amp;quot;id&amp;quot; type=&amp;quot;java.lang.Integer&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;id&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;generator class=&amp;quot;native&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/id&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;name&amp;quot; type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;name&amp;quot; length=&amp;quot;200&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;            &amp;lt;/column&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;eventDate&amp;quot; type=&amp;quot;timestamp&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;eventDate&amp;quot; length=&amp;quot;19&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;            &amp;lt;/column&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;eventTime&amp;quot; type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;column name=&amp;quot;eventTime&amp;quot; length=&amp;quot;45&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;            &amp;lt;/column&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;set name=&amp;quot;employees&amp;quot; inverse=&amp;quot;true&amp;quot; table=&amp;quot;eventemployee&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;key&amp;gt;&lt;br /&gt;                &amp;lt;column name=&amp;quot;eventID&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;                &amp;lt;/column&amp;gt;&lt;br /&gt;            &amp;lt;/key&amp;gt;&lt;br /&gt;            &amp;lt;many-to-many entity-name=&amp;quot;samples.crm.Employee&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;column name=&amp;quot;employeeID&amp;quot; not-null=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;br /&gt;                &amp;lt;/column&amp;gt;&lt;br /&gt;            &amp;lt;/many-to-many&amp;gt;&lt;br /&gt;        &amp;lt;/set&amp;gt;&lt;br /&gt;    &amp;lt;/class&amp;gt;&lt;br /&gt;&amp;lt;/hibernate-mapping&amp;gt;&lt;/pre&gt;I also configured the Tools to create my domain code.  What I found encouraging is that it only created the Employee.java and the Event.java classes, no EventEmployee.java class.  Things were looking up!  Ok, now it was time to configure the corresponding destinations in my data-management-config.xml file.  I took a bit of an educated guess here, since the fds documentation surrounding the metadata tags is pretty weak... lucky for me I got it first try - I guess I spend way too much time here :)&lt;pre&gt;&amp;lt;destination id=&amp;quot;crm.employee.hibernate&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;adapter ref=&amp;quot;java-dao&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;properties&amp;gt;&lt;br /&gt;            &amp;lt;use-transactions&amp;gt;true&amp;lt;/use-transactions&amp;gt;&lt;br /&gt;            &amp;lt;source&amp;gt;flex.data.assemblers.HibernateAssembler&amp;lt;/source&amp;gt;&lt;br /&gt;            &amp;lt;scope&amp;gt;application&amp;lt;/scope&amp;gt;&lt;br /&gt;            &amp;lt;metadata&amp;gt;&lt;br /&gt;                &amp;lt;identity property=&amp;quot;id&amp;quot;/&amp;gt;&lt;br /&gt;                 &amp;lt;many-to-many property=&amp;quot;events&amp;quot; &lt;br /&gt;                 destination=&amp;quot;crm.event.hibernate&amp;quot; lazy=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;            &amp;lt;/metadata&amp;gt;&lt;br /&gt;            &amp;lt;network&amp;gt;&lt;br /&gt;                &amp;lt;session-timeout&amp;gt;20&amp;lt;/session-timeout&amp;gt;&lt;br /&gt;                &amp;lt;paging enabled=&amp;quot;false&amp;quot; pageSize=&amp;quot;10&amp;quot; /&amp;gt;&lt;br /&gt;                &amp;lt;throttle-inbound policy=&amp;quot;ERROR&amp;quot; max-frequency=&amp;quot;500&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;throttle-outbound policy=&amp;quot;REPLACE&amp;quot; max-frequency=&amp;quot;500&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/network&amp;gt;&lt;br /&gt;            &amp;lt;server&amp;gt;&lt;br /&gt;                &amp;lt;hibernate-entity&amp;gt;samples.crm.Employee&amp;lt;/hibernate-entity&amp;gt;&lt;br /&gt;                &amp;lt;fill-configuration&amp;gt;&lt;br /&gt;                    &amp;lt;use-query-cache&amp;gt;false&amp;lt;/use-query-cache&amp;gt;&lt;br /&gt;                    &amp;lt;allow-hql-queries&amp;gt;true&amp;lt;/allow-hql-queries&amp;gt;&lt;br /&gt;                &amp;lt;/fill-configuration&amp;gt;&lt;br /&gt;            &amp;lt;/server&amp;gt;&lt;br /&gt;        &amp;lt;/properties&amp;gt;&lt;br /&gt;    &amp;lt;/destination&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;destination id=&amp;quot;crm.event.hibernate&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;adapter ref=&amp;quot;java-dao&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;properties&amp;gt;&lt;br /&gt;            &amp;lt;use-transactions&amp;gt;true&amp;lt;/use-transactions&amp;gt;&lt;br /&gt;            &amp;lt;source&amp;gt;flex.data.assemblers.HibernateAssembler&amp;lt;/source&amp;gt;&lt;br /&gt;            &amp;lt;scope&amp;gt;application&amp;lt;/scope&amp;gt;&lt;br /&gt;            &amp;lt;metadata&amp;gt;&lt;br /&gt;                &amp;lt;identity property=&amp;quot;id&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;many-to-many property=&amp;quot;employees&amp;quot; &lt;br /&gt;                 destination=&amp;quot;crm.employee.hibernate&amp;quot; lazy=&amp;quot;false&amp;quot; /&amp;gt;  &lt;br /&gt;            &amp;lt;/metadata&amp;gt;&lt;br /&gt;            &amp;lt;network&amp;gt;&lt;br /&gt;                &amp;lt;session-timeout&amp;gt;20&amp;lt;/session-timeout&amp;gt;&lt;br /&gt;                &amp;lt;paging enabled=&amp;quot;false&amp;quot; pageSize=&amp;quot;10&amp;quot; /&amp;gt;&lt;br /&gt;                &amp;lt;throttle-inbound policy=&amp;quot;ERROR&amp;quot; max-frequency=&amp;quot;500&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;throttle-outbound policy=&amp;quot;REPLACE&amp;quot; max-frequency=&amp;quot;500&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/network&amp;gt;&lt;br /&gt;            &amp;lt;server&amp;gt;&lt;br /&gt;                &amp;lt;hibernate-entity&amp;gt;samples.crm.Event&amp;lt;/hibernate-entity&amp;gt;&lt;br /&gt;                &amp;lt;fill-configuration&amp;gt;&lt;br /&gt;                    &amp;lt;use-query-cache&amp;gt;false&amp;lt;/use-query-cache&amp;gt;&lt;br /&gt;                    &amp;lt;allow-hql-queries&amp;gt;true&amp;lt;/allow-hql-queries&amp;gt;&lt;br /&gt;                &amp;lt;/fill-configuration&amp;gt;&lt;br /&gt;            &amp;lt;/server&amp;gt;&lt;br /&gt;        &amp;lt;/properties&amp;gt;&lt;br /&gt;    &amp;lt;/destination&amp;gt;&lt;/pre&gt; Finally in my flex application I built my correponding .as classes:&lt;pre&gt;package samples.crm&lt;br /&gt;{&lt;br /&gt; import mx.collections.ArrayCollection; &lt;br /&gt; [Managed]&lt;br /&gt; [RemoteClass(alias="samples.crm.Event")]&lt;br /&gt; public class Event{&lt;br /&gt;  public function Event() {}  &lt;br /&gt;  public var id:int;&lt;br /&gt;  public var name:String;&lt;br /&gt;  public var eventDate:Date;&lt;br /&gt;  public var eventTime:String;  &lt;br /&gt;  public var employees:ArrayCollection;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;package samples.crm&lt;br /&gt;{&lt;br /&gt; import mx.collections.ArrayCollection; &lt;br /&gt; [Managed]&lt;br /&gt; [RemoteClass(alias="samples.crm.Employee")]&lt;br /&gt; public class Employee {&lt;br /&gt;  public function Employee() {}  &lt;br /&gt;  public var id:int;&lt;br /&gt;  public var firstName:String;&lt;br /&gt;  public var lastName:String;&lt;br /&gt;  public var title:String;&lt;br /&gt;  public var phone:String;&lt;br /&gt;  public var email:String;  &lt;br /&gt;  public var events:ArrayCollection;&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;Then I just created a quick application with 2 datagrids: one id="dg" with a dataProvider="{employees}" and the other id="childDg" with a dataProvider="{dg.selectedItem.events}" - by setting lazy to false on my many-to-many relationship in the destination, it's guaranteed that the child records will load automatically.  You could also turn this around... create a datagrid that points to {events} and have the other point to {dg.selectedItem.employees}.  By the time you get to this point you can do pretty much anything anyway.  The real trick was getting here!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-6896751675694017363?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/6896751675694017363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=6896751675694017363' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6896751675694017363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6896751675694017363'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/12/many-to-many-using-fds-hibernate.html' title='Many-to-Many using FDS &amp; Hibernate'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-5778717746600456843</id><published>2006-11-28T07:50:00.000-07:00</published><updated>2006-11-28T15:34:21.008-07:00</updated><title type='text'>How to keep db connections alive in FDS/Hibernate</title><content type='html'>Struggled with a good title on that one.  Anyway... here's the deal.  I noticed a while back that if i left my fds server running over night, and in the morning tried to open the sample CRM application, well, it would fail.  Fail so badly in fact I'd have to restart or redeploy to get it working again.  I'd get an error in the fds log that looked something like this &lt;br /&gt;&lt;i&gt;SEVERE: Communications link failure due to underlying exception:&lt;br /&gt;** BEGIN NESTED EXCEPTION **&lt;br /&gt;java.net.SocketException&lt;br /&gt;MESSAGE: Software caused connection abort: socket write error&lt;br /&gt;Communications link failure due to underlying exception:&lt;br /&gt;...&lt;/i&gt;&lt;br /&gt;So yesterday I decided to see if I could fix this.  It turned out to be a very very long day.  Here are the lessons I learned.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Lesson 1: By default, mySQL terminates db connections after 8 hours of inactivity&lt;/b&gt;&lt;br /&gt;Here are the default mySQL settings:&lt;pre&gt;#The number of seconds the server waits for activity on a connection before closing it&lt;br /&gt;wait_timeout=28800&lt;br /&gt;#The number of seconds the server waits for activity on an interactive connection before closing it.&lt;br /&gt;interactive_timeout=28800&lt;/pre&gt;For the remainder of my testing I changed these values to 300 in the my.ini file so that my connections would close after only 5 minutes of activity.  A much shorter timeframe for testing!  So the initial problem is that once mySql closes down the connection, Hibernate does not natively manage this connection and reopen it.  If you connect directly with a jdbc connection you may run into the same issue.  The trick is to use some kind of connection pool manager to keep the connections alive... the question remains, how can we achieve this?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Lesson 2: Using App Server JNDI datasources gives you connection pooling&lt;/b&gt;&lt;br /&gt;In jrun or jboss, it is possible to create jndi datasources.  These will then be managed by the application server.  I created a jndi datasource for the crm database that comes with FDS which I recreated a while back in mySQL.  Creating this datasource involved adding the following configuration to my jrun-resources.xml in the \fds2\JRun4\servers\default\SERVER-INF folder:&lt;pre&gt;&amp;lt;data-source&amp;gt;&lt;br /&gt;    &amp;lt;dbname&amp;gt;crm&amp;lt;/dbname&amp;gt;&lt;br /&gt;    &amp;lt;driver&amp;gt;com.mysql.jdbc.Driver&amp;lt;/driver&amp;gt;&lt;br /&gt;    &amp;lt;url&amp;gt;jdbc:mysql://127.0.0.1:3306/crm&amp;lt;/url&amp;gt;&lt;br /&gt;    &amp;lt;username&amp;gt;username&amp;lt;/username&amp;gt;&lt;br /&gt;    &amp;lt;password&amp;gt;password&amp;lt;/password&amp;gt;&lt;br /&gt;    &amp;lt;encrypted&amp;gt;false&amp;lt;/encrypted&amp;gt;&lt;br /&gt;    &amp;lt;encryption-class&amp;gt;jrun.security.JRunCrypterForTwofish&amp;lt;/encryption-class&amp;gt;&lt;br /&gt;    &amp;lt;native-results&amp;gt;true&amp;lt;/native-results&amp;gt;&lt;br /&gt;    &amp;lt;remove-on-exceptions&amp;gt;true&amp;lt;/remove-on-exceptions&amp;gt;&lt;br /&gt;    &amp;lt;pool-statements&amp;gt;true&amp;lt;/pool-statements&amp;gt;&lt;br /&gt;    &amp;lt;initial-connections&amp;gt;1&amp;lt;/initial-connections&amp;gt;&lt;br /&gt;    &amp;lt;connection-timeout&amp;gt;1200&amp;lt;/connection-timeout&amp;gt;&lt;br /&gt;    &amp;lt;pool-retry&amp;gt;30&amp;lt;/pool-retry&amp;gt;&lt;br /&gt;    &amp;lt;transaction-timeout&amp;gt;20&amp;lt;/transaction-timeout&amp;gt;&lt;br /&gt;    &amp;lt;cache-enabled&amp;gt;false&amp;lt;/cache-enabled&amp;gt;&lt;br /&gt;    &amp;lt;cache-size&amp;gt;5&amp;lt;/cache-size&amp;gt;&lt;br /&gt;    &amp;lt;cache-refresh-interval&amp;gt;30&amp;lt;/cache-refresh-interval&amp;gt;&lt;br /&gt;    &lt;b&gt;&amp;lt;jndi-name&amp;gt;crm&amp;lt;/jndi-name&amp;gt;&lt;/b&gt;&lt;br /&gt;    &amp;lt;poolname&amp;gt;Pool&amp;lt;/poolname&amp;gt;&lt;br /&gt;    &amp;lt;minimum-size&amp;gt;0&amp;lt;/minimum-size&amp;gt;&lt;br /&gt;    &amp;lt;maximum-size&amp;gt;2147483647&amp;lt;/maximum-size&amp;gt;&lt;br /&gt;    &amp;lt;user-timeout&amp;gt;20&amp;lt;/user-timeout&amp;gt;&lt;br /&gt;    &amp;lt;skimmer-frequency&amp;gt;420&amp;lt;/skimmer-frequency&amp;gt;&lt;br /&gt;    &amp;lt;shrink-by&amp;gt;5&amp;lt;/shrink-by&amp;gt;&lt;br /&gt;    &amp;lt;maximum-soft&amp;gt;true&amp;lt;/maximum-soft&amp;gt;&lt;br /&gt;    &amp;lt;debugging&amp;gt;false&amp;lt;/debugging&amp;gt;&lt;br /&gt;    &amp;lt;disable-pooling&amp;gt;false&amp;lt;/disable-pooling&amp;gt;&lt;br /&gt;    &amp;lt;description /&amp;gt;&lt;br /&gt;    &amp;lt;isolation-level&amp;gt;READ_COMMITTED&amp;lt;/isolation-level&amp;gt;&lt;br /&gt;&amp;lt;/data-source&amp;gt;&lt;/pre&gt;The key thing to note here is the jndi-name I've given this datasource.  In Jboss I added a file called mysql-ds.xml to my deploy folder which looks like this:&lt;pre&gt;&amp;lt;datasources&amp;gt; &lt;br /&gt;    &amp;lt;local-tx-datasource&amp;gt; &lt;br /&gt;        &amp;lt;jndi-name&amp;gt;crm&amp;lt;/jndi-name&amp;gt; &lt;br /&gt;        &amp;lt;connection-url&amp;gt;jdbc:mysql://localhost:3306/crm&amp;lt;/connection-url&amp;gt; &lt;br /&gt;        &amp;lt;driver-class&amp;gt;com.mysql.jdbc.Driver&amp;lt;/driver-class&amp;gt; &lt;br /&gt;        &amp;lt;user-name&amp;gt;user&amp;lt;/user-name&amp;gt; &lt;br /&gt;        &amp;lt;password&amp;gt;password&amp;lt;/password&amp;gt;&lt;br /&gt;        &amp;lt;min-pool-size&amp;gt;5&amp;lt;/min-pool-size&amp;gt;&lt;br /&gt;        &amp;lt;max-pool-size&amp;gt;20&amp;lt;/max-pool-size&amp;gt;&lt;br /&gt;        &amp;lt;idle-timeout-minutes&amp;gt;4&amp;lt;/idle-timeout-minutes&amp;gt;        &lt;br /&gt;    &amp;lt;/local-tx-datasource&amp;gt;&lt;br /&gt;&amp;lt;/datasources&amp;gt;&lt;/pre&gt;I've kept the jndi names the same in both jrun and jboss so that it's easy for me to deploy my apps from one to the other.  I ran some tests after I did this.  Hibernate - still using it's own connection - would still fail permanently after the connection timed out.   Yet the crm app that was configured to use jdbc/jndi directly (ConnectionHelper.java):&lt;pre&gt;javax.naming.Context context = new javax.naming.InitialContext();&lt;br /&gt;return ((DataSource) context.lookup("java:crm")).getConnection();&lt;/pre&gt; would fail once and then reconnect successfully.  It looked like I was on the right track, now it was time to reconfigure Hibernate.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Lesson 3: Hibernate is not recommended for connection pooling&lt;/b&gt;&lt;br /&gt;I had to configure Hibernate to take advantage of my jndi datasources.  Here's what the hibernate.cfg.xml looks like for both jrun and jboss:&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE hibernate-configuration PUBLIC&lt;br /&gt;&amp;quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&amp;quot;&lt;br /&gt;&amp;quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;hibernate-configuration&amp;gt;&lt;br /&gt;    &amp;lt;session-factory&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;connection.datasource&amp;quot;&amp;gt;java:crm&amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;hibernate.dialect&amp;quot;&amp;gt;org.hibernate.dialect.MySQLDialect&amp;lt;/property&amp;gt;&lt;br /&gt;[...]&lt;br /&gt;    &amp;lt;/session-factory&amp;gt;&lt;br /&gt;&amp;lt;/hibernate-configuration&amp;gt;&lt;/pre&gt;I saved my changes, restarted the server, ran my app, waited for the timeout, ran the app again, and even though it hiccupped on the first try, the connection was reestablished on the second try.  But why this initial hiccup?  Shouldn't there be some way to configure it so that even this initial error can be avoided?  I still had much work to do!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Lesson 4: Make sure to have the latest mysql jdbc drivers installed&lt;/b&gt;&lt;br /&gt;It turns out that Jboss jndi datasources can be configured to actively ping db connections and keep them alive.  Yet I kept getting errors after configuring my datasource to do this 'pinging', and it turned out I was running older jdbc drivers.  I upgraded to the latest ones and the errors went away.  Here's the jboss datasource file with the ping features enabled:&lt;pre&gt;&amp;lt;datasources&amp;gt; &lt;br /&gt;    &amp;lt;local-tx-datasource&amp;gt; &lt;br /&gt;        &amp;lt;jndi-name&amp;gt;crm&amp;lt;/jndi-name&amp;gt; &lt;br /&gt;        &amp;lt;connection-url&amp;gt;jdbc:mysql://localhost:3306/crm&amp;lt;/connection-url&amp;gt; &lt;br /&gt;        &amp;lt;driver-class&amp;gt;com.mysql.jdbc.Driver&amp;lt;/driver-class&amp;gt; &lt;br /&gt;        &amp;lt;user-name&amp;gt;user&amp;lt;/user-name&amp;gt; &lt;br /&gt;        &amp;lt;password&amp;gt;password&amp;lt;/password&amp;gt;&lt;br /&gt;        &amp;lt;min-pool-size&amp;gt;5&amp;lt;/min-pool-size&amp;gt;&lt;br /&gt;        &amp;lt;max-pool-size&amp;gt;20&amp;lt;/max-pool-size&amp;gt;&lt;br /&gt;        &amp;lt;idle-timeout-minutes&amp;gt;4&amp;lt;/idle-timeout-minutes&amp;gt; &lt;br /&gt;        &lt;b&gt;&amp;lt;exception-sorter-class-name&amp;gt;&lt;br /&gt;          com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter&lt;br /&gt;        &amp;lt;/exception-sorter-class-name&amp;gt;&lt;br /&gt;        &amp;lt;valid-connection-checker-class-name&amp;gt;&lt;br /&gt;          com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker&lt;br /&gt;        &amp;lt;/valid-connection-checker-class-name&amp;gt;&lt;/b&gt;    &lt;br /&gt;    &amp;lt;/local-tx-datasource&amp;gt;&lt;br /&gt;&amp;lt;/datasources&amp;gt;&lt;/pre&gt;Since my production environment is Jboss, and it had already been a long day, I decided to not worry about figuring out how to do the same in JRun.  If anyone out there knows this, please leave a comment!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Lesson 5: Hibernate must be told that it's connection is now being managed&lt;/b&gt;&lt;br /&gt;At this point i was able to retrieve data without error, despite connection time outs.  When I went to update a record, however, I got a cool new error:&lt;br /&gt;&lt;i&gt;java.sql.SQLException: You cannot commit during a managed transaction!&lt;/i&gt;&lt;br /&gt;So, I did some digging and changed my hibernate.cfg.xml to this:&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE hibernate-configuration PUBLIC&lt;br /&gt;&amp;quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&amp;quot;&lt;br /&gt;&amp;quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;hibernate-configuration&amp;gt;&lt;br /&gt;    &amp;lt;session-factory&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;connection.datasource&amp;quot;&amp;gt;java:crm&amp;lt;/property&amp;gt;&lt;br /&gt;        &amp;lt;property name=&amp;quot;hibernate.dialect&amp;quot;&amp;gt;org.hibernate.dialect.MySQLDialect&amp;lt;/property&amp;gt;&lt;br /&gt; &lt;b&gt;  &amp;lt;property name=&amp;quot;transaction.factory_class&amp;quot;&amp;gt;&lt;br /&gt;       org.hibernate.transaction.JTATransactionFactory&lt;br /&gt;   &amp;lt;/property&amp;gt;&lt;br /&gt;   &amp;lt;property name=&amp;quot;transaction.manager_lookup_class&amp;quot;&amp;gt;&lt;br /&gt;       org.hibernate.transaction.JBossTransactionManagerLookup&lt;br /&gt;   &amp;lt;/property&amp;gt;&lt;/b&gt;&lt;br /&gt;[...]&lt;br /&gt;    &amp;lt;/session-factory&amp;gt;&lt;br /&gt;&amp;lt;/hibernate-configuration&amp;gt;&lt;/pre&gt;As you can see this is specific to Jboss.  There are several other TransactionManagerLookups available that you can read about &lt;a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/transaction/JNDITransactionManagerLookup.html"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;br /&gt;I spent alot of time on this yesterday, so this blog might seem a bit scarce and a bit rushed.  Basically all the configuration files are here for you to use and customize.  If you have questions, please ask.  Again, this is blogged here for my benefit as well as yours.  I would not want to have to redo this from scratch 6 months from now!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-5778717746600456843?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/5778717746600456843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=5778717746600456843' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/5778717746600456843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/5778717746600456843'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/how-to-keep-db-connections-alive-in.html' title='How to keep db connections alive in FDS/Hibernate'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-2874601296808900349</id><published>2006-11-23T15:54:00.000-07:00</published><updated>2006-11-28T15:36:49.871-07:00</updated><title type='text'>Installing FDS with JBoss and IIS</title><content type='html'>Here's the initial steps.&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Download Jboss and run locally on my dev box.  Install Flex Data Services.  Unzip the FDS Admin, Flex and Samples files into folders of the same name with a .war extension, and drop these into the C:\Java\Jboss4\server\default\deploy folder - I find unzipping them first let's me work on the files more easily.&lt;/li&gt;  &lt;br /&gt;&lt;li&gt;Configure mySql support.  Drop a copy of the mysql-connector.jar in the C:\Java\Jboss4\server\default\lib folder.  Create a datasource xml file called mysql-ds.xml in the C:\Java\Jboss4\server\default\deploy folder, looks like this:&lt;pre&gt;&amp;lt;datasources&amp;gt; &lt;br /&gt;   &amp;lt;local-tx-datasource&amp;gt; &lt;br /&gt;      &amp;lt;jndi-name&amp;gt;crm&amp;lt;/jndi-name&amp;gt; &lt;br /&gt;      &amp;lt;connection-url&amp;gt;jdbc:mysql://localhost:3306/crm&amp;lt;/connection-url&amp;gt;&lt;br /&gt;      &amp;lt;driver-class&amp;gt;com.mysql.jdbc.Driver&amp;lt;/driver-class&amp;gt; &lt;br /&gt;      &amp;lt;user-name&amp;gt;user&amp;lt;/user-name&amp;gt;&lt;br /&gt;      &amp;lt;password&amp;gt;password&amp;lt;/password&amp;gt;&lt;br /&gt;   &amp;lt;/local-tx-datasource&amp;gt; &lt;br /&gt;&amp;lt;/datasources&amp;gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Test the sample apps locally. This included Hibernate apps and all the sample apps.  Also, a little flex app I wrote that uses remote calls and javamail to send email notifications.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Once I was confident that Jboss was running all the flex apps flawlessly, the next challenge was figuring out how to get jboss to run as a windows service.  I downloaded the zip from this &lt;a href="http://www.laliluna.de/jboss-windows-service.html"&gt;website&lt;/a&gt;, ensured that my JAVA_HOME and JBOSS_HOME system variables were set properly, namely without a trailing backslash, then ran "install default" from a command line.  It successfully created a JBoss service, which worked great.  I was now ready to move my stuff to my IIS Server.&lt;br /&gt;&lt;br /&gt;I basically zipped up the jboss and javaservice folders and ftp'ed them up to the server.  While it was uploading I installed the Java SDK, mySql, mySqltools and FDS on the server, in the same folders as on my local dev box. I setup my system variables JAVA_HOME and JBOSS_HOME, copied my data over to the mySQL data folder on the server.  When the upload was done I unzipped my jboss and javaservice folders into my java folder, again keeping it exactly like my local install configuration.  I ran jboss manually and tested all the sample apps.  Then I installed it as a service, ran it and tested again.&lt;br /&gt;&lt;br /&gt;The next test was hitting the sample applications from the web, outside my firewall.  I could get the apps to launch however I was not getting any kind of connection... probably because my ISP blocks most ports by default (/sigh), including the default rtmp ports defined in the services-config.xml.  So I went into the configuration files and added my-http to all the channels as the failover second channel.  I restarted jboss just to be safe ( I find that hotdeployment on jboss seems to randomly end in out of memory errors!) and the apps did start working.&lt;br /&gt;&lt;br /&gt;Now all the samples apps are setup by default to compile on the server - but my goal was to host the flex apps in IIS and not the app server. To test this, I had written another flex application that was set to compile locally in Flexbuilder.  The advantage of this approach was that technically the swf files generated should be hostable on any webserver.  On my local machine the app ran fine, but copying it up to the server gave me a channel connect error.  The culprit here was the services-config.xml.  By default the port used by any flex app is the same port the app is being served up on &lt;i&gt;uri="http://{server.name}:{server.port}/{/{context.root}/messagebroker/http"&lt;/i&gt;.  On my machine IIS is running on 80, and jboss is configured to listen on 8800.  I hardcoded the config by replacing {server.port} with 8800, recompiled my app and then uploaded it to my IIS folder.  And that did the trick!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-2874601296808900349?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/2874601296808900349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=2874601296808900349' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2874601296808900349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2874601296808900349'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/installing-fds-with-jboss-and-iis.html' title='Installing FDS with JBoss and IIS'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-2351231819285703045</id><published>2006-11-21T08:22:00.000-07:00</published><updated>2006-11-21T08:35:52.939-07:00</updated><title type='text'>Getting Effects to play when transitioning back</title><content type='html'>Simple little task.  Click a button [State:Login], have it fade out, change viewstate, have new panel fade in [State:Register].  Works like a charm.  Now, click button on panel, have panel fade out, change viewstate, have button fade back in.  Also do the same thing with the WipeUp and WipeDown effect.&lt;br /&gt;&lt;br /&gt;Problem.  Transitions to the Register state work fine, but transitions back to the original Login State don't.  The panel just disappears, no fade, and then the button [State:Login] fades back in nicely.  It appears that the controls in the Register State are removed by default before any effects can play visually on them.  Using a Sequence and setting the duration of the Panel fade to 10 seconds proves that the effect does play, since it delays the fade in of the button [State:Login], however the control is no longer visible because we're no longer in the Register State.&lt;br /&gt;&lt;br /&gt;I realize this is probably confusing... but those of you that have come across this same problem will recognize it.  I poured over the LiveDocs but it took just alot of troubleshooting different ideas before I got it working.  I've posted a working demo in my Flex Projects column to the right.  As usual, right click on the demo to get at the source.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-2351231819285703045?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/2351231819285703045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=2351231819285703045' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2351231819285703045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2351231819285703045'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/getting-effects-to-play-when.html' title='Getting Effects to play when transitioning back'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-8839160656462496834</id><published>2006-11-19T00:58:00.000-07:00</published><updated>2006-11-19T01:28:57.032-07:00</updated><title type='text'>The deal with embedded fonts, buttons and Rotate</title><content type='html'>Tonight I struggled with a problem I've faced before, only last time I didn't blog or write down my solution anywhere.  I'm on a quest to create a vertical Accordion.  Now the fastest way to do this would be to simply apply a rotate effect to it. Here's the code:&lt;pre&gt;private function setAccordion():void{&lt;br /&gt; var rot:Rotate = new Rotate();&lt;br /&gt; rot.angleTo = 270;&lt;br /&gt; rot.duration = 1;&lt;br /&gt; rot.originX = acc.width/2;  //need it to rotate around it's center&lt;br /&gt; rot.originY = acc.height/2;  //    -- " --&lt;br /&gt; rot.target = acc;  //acc is my Accordion control&lt;br /&gt; rot.play();&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;I figured this part out a while ago.  Without the originX and originY properties set, your control can disappear completely, especially if it's x and y are set to 0. I am currently calling this function from Initialize and have not encountered any issues.  What I was having a problem with is that my Accordion header text would disappear during the rotation.  Now I know that if I embed a font:&lt;pre&gt;&amp;lt;mx:Style&amp;gt;&lt;br /&gt;@font-face {&lt;br /&gt; src:url("lucidaGrande.swf"); &lt;br /&gt; fontFamily: "Lucida Grande";&lt;br /&gt;} &lt;br /&gt;Application{&lt;br /&gt;        fontFamily: "Lucida Grande"; &lt;br /&gt;}&lt;br /&gt;&amp;lt;/mx:Style&amp;gt;&lt;/pre&gt; then the text of my controls should remain intact thoughout the rotation.  But this didn't work.  I could clearly see that the font in my Accordion Header was not the embedded font, nor was it the default system font.  I dropped a button on my application and saw the same behaviour.  It wasn't till I added a label that I saw the embedded font appear.&lt;br /&gt;&lt;br /&gt;I tried quite a few things... but in the end it turned out that the above Styles only applied to controls that display text with a default fontWeight of Normal.  This would explain why the AccordionHeader, which I believe extends Button, and the Button controls didn't render the embedded font.  I modified my css:&lt;pre&gt;&amp;lt;mx:Style&amp;gt;&lt;br /&gt;@font-face {&lt;br /&gt; src:url("lucidaGrande.swf"); &lt;br /&gt; fontFamily: "Lucida Grande";&lt;br /&gt; fontWeight: bold;&lt;br /&gt;} &lt;br /&gt;@font-face {&lt;br /&gt; src:url("lucidaGrande.swf"); &lt;br /&gt; fontFamily: "Lucida Grande";&lt;br /&gt; fontWeight: normal;&lt;br /&gt;}  javascript:void(0)&lt;br /&gt;Publish&lt;br /&gt;Application{&lt;br /&gt;    fontFamily: "Lucida Grande";&lt;br /&gt;}&lt;br /&gt;&amp;lt;/mx:Style&amp;gt;&lt;/pre&gt; and everything worked just beautifully.  Of course, now I need to figure out how to rotate the canvas' within the Accordion back to their original position.  And figure out how to keep the Accordion in the same place, and why there's a vertical scroll bar now... ack. It never ends...&lt;br /&gt;&lt;br /&gt;On a side note, I also stumbled upon a property called &lt;a href="http://livedocs.macromedia.com/flex/2/langref/flash/display/DisplayObject.html#rotation"&gt;&lt;br /&gt;rotation&lt;/a&gt;.  This is a nice shortcut alternative to the rotate.play, however without the benefit of being able to set originX and originY.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-8839160656462496834?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/8839160656462496834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=8839160656462496834' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/8839160656462496834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/8839160656462496834'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/deal-with-embedded-fonts-buttons-and.html' title='The deal with embedded fonts, buttons and Rotate'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-6663849463339753760</id><published>2006-11-17T11:11:00.001-07:00</published><updated>2008-06-17T10:47:12.829-06:00</updated><title type='text'>Flex to .Net via Flex Data Services - Part Two</title><content type='html'>In part two of this series I will focus on creating java classes that consume .net webservices. Again, I just want to warn the java savvy folks out there that some of the things I cover are just common sense, and that this is geared more towards folks who have never touched java.&lt;br /&gt;&lt;br /&gt;To complete this exercise you will need to download and install the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;The Java JDK&lt;/a&gt;&lt;/li&gt; into C:\java\jdk1.5.0_09&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.apache.org/dyn/closer.cgi/ws/axis/1_4"&gt;Apache Axis 1.4&lt;/a&gt;&lt;/li&gt; into c:\java\axis-1_4&lt;br /&gt;&lt;li&gt;&lt;a href="http://apache.mirror.rafal.ca/ant/binaries/apache-ant-1.6.5-bin.zip"&gt;Apache Ant&lt;/a&gt;&lt;/li&gt; into c:\java\ant&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Create a working directory.  In this directory create a batch file called run.bat and paste the following text in and save (be sure to remove any linebreaks from the last 3 lines).&lt;br /&gt;&lt;code&gt;&lt;br /&gt;set AXIS_HOME=C:\Java\axis-1_4&lt;br /&gt;set ANT_HOME=C:\Java\ant&lt;br /&gt;set JAVA_HOME=C:\java\jdk1.5.0_09\&lt;br /&gt;path = %path%;c:\java\ant\bin;c\java\jkd1.5.0_09\bin;&lt;br /&gt;set CLASSPATH=.;%AXIS_HOME%\lib\axis.jar;%AXIS_HOME%\lib\commons-discovery-0.2.jar;%AXIS_HOME%\lib\commons-logging-1.0.4.jar;%AXIS_HOME%\lib\jaxrpc.jar;%AXIS_HOME%\lib\saaj.jar;%AXIS_HOME%\lib\wsdl4j-1.5.1.jar&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This batch file will need to be run each time you open a command prompt.  Alternatively, if you are going to be doing this alot, you can add these variables and paths to your Environment Variables.&lt;br /&gt;&lt;br /&gt;Next you will need to create another file called build.xml in the same folder, with the following text:&lt;code&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;!-- Build file for our first application --&amp;gt;&lt;br /&gt;&amp;lt;project name="Ant test project" default="build" basedir="."&amp;gt;&lt;br /&gt;&amp;lt;target name="build" &amp;gt;&lt;br /&gt; &amp;lt;javac srcdir="." destdir="." debug="true" includes="**/*.java"/&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I'm not going to spend a great deal of time explaining the structure of this file or on how Ant works... my brother, a java guru, was kind enough to help out with this.  Because I'm not using any Java IDE yet, I have to use Ant to compile my classes for me.  This is the simplest build file I could muster, and it basically tells Ant to compile all my java source code into .class files, and put them in the same folder.&lt;br /&gt;&lt;br /&gt;Finally we're ready to start playing with the webservice.  Open a command prompt window and navigate to your working folder.  You will need to have completed and successfully tested thet .net Webservice in Part One before you can continue here. Type in:&lt;br /&gt;&lt;b&gt;java org.apache.axis.wsdl.WSDL2Java http://localhost/WebService1/Service1.asmx?WSDL&lt;/b&gt;&lt;br /&gt;and hit enter.  You might see some warnings but no errors.  Please ensure the URL of the webservice coincides with your own configuration!&lt;br /&gt;&lt;br /&gt;If the command worked... you should now see a new folder structure in your working folder, called org/tempuri.  Using Explorer, take a look inside the folder and you will see a bunch of .java files.  These build the core classes for accessing your .net webservice.  The next step is to build a java console application that will use these classes to call a webservice method.  Create a text file in the org\tempuri\ folder called GetEmployees.java and paste in the following code:&lt;br /&gt;&lt;pre&gt;package org.tempuri;&lt;br /&gt;import java.util.*;&lt;br /&gt;public class GetEmployees{&lt;br /&gt;     public static void main(String [] args){&lt;br /&gt;           try{ &lt;br /&gt;        Employee[] employees;&lt;br /&gt; Service1Locator sloc = new Service1Locator();&lt;br /&gt;  Service1Soap sport = sloc.getService1Soap();&lt;br /&gt; employees = sport.getEmployees();&lt;br /&gt; System.out.println("Number of Records: " + employees.length);&lt;br /&gt; List list = Arrays.asList(employees);   &lt;br /&gt; for (int i=0; i&amp;lt;employees.length; i++ ){&lt;br /&gt;  System.out.println(employees[i].getLastName());&lt;br /&gt; }&lt;br /&gt;          }&lt;br /&gt;          catch(Exception e){&lt;br /&gt;               System.out.println(e.getMessage());}&lt;br /&gt;   }&lt;br /&gt;} &lt;/pre&gt; Save this file, then go back to your command prompt window and type in&lt;b&gt; Ant&lt;/b&gt;, hit Enter.  Hopefully you will see the words "BUILD SUCCESSFUL".  Finally let's test out our little java application.  Type in &lt;b&gt;java org.tempuri.GetEmployees&lt;/b&gt;.  You should see a list of lastnames.  If so, then you have successfully completed part 2.&lt;br /&gt;&lt;br /&gt;I would like to mention that even doing this a 3rd time myself I still encountered a multitude of errors.  If you do have problems, just post it here and I'll help as best I can.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-6663849463339753760?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/6663849463339753760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=6663849463339753760' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6663849463339753760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6663849463339753760'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/flex-to-net-via-flex-data-services-part_17.html' title='Flex to .Net via Flex Data Services - Part Two'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-4401884249586325275</id><published>2006-11-17T08:02:00.001-07:00</published><updated>2011-01-05T13:40:46.929-07:00</updated><title type='text'>Flex to .Net via Flex Data Services - Part One</title><content type='html'>This article, promised a long time &lt;a href="http://viconflex.blogspot.com/2006/09/flex-to-net-via-flex-data-services-it.html"&gt;ago&lt;/a&gt;, half done, has been lying in my documents folder for some time now, just collecting dust.   I decided to get back at it and get this badboy blogged.  Because of time constraints I'm just going to briefly skim over this first part.  Those of you that are familiar with .Net webservices should find most of the code self explanatory.&lt;br /&gt;&lt;br /&gt;A few things worthy of mention.  I had a heck of time getting the .net webservice to work properly with Java Axis - it took a lot of tweaking the method attributes before it worked.  My primary goal was to make sure my webservice was not passing back simply a collection of generic Objects, but rather a collection of say Employee Objects.  Employee objects would also then be recognized as such by the Java client, which makes coding on the Java side somewhat easier.&lt;br /&gt;&lt;br /&gt;You can find the code &lt;a href="http://www.crazedcoders.com/demos/WebService1.zip"&gt;HERE&lt;/a&gt;. It's a zip file containing the webservice I will be using thoughout this series of articles.  I've kept most of the default namespaces and left the code fairly simple.  For this project I am using the Employees table in the Northwind databaes and am connecting using a trusted connection.&lt;br /&gt;&lt;br /&gt;Please download the code and get the webservice up and running.  In the next part I'll show you how to consume the webservice using a Java client.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-4401884249586325275?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/4401884249586325275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=4401884249586325275' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4401884249586325275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/4401884249586325275'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/flex-to-net-via-flex-data-services-part.html' title='Flex to .Net via Flex Data Services - Part One'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-2504652678989177386</id><published>2006-11-13T16:17:00.001-07:00</published><updated>2011-01-05T13:43:14.341-07:00</updated><title type='text'>DataGrid Search with Highlighted Matches</title><content type='html'>Today's challenge: Give the user the ability to search a Datagrid and then simply highlight the matching rows in the Datagrid. The first problem was figuring out how to programmatically highlight specific rows in a datagrid, and after some googling I stumbled upon Mike Nimer's blog entry &lt;a href="http://www.mikenimer.com/index.cfm/2006/10/3/BackgroundRowColor-DataGrid-component"&gt;CustomRowColorDataGrid Component&lt;/a&gt;. He has basically extended the DataGrid to allow for a way to manipulate row appearance based on data, and he's taken it one step further than other examples by externalizing the function from the custom class. Very cool.&lt;br /&gt;&lt;br /&gt;The second part is homegrown. I basically have a Hits Array and I use a cursor to search the DataProvider for matches. Any matched record is added to my Hits array. Then when the CustomRowColorDataGrid calls my rowColorFunction, it checks to see whether the item of the current row is contained within my Hits Array, and passes back the highlighted color.&lt;br /&gt;&lt;br /&gt;Here's a &lt;a href="http://www.crazedcoders.com/demos/gridsearch/"&gt;link to the sample code&lt;/a&gt;. Right click the app to get the source!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-2504652678989177386?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/2504652678989177386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=2504652678989177386' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2504652678989177386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2504652678989177386'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/datagrid-search-with-highlighted.html' title='DataGrid Search with Highlighted Matches'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-2072579029792910472</id><published>2006-11-09T16:11:00.001-07:00</published><updated>2011-01-05T13:44:03.025-07:00</updated><title type='text'>Sizing Blues - Using Canvas to keep it under Control</title><content type='html'>I find a spend a great deal of time trying to get all the components of my application to play nice with one another. But every now and then, I'll get that nasty vertical or horizontal scroll bar on my application, when I'm quite sure that I've been using percentages for widths and heights throughout.&lt;br /&gt;&lt;br /&gt;So then the search begins, from the top layer, the application, I start to give different background colors to different containers, and each time I color a container I assign it a fixed size. Step by step, layer by layer, I will eventually find the component that isn't playing along. Most of the time it's either some form controls where the sum of their sizes is causing the percentage amounts to be ignored, or it's an image that's too big.&lt;br /&gt;&lt;br /&gt;One of the more common pitfalls is adding a form container to an HBox or VBox. In this case, if the controls are too wide or too tall, the form will simply push out the rest of the containers in the app. Of course I could constrain the size of the form or the container of the form, however then I risk losing the cool auto-grow features of flex. Yet if the screen size is too small, I'd like the scrollbars to be restricted to the container closest to the source of the error.&lt;br /&gt;&lt;br /&gt;What seems to work best, I find, is wrapping controls that risk causing this distortion inside a Canvas control. So, in other words, instead of:&lt;br /&gt;&amp;lt;mx:HBox width=&amp;quot;100%&amp;quot;&amp;gt;&amp;lt;mx:Form width=&amp;quot;100%'&amp;gt;...&lt;br /&gt;I would suggest using:&lt;br /&gt;&amp;lt;mx:HBox width=&amp;quot;100%&amp;quot;&amp;gt;&amp;lt;mx:Canvas width=&amp;quot;100%&amp;quot;&amp;gt;&amp;lt;mx:Form width=&amp;quot;100%&amp;quot;&amp;gt;...&lt;br /&gt;The Canvas will popup scroll bars and contain the distortion, but will also autogrow with the app.&lt;br /&gt;&lt;br /&gt;You can find an example of a little app I wrote that demonstrates this concept &lt;a href="http://www.crazedcoders.com/demos/sizer/" target="_new"&gt;here&lt;/a&gt;.  Right click on the app to get the source code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-2072579029792910472?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/2072579029792910472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=2072579029792910472' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2072579029792910472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2072579029792910472'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/sizing-blues-using-canvas-to-keep-it.html' title='Sizing Blues - Using Canvas to keep it under Control'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-1634654962691905369</id><published>2006-11-08T15:22:00.000-07:00</published><updated>2006-11-08T15:42:22.734-07:00</updated><title type='text'>Channel.Connect.Failed in locally compiled FB App</title><content type='html'>Just a quick post today.  Recently I've had to switch over to building FDS Flex Projects in Flexbuilder that are set to "compile application locally in Flexbuilder". This is just in case the next update to Flex only covers Flex and not FDS - upgrading my fds projects will be so much easier.&lt;br /&gt;&lt;br /&gt;Now for the most part things work fine but the other day a fellow coder asked for my help getting a remote object call (&amp;lt;mx:RemoteObject&amp;gt;) working. The call worked fine if he opened the .mxml file but would fail if he opened either the .html wrapper or the .swf directly. Since the only real difference between those two scenarios is where the compilation occurs, I figured it had to be a compile line argument missing from the Flexbuilder project configuration.&lt;br /&gt;&lt;br /&gt;In case anyone else runs into this, just make sure your compiler arguments include the &lt;em&gt;-context-root /contextroot&lt;/em&gt; parameter... for example this would be&lt;strong&gt; &lt;em&gt;-context-root /flex&lt;/em&gt;&lt;/strong&gt; in &lt;em&gt;http://localhost:8700&lt;strong&gt;/flex&lt;/strong&gt;/myApp/main.html&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;More information about this can be found in the docs &lt;a href="http://livedocs.macromedia.com/flex/2/docs/00001474.html" target="_new"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-1634654962691905369?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/1634654962691905369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=1634654962691905369' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1634654962691905369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/1634654962691905369'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/channelconnectfailed-in-locally.html' title='Channel.Connect.Failed in locally compiled FB App'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-8568210331932442893</id><published>2006-11-07T07:23:00.001-07:00</published><updated>2011-01-05T13:44:51.456-07:00</updated><title type='text'>ListCollectionView: Different perspectives on data</title><content type='html'>In a recent project one of the challenges was to display data to the user in a variety of different ways with little overhead. In the .net world we used DataViews to create multiple perspectives on the same DataSet. This included sorting and filtering the data without needing multiple copies of the data in memory. When I first started snooping around in Flex I figured there had to be a way to get the same functionality, and soon I found the ListCollectionView.&lt;br /&gt;&lt;br /&gt;As a side note, I'll soon start putting running samples up here with source code, just been too lazy to ftp them up to my server. Anyway let's dig in to the code. First we have a handy dandy xml data file:&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;items&amp;gt;&lt;br /&gt; &amp;lt;item name="Item 1" quantity="2" price="20.00" size="small"&lt;br /&gt;  rebate="yes" discontinued="yes" /&amp;gt;&lt;br /&gt; &amp;lt;item name="Item 2" quantity="4" price="10.00" size="medium"&lt;br /&gt;  rebate="no" discontinued="yes" /&amp;gt;&lt;br /&gt; &amp;lt;item name="Item 3" quantity="4" price="25.00" size="small"&lt;br /&gt;  rebate="no" discontinued="no"/&amp;gt;&lt;br /&gt; &amp;lt;item name="Item 4" quantity="1" price="5.00" size="extra-large"&lt;br /&gt;  rebate="no" discontinued="yes" /&amp;gt;&lt;br /&gt; &amp;lt;item name="Item 5" quantity="3" price="30.00" size="small"&lt;br /&gt;  rebate="yes" discontinued="yes" /&amp;gt;&lt;br /&gt; &amp;lt;item name="Item 6" quantity="4" price="17.00" size="medium"&lt;br /&gt;  rebate="no" discontinued="yes" /&amp;gt;&lt;br /&gt; &amp;lt;item name="Item 7" quantity="1" price="12.00" size="extra-large"&lt;br /&gt;  rebate="yes" discontinued="no"/&amp;gt;&lt;br /&gt; &amp;lt;item name="Item 8" quantity="4" price="22.00" size="extra-large"&lt;br /&gt;  rebate="yes" discontinued="yes" /&amp;gt;&lt;br /&gt;&amp;lt;/items&amp;gt;&lt;br /&gt;&lt;/pre&gt;Then we have to load the xml into an arraycollection, however several of the boolean properties will need to be reworked during the data load. Here's what that looks like:&lt;pre&gt;&amp;lt;mx:HTTPService id="itemConn" url="items.xml"&lt;br /&gt; useProxy="false" result="resultItemHandler(event)"/&amp;gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;private function resultItemHandler(event:ResultEvent):void {&lt;br /&gt; var source:ArrayCollection =&lt;br /&gt;         itemConn.lastResult.items.item as ArrayCollection;&lt;br /&gt; var cursor:IViewCursor = source.createCursor();&lt;br /&gt; var result:ArrayCollection = new ArrayCollection();&lt;br /&gt; while (!cursor.afterLast){&lt;br /&gt;  var currentObj:Object = cursor.current;&lt;br /&gt;  var cv:String = currentObj["rebate"];&lt;br /&gt;  cv = cv.toUpperCase();&lt;br /&gt;  var newValue:Boolean = false;&lt;br /&gt;  if (cv == "YES" ){&lt;br /&gt;    newValue = true;}&lt;br /&gt;  currentObj["rebate"] = newValue;&lt;br /&gt;  cv = currentObj["discontinued"];&lt;br /&gt;  cv = cv.toUpperCase();&lt;br /&gt;  newValue = false;&lt;br /&gt;  if (cv == "YES" ){&lt;br /&gt;   newValue = true;}&lt;br /&gt;  currentObj["discontinued"] = newValue;&lt;br /&gt;  result.addItem(currentObj);&lt;br /&gt;  cursor.moveNext();&lt;br /&gt;}&lt;br /&gt;itemsIS = result;&lt;br /&gt;}&lt;/pre&gt;So now we have an ArrayCollection of itemsIS, let's add a DataGrid and set the dataprovider to this collection:&lt;pre&gt;&amp;lt;mx:DataGrid id="itemDG" dataProvider="{itemsIS}"&lt;br /&gt; editable="false" width="100%" height="100%"/&amp;gt;&lt;br /&gt;&lt;/pre&gt;The next step requires a filtered view that will only show discontinued items, so we're going to add a LinkButton&lt;pre&gt;&amp;lt;mx:LinkButton label="Discontinued" click="handleDisc()"/&amp;gt;&lt;br /&gt;&lt;/pre&gt;and then add the following code to our script section:&lt;pre&gt;[Bindable]&lt;br /&gt;private var itemsDiscontinued:ListCollectionView;&lt;br /&gt;public function handleDisc():void{&lt;br /&gt;itemsDiscontinued = new ListCollectionView(itemsIS);&lt;br /&gt;itemsDiscontinued.filterFunction =&lt;br /&gt;     function ( item:Object):Boolean {return item.discontinued};&lt;br /&gt;itemsDiscontinued.refresh();&lt;br /&gt;itemDG.dataProvider = itemsDiscontinued;}&lt;/pre&gt;In this function we are creating a ListCollectionView that wraps our itemsIS collection. Then we create and set the filter function inline, and call a refresh(). Then we set the dataProvider of the datagrid to our ListCollectionView. You could add any number of "views" on the data in this way, and then let the user switch quickly between them.&lt;br /&gt;&lt;a href="http://www.crazedcoders.com/demos/listcollectionview/" target="_new"&gt;Here's the code in action &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-8568210331932442893?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/8568210331932442893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=8568210331932442893' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/8568210331932442893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/8568210331932442893'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/listcollectionview-different.html' title='ListCollectionView: Different perspectives on data'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-9134372426735444497</id><published>2006-11-02T00:04:00.000-07:00</published><updated>2006-11-02T00:30:51.121-07:00</updated><title type='text'>Flash 8, Flex 2, LocalConnection</title><content type='html'>Well today wasn't fun. I'm not huge into graphics or Flash for that matter. Sure I've done the occasional Flash movie but generally I stay away from things that are not code heavy. The challenge today was to create a clickable imagemap. Now from what I've been able to gather there's really no simple way to insert an Image in Flex and then draw different clickable regions on it. A good example of this would be a clickable interactive map, something we see very often. This little tutorial is directed at those of you that are as flash clueless as I am.&lt;br /&gt;&lt;br /&gt;Ok let's get to it. The quickest way to do this is to create a clickable button in Flash 8 and then add some code to it:&lt;br /&gt;&lt;br /&gt;1. Create a new Flash Document.&lt;br /&gt;2. Choose File &gt; Import to Library. This will import an image that will become a button. Locate the image and click Open. The image will be saved in the Library.&lt;br /&gt;3. Find the image in the right Column list. Select the image with the Arrow tool. Drag it to your stage.&lt;br /&gt;4. Right click on image, Choose Convert to Symbol from the popup menu. Name the symbol "button", choose Button from the Behavior list and click OK.&lt;br /&gt;5. Right click on the image. Choose Actions from the pop-up menu.&lt;br /&gt;6. This opens up the action pane. Now this next step is important, MAKE SURE you have Script Assist ON!&lt;br /&gt;7. Paste in this code:&lt;br /&gt;&lt;pre&gt;   outgoing_lc  = new LocalConnection();&lt;br /&gt;   outgoing_lc.send("lc_name", "helloFlex")&lt;br /&gt;   delete outgoing_lc;&lt;/pre&gt;8. If Script Assist is on you should see it wrap the code into a nice &lt;em&gt;on (release) {}&lt;/em&gt;function.&lt;br /&gt;9. File Export - Export Movie .. at bottom of properties dialog box make sure you change it to Access Network Only (this is default for Flex apps and both swf's must be the same or you get a nasty error). Call it test.swf.&lt;br /&gt;&lt;br /&gt;That pretty much sums up the Flash part of this little exercise. Once you have your test.swf file, drag that into your Flex project. Then embed it in your mxml application as so:&lt;pre&gt;&amp;lt;mx:SWFLoader source="test.swf" x="10" y="10"/&amp;gt;&lt;/pre&gt;Then in the script section add the following code:&lt;pre&gt;private var fromSWF:LocalConnection;   &lt;br /&gt;private function initApp() : void{&lt;br /&gt; fromSWF = new LocalConnection();&lt;br /&gt; fromSWF.client = this;&lt;br /&gt; fromSWF.connect("lc_name");}   &lt;br /&gt;public function helloFlex() : void{&lt;br /&gt; mx.controls.Alert.show("hello from flash");}&lt;/pre&gt;Save and Run. It should work. There's a few far more complex examples of this out there on the web like &lt;a href="http://weblogs.macromedia.com/pent/archives/flex_2/index.cfm"&gt;http://weblogs.macromedia.com/pent/archives/flex_2/index.cfm&lt;/a&gt; - scan down the page for "Using ActionScript 2 SWFs with Flex 2", which ultimately helped me figure this out.  Again I like to break it down to its simplest form, and build everything else up from there.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.macromedia.com/pent/archives/flex_2/index.cfm"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-9134372426735444497?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/9134372426735444497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=9134372426735444497' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/9134372426735444497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/9134372426735444497'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/11/flash-8-flex-2-localconnection.html' title='Flash 8, Flex 2, LocalConnection'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-2898536822275485157</id><published>2006-10-26T18:35:00.000-06:00</published><updated>2006-10-26T19:04:02.162-06:00</updated><title type='text'>My Max Experience in a Nutshell</title><content type='html'>Overall it was a worthwhile trip.  I had a chance to put faces to a lot of the names I've come across in my Flex related web travels, forums and blogs.  I was lucky enough to talk Cairngorm with Stephen Brewster, Flex Data Services with Jeff Vroom, ArrayCollections with Matt Chotin, Flex Builder with Mike Morearty, Flex Compiler with Roger Gonsalez.  And many more.  I was invited by the Adobe flex team to share my experiences and opinions with Flex 2.0 &lt;br /&gt;&lt;br /&gt;I got wowed by Alex Uhlman's cinematic effects seminar... truly cool stuff.  I got a glimpse into the up and coming ModuleManager, now in 2.01 beta, while attending Roger Gonzales' seminar.  I met several bigtime Flexcoder forum posters, and chatted on several occasions with Dimitri, getting his take on some of my application architectures.  I got to meet the entire Flex team while scarfing down free cookies and I got to talk Framework with the Adobe Consulting guys out of Scotland (Iteration Two folks).&lt;br /&gt;&lt;br /&gt;The venue itself was OK.  The Venetian is just too big.  There were folks staying at the Imperial Palace that could make it from their room to the conference faster than I could from my room at the Venetian.  Plus they use this sickly sweet smelling air freshener that starts to permeate through all your clothing and doesn't get any better.  The food at the conference was OK as well, however the stupid xylophone they started banging away on at 7:35am to let people know breakfast was ending at 8:00 is something I could have done without.  Plus closing it down at 8am was particularly cruel, considering the open bar function at the Palms on Wednesday night.  I think that the Palms venue was enjoyed by many but I'm getting old, so the music inside was too loud to talk and the temperature outside dropped quickly.&lt;br /&gt;&lt;br /&gt;The content of the sessions and the people that we came to hear speak are what made this conference worthwhile.  The vastness of the conference center, the long escalators, the bizarre schedules, the extremely brief exposure to food and drinks during the day, the questionnable venues were all a huge overkill.  My advice for next year?  Drop the blue man group 15 minute show and take that money to subsidize the ticket price of bringing my wife to the Palms.&lt;br /&gt;&lt;br /&gt;My 2 cents.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-2898536822275485157?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/2898536822275485157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=2898536822275485157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2898536822275485157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/2898536822275485157'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/10/my-max-experience-in-nutshell.html' title='My Max Experience in a Nutshell'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-6812896423708805603</id><published>2006-10-19T23:45:00.000-06:00</published><updated>2006-10-19T23:55:08.755-06:00</updated><title type='text'>Using FDS with Java 5</title><content type='html'>I found this little tidbit of information tucked away in my documents folder and I figured I might as well share it.&lt;br /&gt;&lt;br /&gt;While attending the flex data services course, we were told that both Flex Builder and FDS2 are 100% compatible with Java 5, even though they both ship with the 1.4.xx JRE.  Now I'm still looking to wildly expand my Java knowledge, and every book out there is Java 1.5, not to mention certain tools like the Hibernate code generators for Eclipse, optimize their code for Java 5... so I went home that night and decided I was going to make it happen.&lt;br /&gt;&lt;br /&gt;First off, I like my Java folder to be close at hand, so I installed the Java 5 jdk first, disabling the automatic installation of the JRE, because the install seemingly won't let me change the install folder of the JRE.  Then I installed the JRE seperately.  In the end they were located in C:\Java\JDK.. and C:\Java\JRE... respectively.  &lt;br /&gt;&lt;br /&gt;Then moving on to Flex Data Services (integrated with JRUN edition).  In FDS2 I opened the jvm.config file in C:\fds2\jrun4\bin and changed the line java.home=C:/fds2/UninstallerData/jre to java.home=C:/Java/jdk1.5.0_07. I also moved the JRE in uninstallerdata to my desktop to make sure it wasn't being used.  I then started FDS2 and it started up fine. (NOTE: originally I pointed it to the JRE, but loading my test .JSP page would fail because it couldn't find com/sun/tools/javac/Main).  &lt;br /&gt;&lt;br /&gt;Incidentally I also added the JAVA_HOME environment variable to my XP machine and pointed it to the JDK.  This takes care of Flex Builder and the Flex SDK as well. (I tested this further in fds and it appears that the jvm.config setting overrides the java_home variable - so if you want to use the java_home for fds2, blank out the value in the jvm.config). &lt;br /&gt;&lt;br /&gt;Finally, when you start up the Adobe Flex 2 Command Prompt, it tells you what version of Java it's using.  I haven't had any issues at all since upgrading to Java 5.  Looks like the instructor was right after all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-6812896423708805603?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/6812896423708805603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=6812896423708805603' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6812896423708805603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/6812896423708805603'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/10/using-fds-with-java-5.html' title='Using FDS with Java 5'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-353378816058111964</id><published>2006-10-19T23:13:00.000-06:00</published><updated>2006-10-19T23:38:20.782-06:00</updated><title type='text'>Asynchronicity Blues - managing multiple dataservice calls</title><content type='html'>A while ago I once again came up face to face with the mean and hungry asynchronicity beast that lives within Flex. All I was trying to do was create and save a Contact record programmaticly. The problem was, however, that a Contact has references to ContactType, Country and Division. Simplified, I was trying do the following:&lt;pre&gt;countryService.fill(countries);&lt;br /&gt;contactTypeService.fill(contactTypes);&lt;br /&gt;divisionService.fill(divisions);&lt;br /&gt;contact.country = countries.getItemAt(0); //default&lt;br /&gt;contact.contactType = contactTypes.getItemAt(0); //default&lt;br /&gt;contact.division = divisions.getItemAt(0); //default&lt;br /&gt;contactService.createItem(contact);&lt;/pre&gt;&lt;br /&gt;Of course, most of the time this would fail because the collections would not yet be filled, being asynchronous in nature. So I had to find a workaround. I created a dataTasks collection and then added a dataTask prior to each fill to the collection. On the result event of each fill I would find my dataTask and remove it from the collection. I added an EventListener to the CHANGE event of my dataTasks collection and when the collection length was back to 0, I would remove the EventListener and create my Contact. This worked fine, however it required alot more coding. Here's what it looked like:&lt;pre&gt;//prior to fill&lt;br /&gt;if(contactTypes.length == 0){&lt;br /&gt;dataTask = new DataTask("ContactTypes",false);&lt;br /&gt;model.dataTasks.addItem(dataTask);}&lt;br /&gt;contactTypeService.fill(contactTypes, "flex:hql", "from ContactType");&lt;br /&gt;//onResult Event&lt;br /&gt;if(dataTask){ &lt;br /&gt;model.dataTasks.removeItemAt(model.dataTasks.getItemIndex(dataTask));&lt;br /&gt;dataTask = null;}&lt;br /&gt;//add Eventlistener to dataTasks &lt;br /&gt;model.dataTasks.addEventListener(CollectionEvent.COLLECTION_CHANGE,completeContact);&lt;br /&gt;...&lt;br /&gt;private function completeContact(evt:CollectionEvent = null):void{&lt;br /&gt;if(model.dataTasks.length == 0) {&lt;br /&gt;model.dataTasks.removeEventListener&lt;br /&gt;(CollectionEvent.COLLECTION_CHANGE,completeContact);&lt;br /&gt;var contact:Contact = new Contact();&lt;br /&gt;...&lt;/pre&gt;Again, I posted on Flexcoders as to whether or not this was the BEST way to do this, and again Mr. Vroom responded. He wrote that even though the calls on the client are made ASYNCHRONOUSLY, the server handles the requests in SYNCHRONOUS order. In other words I only have to listen for the result event of the &lt;strong&gt;LAST&lt;/strong&gt; fill called. When that result is returned to the client, barring any faults from the previous fills, we can assume that all collections have been filled. Yay! Less Code!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-353378816058111964?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/353378816058111964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=353378816058111964' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/353378816058111964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/353378816058111964'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/10/asynchronicity-blues-managing-multiple.html' title='Asynchronicity Blues - managing multiple dataservice calls'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-3743797971188278009</id><published>2006-10-18T13:18:00.000-06:00</published><updated>2006-10-18T14:24:11.269-06:00</updated><title type='text'>Passing Objects on a dataservice fill()</title><content type='html'>A couple of weeks ago I ran into an interesting issue regarding the passing of a value object as one of the elements in my FillParameters array. Something like this:&lt;br /&gt;&lt;pre&gt;dataservice.fill(employees, CompanyVO)&lt;/pre&gt;The fill worked fine everytime, however, if I went and added a new employee using:&lt;pre&gt;dataservice.createItem(employee);dataservice.commit();&lt;/pre&gt;the collection on my client would not update to show the new employee.  Sure I could add the employee by doing an employees.add(employee), and yes, my collection would be updated.  However, another employees collection on another client viewing the same records would not.&lt;br /&gt;&lt;br /&gt;I turned up the logging level to debug and watched how Flex Data Services was handling the request.  It seemed, after a bit of extensive testing, that it did not recognize the CompanyVO object as being the same one across multiple calls.  The debugger would even state that no client collections existed with this fill configuration, and therefore none would receive a refresh.&lt;br /&gt;&lt;br /&gt;I thought perhaps my CompanyVO.as was perhaps not mapping thru to my CompanyVO.class, so I put my own toString() method in with a quick little output line.  Sure enough, FDS was recognizing the object passed as a CompanyVO.class object.&lt;br /&gt;&lt;br /&gt;Eventually I gave up.  I had played with my java class, trying to override various methods, implementing icomparable, etc.  Nothing. &lt;br /&gt;&lt;br /&gt;Then Jeff Vroom posted a suggestion on flexcoders.  To override the (built-in) in uid property on the Object.  First I added some code to have uid equal the companyid, saved my flex project and ran it again:&lt;br /&gt;&lt;pre&gt;Company.as&lt;br /&gt;public var uid:String = "";&lt;br /&gt;...&lt;br /&gt;company.uid = company.companyid;&lt;/pre&gt;&lt;br /&gt;No luck.  Then I added the uid property to my java class as well:&lt;br /&gt;&lt;pre&gt;private String uid;&lt;br /&gt;public void setUid(String uid)&lt;br /&gt;{ this.uid = uid;}&lt;br /&gt;public String getUid()&lt;br /&gt;{ return this.uid;}&lt;/pre&gt;&lt;br /&gt;Restarted FDS and ran my flex project again.  Problem solved.  Here's the steps to reproduce this problem using the crm sample that comes with FDS(as posted by me in the Adobe FDS Forum):&lt;br /&gt;&lt;br /&gt;1) in companyapp.mxml, change the fill line in the companyChange function to read:&lt;br /&gt;dsEmployee.fill(employees, company) //change from companyId int to company VO&lt;br /&gt;&lt;br /&gt;2) in the crm sample application, addEmployee function, replace this line:&lt;br /&gt;employees.addItem(employee);&lt;br /&gt;with this:&lt;br /&gt;dsEmployee.createItem(employee);&lt;br /&gt;(you don't have to do this if you keep 2 instances of the app running)&lt;br /&gt;&lt;br /&gt;3) in the crm.samples.EmployeeAssembler fill method, change the fill by commenting out everything after the line that says return dao.GetEmployees(); and replace them with these lines:&lt;br /&gt;Company cp = (Company) fillParameters.get(0);&lt;br /&gt;return dao.findEmployeesByCompany(cp.getCompanyId());&lt;br /&gt;&lt;br /&gt;4) in the crm.samples.EmployeeAssembler createItem method, replace the second dtx.refreshFill with the following line:&lt;br /&gt;dtx.refreshFill("crm.employee", Arrays.asList( new Object[] {newEmployee.getCompany()}));&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-3743797971188278009?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/3743797971188278009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=3743797971188278009' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/3743797971188278009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/3743797971188278009'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/10/passing-objects-on-dataservice-fill.html' title='Passing Objects on a dataservice fill()'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-3166188367802794037</id><published>2006-10-04T00:06:00.000-06:00</published><updated>2006-10-04T00:07:17.008-06:00</updated><title type='text'>Blog Facelift</title><content type='html'>As much as like a black background with neon writing, I was getting headaches reading my own material.  So I upgraded to the new blogger beta and replaced my template with something a little more conventional.  Enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-3166188367802794037?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/3166188367802794037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=3166188367802794037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/3166188367802794037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/3166188367802794037'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/10/blog-facelift.html' title='Blog Facelift'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115982559715722469</id><published>2006-10-02T15:37:00.000-06:00</published><updated>2006-10-02T17:48:14.580-06:00</updated><title type='text'>asp.net C# data webservice for Flex</title><content type='html'>This is kinda the next evolutionary step from my previous blog.   In this example I demonstrate how to get an array of records from .net to flex.  Again, I have simplified this for the purpose of this blog.  In the asp.net webservice, I would normally retrieve records from the database and then iterate thru the dataset to build my array, while here in this example I have just populated the array manually.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;C# Webservice:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;using System;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Diagnostics;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Services;&lt;br /&gt;using System.Xml.Serialization;&lt;br /&gt;&lt;br /&gt;namespace Director&lt;br /&gt;{&lt;br /&gt; public class MemberService : System.Web.Services.WebService&lt;br /&gt; {&lt;br /&gt;  public MemberService() { InitializeComponent(); }&lt;br /&gt;  private IContainer components = null;    &lt;br /&gt;  private void InitializeComponent() {}&lt;br /&gt;  protected override void Dispose( bool disposing )  {&lt;br /&gt;   if(disposing &amp;&amp; components != null) {&lt;br /&gt;    components.Dispose();}&lt;br /&gt;   base.Dispose(disposing); &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  [WebMethod]&lt;br /&gt;  [XmlInclude(typeof(Member))]&lt;br /&gt;  public Member[] getMembers()&lt;br /&gt;  {&lt;br /&gt;   ArrayList al = new ArrayList();&lt;br /&gt;   Member mem = new Member(0,"bob","bsmith","password1",&lt;br /&gt;     "bob@abc.com","Initiate",false,DateTime.Now);   &lt;br /&gt;   al.Add(mem);&lt;br /&gt;   Member mem1 = new Member(0,"jim","jsmith","password2",&lt;br /&gt;     "jim@abc.com","Member",false,DateTime.Now);   &lt;br /&gt;   al.Add(mem1);&lt;br /&gt;   Member mem2 = new Member(0,"ed","esmith","password3",&lt;br /&gt;     "ed@abc.com","Officer",false,DateTime.Now);   &lt;br /&gt;   al.Add(mem2);&lt;br /&gt;   Member mem3 = new Member(0,"neil","nsmith","password4",&lt;br /&gt;     "neil@abc.com","Guest",false,DateTime.Now);   &lt;br /&gt;   al.Add(mem3);&lt;br /&gt;   Member[] outArray = (Member[])al.ToArray(typeof(Member));&lt;br /&gt;   return outArray;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; [Serializable]&lt;br /&gt; public class Member&lt;br /&gt; {&lt;br /&gt;  public int memberid;&lt;br /&gt;  public String name;&lt;br /&gt;  public string username;&lt;br /&gt;  public string password;&lt;br /&gt;  public string email;&lt;br /&gt;  public string comments;&lt;br /&gt;  public bool disabled;&lt;br /&gt;  public DateTime created;&lt;br /&gt;&lt;br /&gt;  public Member(int _memberid, string _name, &lt;br /&gt;string _username, string _password, &lt;br /&gt;string _email, string _comments,&lt;br /&gt;   bool _disabled, DateTime _created)&lt;br /&gt;  {&lt;br /&gt;   memberid = _memberid;&lt;br /&gt;   name = _name;&lt;br /&gt;   username = _username;&lt;br /&gt;   password = _password;&lt;br /&gt;   email  = _email;&lt;br /&gt;   comments = _comments;&lt;br /&gt;   disabled = _disabled;&lt;br /&gt;   created = _created;&lt;br /&gt;  }&lt;br /&gt;  public Member(){}&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;In Flex, the Member.as file:&lt;/span&gt;&lt;pre&gt;package com.abc.ws&lt;br /&gt;{&lt;br /&gt; [Managed]&lt;br /&gt; [RemoteClass(alias=&amp;quot;com.abc.ws.Member&amp;quot;)]&lt;br /&gt; public class Member&lt;br /&gt; {&lt;br /&gt;  public var memberid:int;&lt;br /&gt;  public var name:String;&lt;br /&gt;  public var username:String;&lt;br /&gt;  public var email:String;&lt;br /&gt;  public var password:String;&lt;br /&gt;  public var comments:String;&lt;br /&gt;  public var disabled:Boolean;&lt;br /&gt;  public var created:Date;&lt;br /&gt;  &lt;br /&gt;  public function Member(obj:Object = null)&lt;br /&gt;  {&lt;br /&gt;      if (obj != null)&lt;br /&gt;      {&lt;br /&gt;          this.memberid = obj.memberid;&lt;br /&gt;          this.name = obj.name;&lt;br /&gt;          this.comments = obj.comments;&lt;br /&gt;          this.username = obj.username;&lt;br /&gt;          this.email = obj.email;&lt;br /&gt;          this.disabled = obj.disabled;&lt;br /&gt;          this.created = obj.created;&lt;br /&gt;          this.password = obj.password;&lt;br /&gt;      }   &lt;br /&gt;  }  &lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight:bold;"&gt;In Flex, the application:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx=&amp;quot;http://www.adobe.com/2006/mxml&amp;quot; layout=&amp;quot;vertical&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   import mx.rpc.events.ResultEvent;&lt;br /&gt;   import com.abc.ws.Member;&lt;br /&gt;   import mx.collections.ArrayCollection;&lt;br /&gt;&lt;br /&gt;   [Bindable]&lt;br /&gt;   private var myMembers:ArrayCollection;&lt;br /&gt;   &lt;br /&gt;   private function resultHandler(event:ResultEvent):void   {&lt;br /&gt;          myMembers = event.result as ArrayCollection;&lt;br /&gt;          for (var i:int=0; i&amp;lt;myMembers.length; i++)          {&lt;br /&gt;              var currentMember:Member = new Member();&lt;br /&gt;              currentMember = new Member(myMembers.getItemAt(i));&lt;br /&gt;              myMembers.setItemAt(currentMember, i);&lt;br /&gt;          }&lt;br /&gt;   } &lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt; &lt;br /&gt; &amp;lt;mx:WebService id=&amp;quot;myService&amp;quot;&lt;br /&gt;  wsdl=&amp;quot;http://localhost/Director/MemberService.asmx?wsdl&amp;quot;&lt;br /&gt;  load=&amp;quot;myService.getMembers()&amp;quot;&lt;br /&gt;  showBusyCursor=&amp;quot;true&amp;quot;&lt;br /&gt;  result=&amp;quot;resultHandler(event)&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;mx:DataGrid dataProvider=&amp;quot;{myMembers}&amp;quot;/&amp;gt;  &lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115982559715722469?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115982559715722469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115982559715722469' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115982559715722469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115982559715722469'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/10/aspnet-c-data-webservice-for-flex.html' title='asp.net C# data webservice for Flex'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115982405938673308</id><published>2006-10-02T15:13:00.000-06:00</published><updated>2006-10-02T15:20:59.400-06:00</updated><title type='text'>asp.net c# webservice consumed by flex</title><content type='html'>Someone on the &lt;a href="http://tech.groups.yahoo.com/group/flexcoders"&gt;flexcoders&lt;/a&gt; asked to be provided with a simple example of flex consuming an asp.net webservice.  I know this might be VERY simple, but it proves functionality.&lt;br /&gt;&lt;br /&gt;ASP.NET Webservice in C#&lt;pre&gt;using System;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Diagnostics;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Services;&lt;br /&gt;&lt;br /&gt;namespace Director&lt;br /&gt;{&lt;br /&gt; public class Hello : System.Web.Services.WebService&lt;br /&gt; {&lt;br /&gt;  public Hello()&lt;br /&gt;  {   InitializeComponent();  }&lt;br /&gt;&lt;br /&gt;  #region Component Designer generated code&lt;br /&gt;  &lt;br /&gt;  private IContainer components = null;    &lt;br /&gt;  private void InitializeComponent() {  }&lt;br /&gt;&lt;br /&gt;  protected override void Dispose( bool disposing )  {&lt;br /&gt;   if(disposing &amp;&amp; components != null)&lt;br /&gt;   {&lt;br /&gt;    components.Dispose();&lt;br /&gt;   }&lt;br /&gt;   base.Dispose(disposing);  &lt;br /&gt;  }&lt;br /&gt;  #endregion&lt;br /&gt;&lt;br /&gt;  [WebMethod]&lt;br /&gt;  public string HelloWorld(string variable)  {&lt;br /&gt;   return "Hello " + variable;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Flex Application:&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx=&amp;quot;http://www.adobe.com/2006/mxml&amp;quot; layout=&amp;quot;absolute&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;mx:WebService id=&amp;quot;myService&amp;quot;&lt;br /&gt;  wsdl=&amp;quot;http://localhost/Director/Hello.asmx?WSDL&amp;quot;&lt;br /&gt;  load=&amp;quot;myService.HelloWorld('Peter')&amp;quot;&lt;br /&gt;  showBusyCursor=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;mx:Label text=&amp;quot;{myService.HelloWorld.lastResult}&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;/pre&gt;&lt;br /&gt;If you're accessing a webservice on another machine or domain, don't forget the crossdomain.xml file in the IIS root:&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;!-- http://www.foo.com/crossdomain.xml --&amp;gt;&lt;br /&gt;&amp;lt;cross-domain-policy&amp;gt;&lt;br /&gt;    &amp;lt;allow-access-from domain=&amp;quot;*&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;/cross-domain-policy&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115982405938673308?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115982405938673308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115982405938673308' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115982405938673308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115982405938673308'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/10/aspnet-c-webservice-consumed-by-flex.html' title='asp.net c# webservice consumed by flex'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115981473561064545</id><published>2006-10-02T12:24:00.000-06:00</published><updated>2006-10-02T12:45:35.863-06:00</updated><title type='text'>Flex Custom Combobox Component</title><content type='html'>&lt;p&gt;We needed a country combobox that used an array collection as its dataprovider, however would accept a text value (i.e. "Canada") and select the right item based on the text. We extended the combobox control and embedded our countries array collection inside the control for the purpose of this blog entry. Ultimately we will be using an array collection returned by a dataservice.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Several challenges:&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;searching a specific property of all objects in the arraycollection&lt;/li&gt;&lt;li&gt;binding the selectedText property of our control to a function&lt;/li&gt;&lt;li&gt;setting the default value of the combobox to nothing&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I asked around and it was recommended that I loop through the underlying array of the arraycollection. That sounded very microsoft like and I figured there had to be a better way. It was also suggested I add a dummy record to my countries collection with a "Select Country" string and make that element 0. Again, though this would work, it seemed very ms-ugly.&lt;/p&gt;&lt;p&gt;I struggled with this for quite some time but finally got it working. This custom combobox exposes a property called selectedText. I use ChangeWatcher to keep an eye on the property and trigger a function (setCountry) when it changes. I use a sort on the array collection and the use a cursor on the sort to do my searching... much nicer than a nasty loop. I discovered the handy little "prompt" property which I set to "Select Country".&lt;/p&gt;&lt;p&gt;I'll spare you the gory details of my adventure. Here's the final product:&lt;/p&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initApp()"&lt;br /&gt;xmlns:util="com.atrexis.util.*" change="selectedText=this.text"&amp;gt;&lt;br /&gt; &amp;lt;mx:ArrayCollection id="countries"&amp;gt;&lt;br /&gt;            &amp;lt;mx:Object code="BDA" description="Bermuda"/&amp;gt;&lt;br /&gt;            &amp;lt;mx:Object code="CAN" description="Canada"/&amp;gt;&lt;br /&gt;            &amp;lt;mx:Object code="USA" description="United States"/&amp;gt;&lt;br /&gt;            &amp;lt;mx:Object code="UK" description="United Kingdom"/&amp;gt;          &lt;br /&gt;    &amp;lt;/mx:ArrayCollection&amp;gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt; &amp;lt;![CDATA[&lt;br /&gt;  import mx.events.FlexEvent;&lt;br /&gt;  import mx.binding.utils.ChangeWatcher;&lt;br /&gt;  import mx.collections.*&lt;br /&gt;  import mx.collections.ArrayCollection;&lt;br /&gt; &lt;br /&gt;  [Bindable]&lt;br /&gt;  public var selectedText:String;&lt;br /&gt;  private var countryCursor:IViewCursor;&lt;br /&gt;   &lt;br /&gt;  private function initApp():void{  &lt;br /&gt;   mx.binding.utils.ChangeWatcher.watch(this,"selectedText",setCountry);&lt;br /&gt;   var sort :Sort = new Sort();&lt;br /&gt;   sort.fields = [ new SortField( "description", false ) ];&lt;br /&gt;   countries.sort = sort;&lt;br /&gt;   countries.refresh();&lt;br /&gt;   countryCursor = countries.createCursor();&lt;br /&gt;   dataProvider=countries;&lt;br /&gt;   labelField="description";&lt;br /&gt;   setCountry();&lt;br /&gt;   prompt = "Select Country";&lt;br /&gt;  } &lt;br /&gt;  &lt;br /&gt;  private function setCountry(event:Event = null):void{      &lt;br /&gt;   if (selectedText != null &amp;&amp;amp; selectedText != "") {&lt;br /&gt;    countryCursor.findFirst({description:selectedText});&lt;br /&gt;    this.selectedItem=countryCursor.current;&lt;br /&gt;   }&lt;br /&gt;  }  &lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;/mx:ComboBox&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Things to watch out for&lt;/strong&gt;:&lt;ul&gt;&lt;li&gt;the function called by changewatcher must take an event argument&lt;/li&gt;&lt;li&gt;remember to update the selectedText property on Change event of combobox&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115981473561064545?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115981473561064545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115981473561064545' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115981473561064545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115981473561064545'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/10/flex-custom-combobox-component.html' title='Flex Custom Combobox Component'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115959148835535049</id><published>2006-09-29T22:12:00.000-06:00</published><updated>2006-09-29T22:44:48.463-06:00</updated><title type='text'>Simplified Binding Example for Flex 2</title><content type='html'>Finally figured out a way to get my code to render properly in my blog.  There seems to be some confusion on how to communicate between components.  This example kinda covers most of the basics.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Child Component:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"&amp;gt;&lt;br /&gt;&amp;lt;mx:Metadata&amp;gt;&lt;br /&gt;   [Event(name="childEvent", type="flash.events.Event")]&lt;br /&gt;&amp;lt;/mx:Metadata&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;   &amp;lt;![CDATA[&lt;br /&gt;       [Bindable]&lt;br /&gt;       public var testLabelText:String;     &lt;br /&gt;       private function clickHandler():void        {&lt;br /&gt;           var eventObj:Event = new&lt;br /&gt;               Event("childEvent");&lt;br /&gt;           dispatchEvent(eventObj);        }&lt;br /&gt;   ]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;mx:Binding source="test.text" destination="testLabelText" /&amp;gt;&lt;br /&gt;   &amp;lt;mx:TextInput id="test" text="{testLabelText}"/&amp;gt;&lt;br /&gt;   &amp;lt;mx:Button x="167" y="0" label="Button" click="clickHandler()"/&amp;gt;  &lt;br /&gt;&amp;lt;/mx:Canvas&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Parent Application:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*"&amp;gt;  &lt;br /&gt;   &amp;lt;ns1:Child x="388" y="105" id="childLabel" testLabelText="{parentLabel.text}"&lt;br /&gt;       childEvent="status.text='child button clicked'"/&amp;gt;&lt;br /&gt;   &amp;lt;mx:TextInput x="388" y="131" text="{childLabel.testLabelText}" id="parentLabel"/&amp;gt;&lt;br /&gt;   &amp;lt;mx:Label x="388" y="161" id="status"/&amp;gt;  &lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115959148835535049?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115959148835535049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115959148835535049' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115959148835535049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115959148835535049'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/09/simplified-binding-example-for-flex-2.html' title='Simplified Binding Example for Flex 2'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115949087091663407</id><published>2006-09-28T18:32:00.001-06:00</published><updated>2006-09-29T22:47:00.826-06:00</updated><title type='text'>FDS2: default refreshFill() behaviour</title><content type='html'>To test this I used the CRM sample that ships with FDS.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Problem:&lt;/strong&gt; An arraycollection that had previously been &lt;em&gt;fill()&lt;/em&gt;'ed using query parameters would not update if &lt;em&gt;CreateItem()&lt;/em&gt; was called. If no query parameters were used it worked fine. UpdateItem() and DeleteItem() worked fine as well.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt; If you DO NOT implement your own &lt;em&gt;refreshFill() &lt;/em&gt;in your custom Assembler class, then the default behavior of &lt;em&gt;refreshFill()&lt;/em&gt; might be the cause of the problem.&lt;br /&gt;&lt;br /&gt;The &lt;em&gt;refreshFill()&lt;/em&gt; method proactively queries on whether or not data needs to be pushed out to clients.  It checks to see if the newly created record would fall within the query parameters of the LAST Fill() requested.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt; Let's say you retrieve all Roles for System ID 12 - this creates a unique fill situation for your flex app/session. &lt;em&gt;DataService1.fill(roles, "12")&lt;br /&gt;&lt;/em&gt;Let's say Jim, another user, is currently viewing all Roles for System ID 8 - he  too has his own unique fill situation. &lt;em&gt;DataService1.fill(roles,"8")&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;Now you go and add a new Role for System ID 8. Here's what happens:&lt;br /&gt;FDS recognizes the fact that you are not currently looking at a list that would include this record... so you get no update (DO_NOT_EXECUTE_FILL)&lt;br /&gt;FDS also 'knows' that Jim is looking at a list that should be updated, so it pushes out an update to him, EXECUTE_FILL&lt;br /&gt;&lt;br /&gt;This keeps updates pushed out to a minimum I guess.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;To test:&lt;/strong&gt; in CRM project modify the CompanyAssembler by commenting out the &lt;em&gt;RefreshFill()&lt;/em&gt; method completely.  Run CompanyApp.mxml in debug mode with a breakpoint  in &lt;em&gt;companyResultHandler().&lt;/em&gt;  Change industry to filter by health care, add a new record with a different industry.  When breakpoint kicks in, check the companies arraycollection... you should NOT see your recently added company.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115949087091663407?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115949087091663407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115949087091663407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115949087091663407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115949087091663407'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/09/fds2-default-refreshfill-behaviour_28.html' title='FDS2: default refreshFill() behaviour'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115934305116163008</id><published>2006-09-27T01:40:00.000-06:00</published><updated>2006-09-27T13:09:50.590-06:00</updated><title type='text'>Creating &amp; Using localized flex libraries with Flexbuilder</title><content type='html'>Part One - Create SWC Library&lt;br /&gt;&lt;br /&gt;1. Create a stand alone folder called &lt;u&gt;Resources&lt;/u&gt;  in your flexbuilder projects folder.  Subsequently create subfolders in Resources for each locale (i.e. en_US, fr_FR). Here you will store your resource files: en_US\Main.properties, fr_FR\Main.properties, etc.&lt;br /&gt;2. Start Flexbuilder.  Create a flex library project called &lt;u&gt;testlib.&lt;/u&gt; Add a source path (Project&gt;&gt;&gt; Properties &gt;&gt;&gt; Flex Library Build Path &gt;&gt;&gt; Source Path &gt;&gt;&gt; Add Folder)  &lt;em&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;${DOCUMENTS}\Resources\{locale}&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;3. Add a new folder to project called locale and link it (File &gt;&gt;  New &gt;&gt;&gt; Folder.  At bottom click Advanced &gt;&gt; check  "Link to Folder in the file System") to &lt;span style="color: rgb(255, 153, 0);"&gt;${DOCUMENTS}\Resources&lt;/span&gt;&lt;br /&gt;4. Create a class (code below) and then make sure it's checked in Project&gt;&gt;&gt; Properties  &gt;&gt;&gt; Flex Library Build Path &gt;&gt;&gt; Classes.&lt;br /&gt;5. Create two folders under the bin folder called en_US and fr_FR&lt;br /&gt;6. Change the compile arguments (Project &gt;&gt;&gt; Properties &gt;&gt;&gt; Flex Library Compiler &gt;&gt;&gt;  Additional Compiler Arguments.) to &lt;em&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;-locale fr_FR -include-resource-bundles Main&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;7. Hit OK then copy the compiled swc file to the fr_FR subfolder&lt;br /&gt;8. Change the compile arguments to &lt;span style="color: rgb(255, 153, 0);"&gt;-locale en_US -include-resource-bundles Main&lt;/span&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;9. Hit OK then copied the compiled swc file to the en_US subfolder&lt;br /&gt;=====================================&lt;br /&gt;package com.abc.shared&lt;br /&gt;{&lt;br /&gt;import mx.resources.ResourceBundle;&lt;br /&gt;[Bindable]&lt;br /&gt;public class Company&lt;br /&gt;{&lt;br /&gt;public var NAME_MONKEY:String;&lt;br /&gt;[ResourceBundle('Main')]&lt;br /&gt;private static var bundle:ResourceBundle;&lt;br /&gt;public function Company(){&lt;br /&gt;NAME_MONKEY = bundle.getString("monkey");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;=======================================&lt;br /&gt;en_US\Main.properties contains:&lt;br /&gt;monkey=Billy&lt;br /&gt;=======================================&lt;br /&gt;fr_FR\Main.properties contains:&lt;br /&gt;monkey=Pierre&lt;br /&gt;=======================================&lt;br /&gt;&lt;strong&gt;Part Two - Add Library to Simple Flex App&lt;/strong&gt;&lt;br /&gt;1. Created a new Basic flex application&lt;br /&gt;2. Added &lt;em&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;${DOCUMENTS}\testlib\bin\{locale}\testlib.swc&lt;/span&gt;&lt;/em&gt; to the projects Library Path&lt;br /&gt;3. Added some code to my application.mxml file (highlights below)&lt;br /&gt;4. Compiled and ran it (default would be en_US)&lt;br /&gt;5. Changed the project compiler argument to&lt;em&gt; &lt;span style="color: rgb(255, 153, 0);"&gt;-locale fr_FR&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;6. Compiled and ran it again&lt;br /&gt;7. In each case the application displayed the correct string&lt;br /&gt;=======================================&lt;br /&gt;import com.abc.shared.Company;&lt;br /&gt;[Bindable]&lt;br /&gt;private var company:Company = new Company();&lt;br /&gt;...&lt;br /&gt;mx:Label text="{company.NAME_MONKEY}"&lt;br /&gt;=======================================&lt;br /&gt;&lt;strong&gt;Part Three - add Library to a localized Flex App&lt;br /&gt;&lt;/strong&gt;1. In this case the application and the library projects both point to the same resource folder. I basically repeated steps 2 and 3 of part 1 for my Basic Flex App Project, using the same folders and files.&lt;br /&gt;2. I then added another string to the Main.properties file(s), namely hello=Bonjour and hello=Good Day&lt;br /&gt;3. In my application I put up two labels, one pulling directly from the resource file, the other referencing the class in the swc library and displaying company.NAME_MONKEY.&lt;br /&gt;4. I added the path &lt;span style="color: rgb(255, 153, 0);"&gt;&lt;em&gt;${DOCUMENTS}\testlib\bin\en_US\testlib.swc&lt;/em&gt;&lt;/span&gt; to project library path of the project as I did in step 2 of part 2. (notice i did not use {locale}.&lt;br /&gt;5. When i ran the app i was surprised to discover that even if I ran it with the compile argument of&lt;em&gt;&lt;span style="color: rgb(255, 153, 0);"&gt; -local fr_FR&lt;/span&gt;&lt;/em&gt; it &lt;strong&gt;still&lt;/strong&gt; pulled the correct string out of the properties file (pierre), even tho i was pointing only to the en_US version of the swc!&lt;br /&gt;=======================================&lt;br /&gt;mx:Label text="@Resource(key='hello', bundle='Main')"&lt;br /&gt;mx:Label text="{company.NAME_MONKEY}"&lt;br /&gt;=======================================&lt;br /&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br /&gt;After spending a good chunk of time I finally got Flexbuilder to play along. Here's some things to watch out for.&lt;br /&gt;1. If you change the output path of the flex library to bin/en_US instead of to bin and then manually copying it to en_US, that works. If however you then change it for the fr_FR version, Flexbuilder will nuke the previous bin/en_US folder and the files within&lt;br /&gt;2. If you create your Main.properties and locale folders directly in the project, you get a duplicate symbol error. By placing the files outside the project and then adding a source path reference this problem goes away. However, Flexbuilder does not handle {locale} on the fly, so you will needed a linked folder to access the files during development.&lt;br /&gt;3. Occasionally you might get another error stating it can't load or find main_properties. I find going into project properties and 'altering' the compiler arguements forces a recompile and makes this error go away.&lt;br /&gt;4. As per my previous blog, if you plan on using foreign characters, make sure the text encoding of the resource files is set to UTF-8.&lt;br /&gt;&lt;br /&gt;That concludes my locale adventure thru the world of flexbuilder.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115934305116163008?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115934305116163008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115934305116163008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115934305116163008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115934305116163008'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/09/creating-using-localized-flex.html' title='Creating &amp; Using localized flex libraries with Flexbuilder'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115931384561960839</id><published>2006-09-26T17:29:00.000-06:00</published><updated>2006-09-27T02:26:54.396-06:00</updated><title type='text'>ResourceBundle files in localized Flex apps</title><content type='html'>Problem: You are creating a flex app in flexbuilder that will be available in two languages, English and French.&lt;br /&gt;&lt;br /&gt;You create the following:&lt;br /&gt;&lt;span style="color:#cc6600;"&gt;\locale\en_US\Flexapp.properties&lt;br /&gt;\locale\fr_FR\Flexapp.properties&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;You throw a string in each:&lt;br /&gt;&lt;em&gt;&lt;span&gt;after=after&lt;br /&gt;after=après&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;You compile the application and it defaults to english and comes up fine&lt;br /&gt;You change the compiler arguments in project properties to -locale fr_FR and run it and instead of an &lt;strong&gt;&lt;span style="font-size:130%;"&gt;è&lt;/span&gt;&lt;/strong&gt; you get either a blank or a square&lt;br /&gt;&lt;br /&gt;Solution: The text encoding type of the Flexapp.properties file in flexbuilder defaults to ISO-8859-I. Cut out all the text in the file, save it. Go to the properites of the file and change the encoding to UTF-8. Then paste your text back in and save. Now when you compile and run the letters should come up fine.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115931384561960839?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115931384561960839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115931384561960839' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115931384561960839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115931384561960839'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/09/resourcebundle-files-in-localized-flex.html' title='ResourceBundle files in localized Flex apps'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115929412954633951</id><published>2006-09-26T12:03:00.000-06:00</published><updated>2006-09-26T12:08:49.556-06:00</updated><title type='text'>Default generator class in Hibernate Code Generator</title><content type='html'>I am using mysql, hibernate tools and eclipse 3.2.&lt;br /&gt;&lt;br /&gt;I am generating all my java and xml code using the wizard.&lt;br /&gt;&lt;br /&gt;The default class generator is "assigned".. for mysql and flex data services, this doesn't work so well... we need "native"&lt;br /&gt;&lt;br /&gt;.. one way to work around this is to create a reveng.xml file where you explicitely list each table and then add a primary_key attribute that specifies the generator class.  The other way is to manually edit all the hbm.xml files after each run of the wizard.  Both not great.&lt;br /&gt;&lt;br /&gt;Instead... change the default class generator for your project.&lt;br /&gt;&lt;br /&gt;Here's how:&lt;br /&gt;&lt;br /&gt;Add the &lt;em&gt;hibernate-tools.jar&lt;/em&gt; to your eclipse java project.&lt;br /&gt;&lt;br /&gt;Create the following class in your java project (i used the default package):&lt;br /&gt;&lt;br /&gt;&lt;em&gt;import org.hibernate.cfg.reveng.*;&lt;br /&gt;public class MyRevEngStrategy extends DefaultReverseEngineeringStrategy {&lt;br /&gt;public String getTableIdentifierStrategyName(org.hibernate.cfg.reveng.TableIdentifier t) {return "native"; }&lt;br /&gt;}&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;in your Hibernate Code Generator, modify the reveng.strategy.&lt;br /&gt;in the popup textbox type in MyRevEngStrategy, it should find it.&lt;br /&gt;&lt;br /&gt;Close and run.  Worked for me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115929412954633951?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115929412954633951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115929412954633951' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115929412954633951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115929412954633951'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/09/default-generator-class-in-hibernate.html' title='Default generator class in Hibernate Code Generator'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115752666724767812</id><published>2006-09-06T00:55:00.000-06:00</published><updated>2006-11-17T17:20:45.918-07:00</updated><title type='text'>Flex to .Net via Flex Data Services - it is Possible!</title><content type='html'>When I first looked at Flex Data Services, I was a little disappointed to find that there was no built-in way to interface with .Net.  Sure you can consume webservices directly from a Flex application however, you don't get the added conflict resolution, data push to client, etc stuff that comes with FDS.  After toying around for a while I figured it had to be possible to access webservices through FDS, and eventually I did get it working.  &lt;br /&gt;&lt;br /&gt;   Now there's no way I can cover all this in one blog entry.  So I am going to try and split it up nicely:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;a href="http://viconflex.blogspot.com/2006/11/flex-to-net-via-flex-data-services-part.html"&gt;Part one&lt;/a&gt;&lt;/strong&gt; will only deal with coding the webservice in .Net in such a way that makes it interop-friendly.  I will build a service that provides the basic CRUD and list functionality for a contacts table hosted in SQL server.  &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;a href="http://viconflex.blogspot.com/2006/11/flex-to-net-via-flex-data-services-part_17.html"&gt;Part two&lt;/a&gt;&lt;/strong&gt; will cover Apache Axis and the wsdl2java tool, and we will look at what code gets generated and hurdles other .Net folks might run into.  Once we have our basic java console application up and running, and successfully consuming the .Net webservice, we'll move on to part 3.&lt;br /&gt;&lt;br /&gt;In &lt;strong&gt;part three&lt;/strong&gt; I will build a custom Assembler (extending the &lt;a href="http://livedocs.macromedia.com/flex/2/fds2javadoc/flex/data/assemblers/AbstractAssembler.html" target="_self"&gt;flex.data.assemblers.AbstractAssembler&lt;/a&gt; class.  Then we'll create a destination for our new .Net webservice Assembler class.  &lt;br /&gt;&lt;br /&gt;In the &lt;strong&gt;fourth and final part &lt;/strong&gt;of the series, I will build a Flex application with full list, modify, delete and add functionality, and takes advantage of the data management features of Flex Data Services 2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115752666724767812?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115752666724767812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115752666724767812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115752666724767812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115752666724767812'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/09/flex-to-net-via-flex-data-services-it.html' title='Flex to .Net via Flex Data Services - it is Possible!'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115752459404979789</id><published>2006-09-06T00:24:00.000-06:00</published><updated>2006-09-06T00:51:00.126-06:00</updated><title type='text'>Why Hibernate with Flex Data Services 2?</title><content type='html'>FDS 2 does not come without a learning curve, especially for those of us new to the Java world. I've been trying to find a way to speed things up, and at first I kind of ignored the whole Hibernate side of the equation. But eventually I got curious and I have to say, after tinkering around extensively... I'm pretty excited.&lt;br /&gt;&lt;br /&gt;Hibernate has some pretty cool &lt;a href="http://www.hibernate.org/30.html" target="_new"&gt;plugin tools&lt;/a&gt; for Eclipse/Flexbuilder . With these tools you can reverse-engineer all your hibernate xml mapping files and even the java object classes. What that means is that you can just focus on getting your db design done, and the tools will do the rest. Flex Data Services comes with the &lt;a href="http://livedocs.macromedia.com/flex/2/fds2javadoc/flex/data/assemblers/HibernateAssembler.html" target="_new"&gt;HibernateAssembler&lt;/a&gt; class, and with it they've done all the java coding for you. At least enough to get you started. What's even better is that in the fds2\resources\camples\assemblers, Adobe has thrown in the source code, so down the line you can modify and enhance it as needed.&lt;br /&gt;&lt;br /&gt;In the end, all you need is a database with an Employee table, the hibernate.cfg.xml, the samples/crm/Employee.java and the samples/crm/Employee.hbm.xml files for the HibernateAssembler to work. Create the destinations in your data-management-config.xml and away you go - no Java required!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115752459404979789?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115752459404979789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115752459404979789' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115752459404979789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115752459404979789'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/09/why-hibernate-with-flex-data-services.html' title='Why Hibernate with Flex Data Services 2?'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115752374132673795</id><published>2006-09-06T00:13:00.000-06:00</published><updated>2006-09-06T00:52:57.626-06:00</updated><title type='text'>Pointing Hibernate to MySql</title><content type='html'>Continuing on from my last post, we'll now try getting the crm sampel working with MySQL and Hibernate. Again, I'm going to try and keep this simple. Here's the steps.&lt;br /&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 20px"&gt;&lt;br /&gt;1. Recreate the db in mysql. If you look in samples\web-inf\db\crm you will find a file called crm.script which has the sql statements you will need.&lt;br /&gt;&lt;br /&gt;2. Make sure you have the &lt;a href="http://dev.mysql.com/downloads/connector/j/3.1.html" target="_new"&gt;mysql-jdbc-connector&lt;/a&gt; libraries. Put the .jar file in the samples\web-inf\lib folder.&lt;br /&gt;&lt;br /&gt;3. Edit the HsqlServlet.java file in samples\web-inf\src\samples\crm as follows:&lt;/p&gt;&lt;ul&gt;&lt;li style="PADDING-LEFT: 20px"&gt;change the connection.driver_class to com.mysql.jdbc.Driver &lt;/li&gt;&lt;li style="PADDING-LEFT: 20px"&gt;change the connection.url to jdbc:mysql://127.0.0.1:3306/crm (assuming defaults) &lt;/li&gt;&lt;li style="PADDING-LEFT: 20px"&gt;change the connection.username and connection.password &lt;/li&gt;&lt;li style="PADDING-LEFT: 20px"&gt;change the dialect to org.hibernate.dialect.MySQLDialect &lt;/li&gt;&lt;li style="PADDING-LEFT: 20px"&gt;comment out the hbm2ddl.auto line  &lt;/li&gt;&lt;/ul&gt;&lt;p style="PADDING-LEFT: 20px"&gt;4.  Compile the HsqlServlet.java file into samples\web-inf\classes.&lt;br /&gt;&lt;br /&gt;5. Run FDS. Keep an eye out on the console for any errors.&lt;br /&gt;&lt;br /&gt;6. Open the companyapp.mxml in a browser.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115752374132673795?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115752374132673795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115752374132673795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115752374132673795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115752374132673795'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/09/pointing-hibernate-to-mysql.html' title='Pointing Hibernate to MySql'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115752288032638633</id><published>2006-09-05T23:47:00.000-06:00</published><updated>2006-09-06T00:54:54.460-06:00</updated><title type='text'>Flex Data Services - CRM Sample using Hibernate</title><content type='html'>I've played around a great deal with the sample applications that shipped with Flex Data Services. In particular I was intrigued in getting the CRM example to work with Hibernate. I'm not going to get too deep into the particulars. Here's just a good overview of what needed to be done or what purpose was served, by file.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;samples\web-inf\web.xml&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;In this file there's a section of code that needs to be uncommented. This enables a servlet that runs when jrun boots up, which creates a file called hibernate.cfg.xml and puts it in the samples\web-inf\classes\samples folder.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;samples\web-inf\classes\samples\hibernate.cfg.xml&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;Once you uncomment the web.xml and start up FDS once, this file should exist. In here you will see some basic configuration stuff that basically creates a jdbc connection to an &lt;a href="http://dev.mysql.com/downloads/connector/j/3.1.html" target="_new"&gt;hsqldb&lt;/a&gt; database (a java sql engine that runs within the context of the app server). Also you will not two mapping files, explained next.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;&lt;em&gt;samples\web-inf\classes\samples\crm\employee.hbm.xml&lt;/em&gt;&lt;br /&gt;&lt;em&gt;samples\web-inf\classes\samples\crm\company.hbm.xml&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;These two files serve to map sql tables &amp; columns to java classes and properties, found in samples.crm.Employee and samples.crm.Company, respectively. You can find the source code for these files (if you're new to the java world like me) in samples\web-inf\src\(...)&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#660000;"&gt;samples\web-inf\flex\data-management-config.xml&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;In this file there are 2 sections that need to be uncommented out. You can leave the other destinations in place and just uncomment the destinations crm.employee.hibernate and crm.company.hibernate. Once you've saved these changes it's a good idea to restart FDS.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;samples\dataservice\crm\companyapp.mxml&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;First go ahead and launch this in a browser, make sure FDS is running. The default address would be &lt;a href="http://localhost:8700/samples/dataservice/crm/companyapp.mxml"&gt;http://localhost:8700/samples/dataservice/crm/companyapp.mxml&lt;/a&gt; and make sure everything is still working fine. At this point the application is still using the custom company and employee assembler classes, not hibernate. If everything works fine, go ahead and edit the file. You'll need to find all the comments that pertain to Hibernate and then comment out the line preceding it, while uncommenting the line the line that follows, as per the comment instructions. Save your changes.&lt;br /&gt;&lt;br /&gt;Now go ahead and reload the companyapp.mxml page in the browser. Keep the FDS console open and if everything went well,  you can watch as hibernate generates and logs query statements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115752288032638633?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115752288032638633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115752288032638633' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115752288032638633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115752288032638633'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/09/flex-data-services-crm-sample-using.html' title='Flex Data Services - CRM Sample using Hibernate'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33682522.post-115708901365610175</id><published>2006-08-31T23:29:00.000-06:00</published><updated>2006-08-31T23:36:53.666-06:00</updated><title type='text'>My first blog</title><content type='html'>I've spent an entire month now immersing myself in the world of java, app servers, flex, actionscript, webservices.   Coming from the rather simple .net world, it's been quite a month.  I still think I'm only scratching the surface, and even then, a year from now, I'll probably be no more than a quarter of an inch deeper than I am today.&lt;br /&gt;&lt;br /&gt;I don't know if anyone will ever read this stuff.  I am going to use this blog to record my notes, for my own reference and hopefully to help others.   I am building a huge app in flex, after a year of architecting the whole thing in .net.  I was gonna use it all, MSMQ, .Net Remoting, Winforms, Webservices, SQL Server... it was complicated and beautiful.  And now, scrapped.  The unbearable reality is that if the app was to look good, third party tools would be required, and after years of dealing with Infragistics...  well.&lt;br /&gt;&lt;br /&gt;Of course my transformation has not gone without some clinging to what I know best.  My first project will be to build a flex Assembler class that will use WSDL generated java classes using the Axis tools to allow data managed access via Flex Data Services 2 to any webservice I want, in this case a C# Asp.net webservice running on IIS.&lt;br /&gt;&lt;br /&gt;More to come...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33682522-115708901365610175?l=viconflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viconflex.blogspot.com/feeds/115708901365610175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33682522&amp;postID=115708901365610175' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115708901365610175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33682522/posts/default/115708901365610175'/><link rel='alternate' type='text/html' href='http://viconflex.blogspot.com/2006/08/my-first-blog.html' title='My first blog'/><author><name>Vic Rubba</name><uri>http://www.blogger.com/profile/05333875993257211669</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
