<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Migrating a Flash Application to Flex</title>
	<atom:link href="http://aralbalkan.com/471/feed" rel="self" type="application/rss+xml" />
	<link>http://aralbalkan.com/471</link>
	<description>Aral on Flash, SWX, Flex, ActionScript, and life.</description>
	<pubDate>Sun, 07 Sep 2008 21:18:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: wruth</title>
		<link>http://aralbalkan.com/471#comment-528</link>
		<dc:creator>wruth</dc:creator>
		<pubDate>Sun, 13 Nov 2005 20:15:12 +0000</pubDate>
		<guid isPermaLink="false">#comment-528</guid>
		<description>Aral:&lt;br /&gt;
&lt;br /&gt;
Thanks for the article. I'm a Flex newbie, just starting to explore it now with the release of the 2.0 alpha. Your suggestion to subclass mx.core.Application makes a lot of sense to me, with the aim of maintaining traditional class files and so on. I'm having a hard time implementing this effectively in my own experiments however. I've been through a couple of iterations exploring this so far.&lt;br /&gt;
&lt;br /&gt;
My problem seems to stem from the fact that Flex compiles mxml Application files by generating a class that subclasses mx.core.Application, containing the specific properties and "methods" defined in one's mxml file. That's pretty cool, but there are a couple of consequences of this I haven't figured out how to work around:&lt;br /&gt;
&lt;br /&gt;
1.  If I pass a reference of the mxml generated instance to another class ( a Controller for instance), I can't type the reference specifically. I can type it as mx.core.Application, but that will prevent the Controller from calling any subclass methods on the instance. And even knowing the name of the generated subclass, I haven't been able to successfully get the compiler to resolve the specific type.&lt;br /&gt;
2.  If I designate a custom subclass of mx.core.Application as the mxml's root container, it is still a generated subclass of that custom subclass that is instantiated. So any UI properties that I reference in my custom subclass don't exist there (even if I declare them), because I am declaring them in the mxml file, and thus in the generated subclass of my custom class.&lt;br /&gt;
&lt;br /&gt;
I tried rewriting your Flex 1.5 bug example from February (&lt;a href="http://www.flashant.org/index.php?p=273&#38;more=1&#38;c=1"&gt;Fundamental bug in Flex Builder 1.5?&lt;/a&gt;), and couldn't get it to work because of the second reason -- neither aButton or aTextInput exist in the scope of ApplicationSubclass. Rather they exist in the generated subclass of ApplicationSubclass (in my case named FlexBuilderBug).&lt;br /&gt;
&lt;br /&gt;
So as far as I can tell at this point the best I can do is to define my custom subclass just within the mxml (using an  included script file to be tidy), and accept the fact I can't specifically type it in any class I pass it as a reference to.&lt;br /&gt;
&lt;br /&gt;
Am I overlooking something basic here? Based on your tutorial and your February post it seems like Flex 1.5 behaved differently. Or maybe that was just a consequence of AS2.0 being less strict in some regards compared to AS3.0 -- like allowing identical (UI) properties to be declared in both a super and sub-class? I'm very curious if you have any insight into this, since I would really like to structure my code in the manner you suggest. I've omitted specific code examples in the interests of brevity, but would be happy to supply those if would help clarify my description of the issue.&lt;br /&gt;
&lt;br /&gt;
Thank you!&lt;br /&gt;
</description>
		<content:encoded><![CDATA[<p>Aral:</p>
<p>Thanks for the article. I&#8217;m a Flex newbie, just starting to explore it now with the release of the 2.0 alpha. Your suggestion to subclass mx.core.Application makes a lot of sense to me, with the aim of maintaining traditional class files and so on. I&#8217;m having a hard time implementing this effectively in my own experiments however. I&#8217;ve been through a couple of iterations exploring this so far.</p>
<p>My problem seems to stem from the fact that Flex compiles mxml Application files by generating a class that subclasses mx.core.Application, containing the specific properties and &#8220;methods&#8221; defined in one&#8217;s mxml file. That&#8217;s pretty cool, but there are a couple of consequences of this I haven&#8217;t figured out how to work around:</p>
<p>1.  If I pass a reference of the mxml generated instance to another class ( a Controller for instance), I can&#8217;t type the reference specifically. I can type it as mx.core.Application, but that will prevent the Controller from calling any subclass methods on the instance. And even knowing the name of the generated subclass, I haven&#8217;t been able to successfully get the compiler to resolve the specific type.<br />
2.  If I designate a custom subclass of mx.core.Application as the mxml&#8217;s root container, it is still a generated subclass of that custom subclass that is instantiated. So any UI properties that I reference in my custom subclass don&#8217;t exist there (even if I declare them), because I am declaring them in the mxml file, and thus in the generated subclass of my custom class.</p>
<p>I tried rewriting your Flex 1.5 bug example from February (<a href="http://www.flashant.org/index.php?p=273&amp;more=1&amp;c=1">Fundamental bug in Flex Builder 1.5?</a>), and couldn&#8217;t get it to work because of the second reason &#8212; neither aButton or aTextInput exist in the scope of ApplicationSubclass. Rather they exist in the generated subclass of ApplicationSubclass (in my case named FlexBuilderBug).</p>
<p>So as far as I can tell at this point the best I can do is to define my custom subclass just within the mxml (using an  included script file to be tidy), and accept the fact I can&#8217;t specifically type it in any class I pass it as a reference to.</p>
<p>Am I overlooking something basic here? Based on your tutorial and your February post it seems like Flex 1.5 behaved differently. Or maybe that was just a consequence of AS2.0 being less strict in some regards compared to AS3.0 &#8212; like allowing identical (UI) properties to be declared in both a super and sub-class? I&#8217;m very curious if you have any insight into this, since I would really like to structure my code in the manner you suggest. I&#8217;ve omitted specific code examples in the interests of brevity, but would be happy to supply those if would help clarify my description of the issue.</p>
<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: murk</title>
		<link>http://aralbalkan.com/471#comment-525</link>
		<dc:creator>murk</dc:creator>
		<pubDate>Sat, 29 Oct 2005 11:44:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-525</guid>
		<description> &lt;br /&gt;
Thank you very much. This is going to be really helpful. I think it's great what you and others like you have been doing for the Flash/Flex community. I want to follow your example and contribute in any way I can.</description>
		<content:encoded><![CDATA[<p>
Thank you very much. This is going to be really helpful. I think it&#8217;s great what you and others like you have been doing for the Flash/Flex community. I want to follow your example and contribute in any way I can.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aral Balkan</title>
		<link>http://aralbalkan.com/471#comment-524</link>
		<dc:creator>Aral Balkan</dc:creator>
		<pubDate>Fri, 28 Oct 2005 13:30:16 +0000</pubDate>
		<guid isPermaLink="false">#comment-524</guid>
		<description>Currently, on a Flex/J2EE project, we're using OpenAMF, our own lightweight J2EE framework with simple DAOs, etc. I'm not hung up on buzzwords all that much: Hibernate is cool but what we really need is transparent object persistence, not object-to-relational mapping which, imho, moves the code to another section of the app (not that I don't think it's great -- I just want more dammit!) :) &lt;br /&gt;
&lt;br /&gt;
Flash remoting makes it easy to use a very lightweight architecture server-side that compliments our lightweight client-side architecture in ARP. &lt;br /&gt;
&lt;br /&gt;
Note, btw, that my article was written long before Flex 2 and, although the concepts are the same, there is the additional AS2 -&gt; AS3 conversion step -- at least until AS3 is available for Flash projects.</description>
		<content:encoded><![CDATA[<p>Currently, on a Flex/J2EE project, we&#8217;re using OpenAMF, our own lightweight J2EE framework with simple DAOs, etc. I&#8217;m not hung up on buzzwords all that much: Hibernate is cool but what we really need is transparent object persistence, not object-to-relational mapping which, imho, moves the code to another section of the app (not that I don&#8217;t think it&#8217;s great &#8212; I just want more dammit!) <img src='http://aralbalkan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Flash remoting makes it easy to use a very lightweight architecture server-side that compliments our lightweight client-side architecture in ARP. </p>
<p>Note, btw, that my article was written long before Flex 2 and, although the concepts are the same, there is the additional AS2 -> AS3 conversion step &#8212; at least until AS3 is available for Flash projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kim Hansen</title>
		<link>http://aralbalkan.com/471#comment-523</link>
		<dc:creator>Kim Hansen</dc:creator>
		<pubDate>Fri, 28 Oct 2005 13:11:39 +0000</pubDate>
		<guid isPermaLink="false">#comment-523</guid>
		<description>I have a question. What do you use to easily create your Java services; XDoclet, Hibernate or other technology?</description>
		<content:encoded><![CDATA[<p>I have a question. What do you use to easily create your Java services; XDoclet, Hibernate or other technology?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kim hansen</title>
		<link>http://aralbalkan.com/471#comment-522</link>
		<dc:creator>Kim hansen</dc:creator>
		<pubDate>Fri, 28 Oct 2005 13:08:19 +0000</pubDate>
		<guid isPermaLink="false">#comment-522</guid>
		<description>Hi Aral,&lt;br /&gt;
&lt;br /&gt;
Thanks for posting this article. It will definitely come in handy when I will throw myself on Flex2 and want to migrate my MVC projects to Flex2. I am really looking for a solution where I can keep my current structure/separation of concerns, while benefitting from AS3.&lt;br /&gt;
&lt;br /&gt;
I was so happy when Flex 1 came out, because it fitted me perfectly as a developer, until I saw the price tag. It made me completely ignore Flex until recently when MM announced the labs and the Flex 2 price tag.&lt;br /&gt;
&lt;br /&gt;
I am still trying to understand though if I can use openAMF with AS3 as I have done until now with AS2.</description>
		<content:encoded><![CDATA[<p>Hi Aral,</p>
<p>Thanks for posting this article. It will definitely come in handy when I will throw myself on Flex2 and want to migrate my MVC projects to Flex2. I am really looking for a solution where I can keep my current structure/separation of concerns, while benefitting from AS3.</p>
<p>I was so happy when Flex 1 came out, because it fitted me perfectly as a developer, until I saw the price tag. It made me completely ignore Flex until recently when MM announced the labs and the Flex 2 price tag.</p>
<p>I am still trying to understand though if I can use openAMF with AS3 as I have done until now with AS2.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
