2012/06/04

The Deployment of and Solutions to TWaver Flex Demo on Flash Builder4

When users deploy TWaver Flex Demo on FB and then copy demo of src into it, they will find that some error messages will pop out and stop its function.
The main reason is that the latest Flash Builder applies SDK4.0 or 4.1 as default while many users are still using the edition SDK3. So in order to be compatible with editions SDK 3.4 and above, some of our Demo's codes are based on SDK3.
This does never mean that our SDK does not support SDK4: it is out of question that twaver.swc is able to run with SDK4, with just some small adjustments are to be made to our Demo. There are three methods to settle it down:
  1. Directly running with edition 3.5 as it is shown in the following picture: 


  2. If you would like to edit with SDK4, please choose "MX only" from the two options under Build Path of the project:
  3.  

  4. If you choose "MX+Spark", you need to set the following parameters.
  5. (1)When initializing init, you need to set the following two twaver's defaults——the background parameters of network, otherwise the rectangular-marquee selection will not be available when the background is null. 
    Defaults.NETWORK_BACKGROUND_ALPHA = 0;
    Defaults.NETWORK_BACKGROUND_COLOR = 0xFF0000;
    (2)Some parameters in TWaver products' demos can just be deleted, for Flex4 has changed the property name of style in just several components. You could refer to the following link for more details:      http://opensource.adobe.com/wiki/display/flexsdk/More+Styles+for+Spark+Skins

         borderVisibility has replaced borderThickness and
         Can turn border on and off only
         dropShadowVisible has replaced dropShadowEnabled.
         contentBackgroundAlpha has replaced backgroundAlpha.
         contentBackgroundColor has replaced backgroundColor.
    (3)If you need zoom in and out the texts of label in the CloudLayout at lower left side of TWaver products' demo, then the addition of the parameter embedAsCFF='false' in Flex4 will be needed.  
    http://macmartine.com/blog/2009/10/embedding-fonts-in-flex-4.html
    [Embed(source='Helvetica.ttf',
    fontName="demoFont",
    advancedAntiAliasing="false",
    mimeType="application/x-font",
    embedAsCFF='false')]
You can choose model MX+only in SDK3.5 or SDK4 when running the demo to avoid troubles. As to which SDK to choose, you could do anyone according to your detailed requirements.

In general, twaver SDK twaver.swc completely supports the development of Flex3 and Flex4. You just need pay attention to the above three points when applying the blended model MX+Spark.

No comments:

Post a Comment