{"id":30,"date":"2008-07-30T14:46:31","date_gmt":"2008-07-30T21:46:31","guid":{"rendered":"http:\/\/www.nayansavla.com\/blog\/?p=30"},"modified":"2008-07-30T14:46:31","modified_gmt":"2008-07-30T21:46:31","slug":"using-flex-builder-3-to-compile-flex-4-applications","status":"publish","type":"post","link":"https:\/\/www.nayansavla.com\/blog\/?p=30","title":{"rendered":"Using Flex Builder 3 to compile Flex 4 applications"},"content":{"rendered":"<p>Flex 4 SDK is available for download now, even though it will be a lot buggy i suppose, nevertheless i decided to play with it and try it out. Flex 4 applications work with Flash Player 10 only and I didn&#8217;t want to install it since it can&#8217;t co-exist with other FP versions. Also i love FB eclipse plugin and wanted to write Flex 4 code using that. Here is how i\u00a0achieved\u00a0my goal,\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>PS: I am assuming that you are fairly familiar with Flex Builder or the Eclipse FB Plugin<\/p>\n<p>\u00a0<\/p>\n<p><strong>Downloading the Flex SDK:<\/strong><\/p>\n<p>They have started releasing nightly builds of Flex SDK and i downloaded the latest one. <a title=\"Gumbo\" href=\"http:\/\/opensource.adobe.com\/wiki\/display\/flexsdk\/Download+Flex+4\" target=\"_blank\">Get it<\/a>.<\/p>\n<p>It doesn&#8217;t matter where you save the file. Once you download the file, go to your Eclipse Preferences and then in Flex Settings, select add this SDK. I keep Flex 3 as my default SDK and then we will choose this SDK specifically for Flex 4 projects.<\/p>\n<p>\u00a0<\/p>\n<p><strong>Setting up a Project:<\/strong><\/p>\n<p>Create a standard Flex project as you would normally do in FB. Lets not worry about the main application file for now, first we need to change some settings for our project.<\/p>\n<p>\u00a0<\/p>\n<p>Right Click the Project and then select its properties. Go to Flex Compiler option and Select use a specific SDK.\u00a0<\/p>\n<p>Choose Flex 4. Also I select the wrapper to have required player version to 10.0.0 even though i will be running swf directly. For my browsers the FP version is still 9.0.115.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/nayansavla.com\/uploads\/pics\/flex4\/screen.jpg\" alt=\"\" width=\"600\" height=\"450\" \/><\/p>\n<p>I use the following sample code, it is taken from Adobe site,<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<\/p>\n<p><span>&lt;Application<\/span><span> xmlns=&#8221;<\/span>http:\/\/ns.adobe.com\/mxml\/2009<span>&#8220;<\/span><\/p>\n<p>\u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 xmlns:mx=&#8221;<span>library:adobe\/flex\/halo<\/span>&#8221;<\/p>\n<p>\u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 layout=&#8221;<span>flex.layout.VerticalLayout<\/span>&#8221; backgroundColor=&#8221;<span>white<\/span>&#8221;<\/p>\n<p>\u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 width=&#8221;<span>800<\/span>&#8221; height=&#8221;<span>600<\/span>&#8221; xmlns:ns=&#8221;<span>library:adobe\/flex\/gumbo<\/span>&#8221; xmlns:skin=&#8221;<span>flex.skin.*<\/span>&#8220;<span>&gt;<\/span><\/p>\n<p>\u00a0 \u00a0 <span>&lt;Ellipse<\/span> width=&#8221;<span>10<\/span>&#8221; height=&#8221;<span>10<\/span>&#8221; y=&#8221;<span>3<\/span>&#8220;<span>&gt;<\/span><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 <span>&lt;fill&gt;<\/span><\/p>\n<p><span>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/span>&lt;mx:RadialGradient&gt;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span>&lt;mx:GradientEntry<\/span> color=&#8221;<span>0xAAAAAA<\/span>&#8221; <span>\/&gt;<\/span><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span>&lt;mx:GradientEntry<\/span> color=&#8221;<span>0x336699<\/span>&#8221; <span>\/&gt;<\/span><\/p>\n<p><span>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/span>&lt;\/mx:RadialGradient&gt;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 <span>&lt;\/fill&gt;<\/span><\/p>\n<p><span>\u00a0 \u00a0 <\/span>&lt;\/Ellipse&gt;<\/p>\n<p>\u00a0 \u00a0 <span>&lt;mx:Button<\/span> label=&#8221;<span>halo button<\/span>&#8221; <span>\/&gt;<\/span><\/p>\n<p>\u00a0 \u00a0 <span>&lt;Button<\/span> label=&#8221;<span>gumbo button<\/span>&#8221; <span>\/&gt;<\/span><\/p>\n<p>&lt;\/Application&gt;<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>Note: This is all you have to do if you already have FP 10 installed.\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>Since i don&#8217;t have FP 10, I just have to do a minor modification. FP 10 also comes bundled with your Flex SDK, if you look into flex_sdk_4\/runtimes\/player\/mac, there should be a zip file. I have associated all the swf files with this app. So whenever i click on swf, it opens up with this version of Flash Player.\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>We can do that change in our project by selecting the Run\/Debug Settings for the project and then clicking the edit button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/nayansavla.com\/uploads\/pics\/flex4\/launch.jpg\" alt=\"\" width=\"600\" height=\"450\" \/><\/p>\n<p>if everything goes well the next time when you run this project, it will run in FP 10 application and you are all set for writing Flex 4 applications.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flex 4 SDK is available for download now, even though it will be a lot buggy i suppose, nevertheless i decided to play with it and try it out. Flex 4 applications work with Flash Player 10 only and I didn&#8217;t want to install it since it can&#8217;t co-exist with other FP versions. Also i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[39,40],"class_list":["post-30","post","type-post","status-publish","format-standard","hentry","category-flex","tag-flex-4","tag-flex-builder"],"_links":{"self":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30"}],"version-history":[{"count":0,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}