Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Problems with using whiteboard in flex 4.

Avatar

Level 3

I recently ported my app to flex 4 using spark components. The SharedWhiteboard has stopped working correctly.

There are 3 specific problems:

     1) I'm unable to change the color of a line or shape. It throws an exception in the debugger. It looks like it's an exception in NullColorPicker having it's updateDisplayList called with NaN for width and height. But I can't be sure. (No Flash10 source yet)

     2) I'm unable to rotate things. When I try to rotate something, the object orbits a point rather than rotates around it.

     3) I'm unable to set a contextMenu. It just ignores my settings.

Are these known conditions in flex 4 with spark for AFCS? Or did I bork something?

thanks

7 Replies

Avatar

Former Community Member

Hi,

We have fixed the ColorPicker problem and there will be no exception now, just wait for some days for release down the corner. The colorpicker skin might still look bit flaky but it should be fine functionality wise.

Can you give us a test code of the Context Menu and I will investigate that.

We will also take a look at the 2nd issue.

Thanks

Hironmay Basu

Avatar

Former Community Member

Happy to hear that the color picker issue is fixed.

I think that the ContextMenu is either my bug, or possibly a Flex4/Spark issue, so let's ignore that one for now. (I can't reproduce it in a simple environment.)

Here's some code that shows the rotation issue I was talking about. It uses the coreUI:WhiteBoard. Just create a highlight rectangle and then try to rotate it. It orbits around a point off to the right instead of rotating around it's center.

---------------------------------------------------------------- SNIP -----------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               xmlns:rtc="AfcsNameSpace"
               xmlns:coreUI="CoreUINameSpace"              
               minWidth="955" minHeight="600"  creationComplete="createComplete()" >
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[

            private function createComplete() : void  {
                var contextMenu:ContextMenu = new ContextMenu();
                contextMenu.hideBuiltInItems();
               
                var customItems:Array = new Array;
                var item:ContextMenuItem;
               
                item = new ContextMenuItem("Item1", false, true, true);
                customItems.push(item);
               
                item = new ContextMenuItem("Item2", false, true, true);
                customItems.push(item);
               
               
                contextMenu.customItems = customItems;
                wb.contextMenu = contextMenu;
            }
        ]]>
    </fx:Script>
    <coreUI:WhiteBoard id="wb" width="100%" height="100%"/>
</s:Application>

---------------------------------------------------------------- SNIP -----------------------------------------------------------------------------------

Avatar

Former Community Member

Hi ,

We are actively looking into the rotation issue. We will update you asap.

Thanks

Hironmay Basu

Avatar

Employee

Hi,

Thanks for the finding the rotation issue. We are still actively looking into the problem. But for a very quick hack please compile your app with the option -compatibility-version 3.0.0

Flash Builder --> Project --> Properties --> Flex Compiler --> Compiler Options --> Additional Compiler Arguements [text box]

As you might have guessed the new Flex SDK 4.0 have made some UIComponent layout-related changes, whose properties are changed from post-scale to  pre-transform.

Sincerely

Arun

Avatar

Level 2

Thanks for that compatibility fix... I saw this bug and thought it was going to be a nightmare to fix.  The -compatibility flag seems to work perfectly

Avatar

Level 2

I believe I encountered the contextMenu issue as well. For spark components, you need to explicitly set mouseEnabled=true for context menus to work. Hope that helps. -Ion

Avatar

Former Community Member

I actually just figured out the fix without forcing any compatibility mode changes. Yup, for whatever reason the Spark UIComponent messes up rotation so that it's super-hard to subclass it (which our shape containers do).

Here's a monkey-patched version of WBShapeContainer which fixes the issue. Just replace the source at com.adobe.coreUI.controls.whiteboardClasses .

We'll make sure to get this in for the next release too. Thanks for bearing with us!

  nigel