Copy link to clipboard
Copied
Hi
I have Flash Builder 4.5.1 on Windows 7 using SDK 4.5.1.
Following many of the Hello World video tutorials (including what's on Adobe TV's website) I create a new Mobile based Application in Flash Builder. I set it up to be a View Based Application targeting iOS and iPhone (although the problem is for any iOS device).
I follow all the instructions and yet the MXML that's created at the end is component based and not targeting Spark Views. This floors running or viewing the app! Code for both Application class and View is as follows:
<?xml version="1.0" encoding="utf-8"?>
<components:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" xmlns:components="spark.components.*" firstView="views.MyMobileProjectHomeView" applicationDPI="240">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</components:ViewNavigatorApplication>
<?xml version="1.0" encoding="utf-8"?>
<components:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" xmlns:components="spark.components.*" title="HomeView">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</components:View>
I have no idea why Flash Builder is creating code that's namespaced to components and not the spark framework.
The code that's created in the course is below and yet if I import their project and try and view in Design view Flash Builder tells me 'An unknown item is declared as the root of your MXML document. Switch to source mode to correct it.':
<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.HelloWorldHomeView" applicationDPI="240">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:ViewNavigatorApplication>
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Label text="Hello World"/>
</s:View>
Please help
Many thanks in advance
David
Copy link to clipboard
Copied
Here's the solution:
The problem did not exist on an installation of Flash Builder on a spare MacBookPro.
On my main computer (the one with the Flash Builder issue) I uninstalled and reinstalled Flash Builder 4.5 (then updated to 4.5.1). Creating an iOS Mobile Application now creates the correct code.
I have no idea why it was creating dodgy code.
The only difference with the new Flash Builder install is that SourceMate 3.0 is not installed yet. Perhaps something had gone wrong in the Adobe Updater when going from 4.5 to 4.5.1, who know...all speculation...anyhow it works now!
Copy link to clipboard
Copied
I had the same problem - I just uninstalled everything and then started from scratch again. Solved it on my end - very frustrating, I hear ya. Especially for the confused novice.