Sunday 28 August 2011

Flex - Could not resolve mx Script to a component implementation.

When you find this problem with latest flex builder. Don't panic. Just this error indicates you to change the latest  MXML script.


Lets go practical.
                 
                    Change <mx:Script> to  <fx:Script> will do the fix.

 The below example will give the clear picture.This works well in Adobe Flex builder 4.x versions with Windows 7.

<s:application minheight="600" minwidth="955" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"> 
<fx:declarations>
<mx:httpservice id="photoService" result="photoHandler(event)"   url="http://api.flickr.com/services/feeds/photos_public.gne">
</mx:httpservice>
<fx:script>


</fx:script><br />     <s:hgroup height="219" textalign="left" width="529" x="174" y="37">
<s:label height="23" text="Flickr tags or Search" verticalalign="middle"   width="188">
<s:textinput id="searchTerms">
<s:button click="requestPhotos()" label="Search">
</s:button>
</s:textinput>
</s:label>
</s:hgroup>
</fx:declarations>
</s:application>

2 comments: