Flex SDK 4.5 support?

3011
24
05-05-2011 08:10 AM
RoyceSimpson
Regular Contributor
All clear to load up Flash Builder 4.5/SDK 4.5 for use with the API?
Tags (2)
0 Kudos
24 Replies
PeterPuck
New Contributor
I try new flex SDK 4.5 and I find one problem with widget minimizing.
If I click on minimize icon I get this :
http://imageshack.us/photo/my-images/4/widgeti.png/


I also have exactly the same problem. Because I'm totally new to ArcGIS-Flex I appreciate an workaround or something like that.

Greets,
Greg
0 Kudos
MehulChoksey
Esri Contributor
To fix widget Minimize issue in 4.5, change <s:Resize to <mx:Resize in WidgetTemplateSkin.mxml as shown below":


  <s:Transition fromState="open" toState="minimized">
            <s:Sequence>
                <s:Fade duration="100" target="{widgetLabel}"/>
                <s:Fade duration="100" target="{headerToolGroup}"/>
                <s:Fade duration="100" target="{contentGroup}"/>
                <s:Fade duration="100" target="{widgetFrame}"/>
                <mx:Resize heightTo="30"
                          target="{hostComponent}"
                          widthTo="100"/>
                <s:Move easer="{bounce}" target="{icon}"/>
            </s:Sequence>
        </s:Transition>
        <s:Transition fromState="*" toState="open">
            <s:Sequence>
                <s:Move target="{icon}"/>
                <mx:Resize heightTo="{hostComponent.widgetHeight}"
                          target="{hostComponent}"
                          widthTo="{hostComponent.widgetWidth}"/>
                <s:Fade duration="100" target="{widgetFrame}"/>
                <s:Fade duration="200" target="{widgetLabel}"/>
                <s:Fade duration="100" target="{contentGroup}"/>
                <s:Fade duration="100" target="{headerToolGroup}"/>
            </s:Sequence>
        </s:Transition>
        <s:Transition fromState="open" toState="closed">
            <s:Sequence>
                <s:Fade duration="100" target="{widgetFrame}"/>
                <s:Fade duration="100" target="{widgetLabel}"/>
                <s:Fade duration="100" target="{headerToolGroup}"/>
                <s:Fade duration="100" target="{contentGroup}"/>
            </s:Sequence>
        </s:Transition>
    </s:transitions>
0 Kudos
PeterPuck
New Contributor
Thanks, that works! :)
0 Kudos
SylvainKerdreux
New Contributor
thank you very much mehu11111 !! ;)
It's perfect now !
0 Kudos
RoyceSimpson
Regular Contributor
Royce,
>> I've come across a few issues using the 4.5 sdk against the 2.3.1 api and imported projects.
Could you list those.

>>little things like .layerinfos.length is no longer recognized.
Unable to reproduce this using 4.5.  Could you provide testcase for this?

>>Looks like if you don't use sdk 4.5, design mode is broken in Flash Builder 4.5.
Its more of Adobe disabling Design View in Flash Builder 4.5 for SDKs other than 3.6 and 4.5

Sylvain,
>> I find one problem with widget minimizing.
Thanks for reporting this.



Ok, I've just re-imported a 4.1 sdk (flashbuilder 4.5) project into a 4.5 sdk one, made a couple adjustments and the only outstanding issue so far... is in the esri sample supplied "NavigationSkin.mxml" (in other words, I haven't modified this file).


...
  <mx:VSlider id="slider"
     dataTipFormatFunction="formatSliderDataTip"
     dataTipPlacement="right"
     enabled.disabled="false"
     enabled.disabledWithSlider="false"
     enabled.normalWithSlider="true"
     height="160"
     includeIn="normalWithSlider,disabledWithSlider"
     liveDragging="false"
     maximum="{hostComponent.map.lods.length - 1}"
...


returns the following warning message:
Data binding will not be able to detect assignments to "length". NavigationSkin.mxml

Doesn't seem to be a deal breaker, but that's the only outstanding issue when going to SDK 4.5.


EDIT:
And here...


<esri:QueryTask id="queryTask" url="{mapLayer.layerInfos.length - 1}" useAMF="false"/>


returns the same warning message:
Data binding will not be able to detect assignments to "length".
0 Kudos
SarthakDatt
Occasional Contributor III
Royce,

The 'length' property on an Array is not Bindable, and yes this warning comes up when using the 4.5 SDK.

You would have to use a function as source of binding expression to make it work. Something like:


<fx:Script>
        <![CDATA[
                      
            private function getSliderMaximumAllowedValue(lods:Array):Number
            {  
                return lods.length - 1; // using this function as the source of data binding expression as the length property of lods(Array) is not bindable
            }
        ]]>
</fx:Script>

<mx:VSlider id="slider"
                    height="130"
                    alpha="{getStyle('contentBackgroundAlpha')}"
                    dataTipFormatFunction="formatSliderDataTip"
                    dataTipPlacement="right"
                    enabled.disabled="false"
                    enabled.disabledWithSlider="false"
                    enabled.normalWithSlider="true"
                    includeIn="normalWithSlider,disabledWithSlider"
                    liveDragging="false"
                    maximum="{getSliderMaximumAllowedValue(hostComponent.map.lods)}"
                    showDataTip="true"
                    snapInterval="1"
                    tickColor="{getStyle('color')}"
                    tickInterval="1"
                    tickLength="3"
                    tickOffset="-3"
                    tickThickness="1"
                    value="{hostComponent.map.level}"/>


Hope that helps.
0 Kudos
YohanBienvenue1
New Contributor
I have an issue when trying to reproduce the WMS layers on/off sample for a Desktop application. The FlashPlayer version works fine but for the Desktop I always get this error: "Error: Skin for poc_desktop0.WindowedApplicationSkin2.Group3.contentGroup.HDividedBox7._poc_desktop_Map1.StaticLayer13.ScaleBar24 cannot be found."

flex_sdk_4.5.0.17689
arcgis-api-for-flex-2.3.1
Flash Builder 4.5
Adobe Air 2.6.0.19140

I tried adding the arcgis-api-for-flex-2.3.1\skins\src folder as a source attachment for agslib-2.3.1-2011-04-26.swc in the "Flex Library Build Path" in Flash Builder, but it didn't help.

Is this a 4.5 SDK issue or do I have to do something special for Air?
0 Kudos
BjornSvensson
Esri Regular Contributor
I have an issue when trying to reproduce the WMS layers on/off sample for a Desktop application.


It works fine for me:)
I created a new Project (Application type: Desktop), added the 2.3.1 swc, added the com.esri.ags.samples, and copied in the WMS sample.

Is this your first Desktop AIR project?
Have you tried any other samples and got them working?
Did you make any other changes to the Flex Project?
0 Kudos
YohanBienvenue1
New Contributor
Thanks bjorn for your response, although after some debugging I realize now it's not an issue with the SDK. What I'm trying to do is put the sample in a separate library, which I could then include in all different Flex projects (i.e. AIR, FlashPlayer, mobile). To avoid repetition. I found that when I move everything out of the library, then everything will work fine. I think I can't include a SWC within a SWC. Yes I am kind of new to Flex so I apologize, I should have debugged more.

As for why it worked with my FlashPlayer project, I just realized that if you don't do a clean build, Flash Builder will run your latest working SWF if you have errors with your current one.. After a clean, I was getting the same error in this project as well.
0 Kudos
DasaPaddock
Esri Regular Contributor
Yohan,

You can create a swc that uses the ArcGIS Flex swc, but you'll need to make sure that in your library project, you set the link type to "external" under the Library path. You'll then just need to include both swcs in your application project.
0 Kudos