BowlerHatLLC / vscode-as3mxml

ActionScript & MXML language extension for Visual Studio Code. Develop apps for Adobe AIR, Adobe Flash Player, or Apache Royale.
https://as3mxml.com/
Apache License 2.0
257 stars 39 forks source link

Code intelligence broken when non-class script files are referenced in MXML or ActionScript #324

Closed LudvikWiejowski closed 4 years ago

LudvikWiejowski commented 5 years ago

Hello, I can't make "go to" functions work in VSC for Flex actionscript project. I have root folder with asconfig and scripts in scr folder and its subfolders.

I tried many things, I found here among the issues, but no luck. Can you please point me to the right direction, as I'm obviously missing something.

Thanks a lot.

{
    "config": "air",
    "compilerOptions": {
        "output": "bin/LoadCargoIn.swf",
        "library-path": [
            "purePDFont.swc","purePDF.swc","fzip.swc","datavisualization.swc","datavisualization_rb.swc","${flexlib}"
        ],
        "source-path": [
            "src"
        ]           
    },
    "application": "src/LoadCargoIn-app.xml",
    "files":
    [
        "src/LoadCargoIn.mxml"
    ],
    "copySourcePathAssets": true
    "airOptions": {
        "output": "bin/LoadCargoIn.air",
        "signingOptions": {
            "storetype": "pkcs12",
            "keystore": "/Users/luwi/VisualStudioCodeProjects/LudvikWiejowski6.pfx",
            "tsa": "http://timestamp.comodoca.com/rfc3161"
        },
        "files": [
            {"file": "src/icons/app/i16.png","path": "icons/app/i16.png"},
            {"file": "src/icons/app/i32.png","path": "icons/app/i32.png"},
            {"file": "src/icons/app/i48.png","path": "icons/app/i48.png"},
            {"file": "src/icons/app/i72.png","path": "icons/app/i72.png"},
            {"file": "src/icons/app/i128.png","path": "icons/app/i128.png"}
        ]
    }
}
joshtynjala commented 5 years ago

Does anything appear in the Problems view when you have a .mxml or .as file from your project open?

LudvikWiejowski commented 5 years ago

No, problems tab is empty. I use old SDK 3.2 with AIR SDK 3.5, but compilation works fine, programme is running as in my old Flex builder 3.

Ctrl+Click does not work, it just open menu just I would click the right mouse button. (I'm on MacOS Mojave). Tried to do that from Go menu (go to definition, go to implementation), but nothing happens.

thanks

piotrzarzycki21 commented 5 years ago

@joshtynjala I can confirm that in Moonshine with extension 0.17.0 it doesn't work as well. Here you have some screen cast. jump_

joshtynjala commented 5 years ago

@piotrzarzycki21 I checked, and the Moonshine issue is different. The correct result is returned by the language server, but the editor is not properly changing the position of the cursor.

joshtynjala commented 5 years ago

@LudvikWiejowski I think that you're probably running into two issues here.

1) There is a bug in v0.17.1 that causes the extension to freeze if certain invalid compiler options are specified. This bug is fixed here on Github, and it will be included in the next release.

This bug should not actually stop you from fixing your project in v0.17.1, though. It just makes it a little more difficult to figure out what's not configured correctly in your project. However, I think that I know what's wrong:

2) The extension does not support a value less than 10.1 for the target-player compiler option. You're not setting target-player in asconfig.json, but it's actually the default value from your SDK that doesn't work with the extension. Since you're using Flex SDK 3.x, it probably defaults to version 9.0.124 or something else that is lower than 10.1. If you want to continue using this particular SDK, you'll need to follow these instructions:

https://github.com/BowlerHatLLC/vscode-as3mxml/wiki/Common-issues#invalid-version-specified-90124-compiler-error

See that link for details, but basically, you need to set `target-player` in *asconfig.json* to an appropriate value, and then you also need to make sure that *playerglobal.swc* is located in the correct place inside your Flex SDK.

By the way, if you'd like to download playerglobal.swc for a particular version, you can get it here: https://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html

LudvikWiejowski commented 5 years ago

@joshtynjala

thanks a lot Josh for your support. I tried with player 10.1 and indeed, I could see menu with "go to" items when pressing ctrl+click and when hovering over the elements in mxml and as, I can see more, but when using it, I receive message that destination was not found even if it's function in the same file. Also, I can see now 8K errors and 270 alerts. Despite this building still works.

I changed it back and removed target-player parameter. Now I can see (I forgot to mention it before), that there is a message at the bottom in status bar with update circle icon saying "Initializing Actionscript & MXML language server.

As you wrote it's not preventing me from using VS Code. To be honest, I like you extension very much. I tried FB 4.6, FB 4.7, FDT, IntelliJ Idea and I would like to stay with VSC.

joshtynjala commented 5 years ago

Now I can see (I forgot to mention it before), that there is a message at the bottom in status bar with update circle icon saying "Initializing Actionscript & MXML language server.

This confirms to me that the default target-player < 10.1 is triggering the bug that causes the extension to freeze if certain invalid compiler options are specified. This will be fixed in v0.18 (or, depending on how much time I need for some new features, I might release v0.17.2 a little sooner).

Also, I can see now 8K errors and 270 alerts.

This may not be as bad as you think. It's probably just one serious error that, when you fix it, the rest will be cleared up automatically. If you'd be willing to share the first few errors that you see in the problems view, it may give me a clue.

Just as an example, if you see an error like "Missing builtin type Object", fixing it should clear up most everything else.

LudvikWiejowski commented 5 years ago

I don't think it will be that easy. I will rather wait for fixed version. ;)

screenshot 2019-01-28 at 22 48 32
joshtynjala commented 5 years ago

I will rather wait for fixed version. ;)

The bug fix that I've mentioned resolves the freeze where "Initializing Actionscript & MXML language server." never goes away. You'll probably still have compiler errors after you get the update. However, maybe they will change a bit. I guess you'll need to revisit this later, after I release the next update.

joshtynjala commented 5 years ago

The vscode-as3mxml v0.17.2 update is now available. The "Initializing Actionscript & MXML language server..." freeze is now fixed.

LudvikWiejowski commented 5 years ago

great, thanks. As you predicted, I still have compiler errors, but they changed. I have no idea how to get rid of them. Maybe it's not possible for my old sdk... I removed target-player because with it I have again 8K errors.

screenshot 2019-02-01 at 22 01 06 screenshot 2019-02-01 at 22 03 02
joshtynjala commented 5 years ago

Invalid version specified, '10'.

I think this may be in reference to the target-player compiler option. Does your Flex SDK contain frameworks/libs/player/10/playerglobal.swc? The compiler chooses which location to find playerglobal.swc based on target-player. If you set target-player to something like "10.1", it will look inside frameworks/libs/player/10/.

XML does not have matching begin and end tags., etc.

It seems to think that the XML in your LoadCargoIn.mxml file is invalid. There must be some minor difference in the XML parsers used by the Flex SDK compiler and the Royale compiler that I use to power code intelligence in VSCode.

Based on the partial view of the file, I would try removing the commented out [Event] metadata to see if that makes a difference. If that doesn't work, then I'll probably need to see the complete contents of the file to make any further suggestions.

LudvikWiejowski commented 5 years ago

please see below my sdk player folder content. Each folder has its corresponding playerglobal.swc inside.

screenshot 2019-02-02 at 10 53 58

Removing comments out did not make difference.

Here is whole xmlx file. I can't make the below code looks better, sorry. I think you are right and this is related to the parsing differences between flex and royale. Thanks for your support.

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="1066" height="562" applicationComplete="init()"  
    verticalScrollPolicy="off" horizontalScrollPolicy="off" title="LoadCargo.in" visible="false" windowResize="fResize()" frameRate="12" xmlns:types="types.*">
    <mx:Script>
        <![CDATA[
            import mx.core.Application;
            import types.WStatic;
            import mx.collections.HierarchicalData;
            import mx.events.DataGridEvent;
            import types.WUndoRedo;
            import mx.core.Application;
            import mx.preloaders.Preloader;
            import mx.controls.Alert;
            import types.WReportingData;
        ]]>
    </mx:Script>
    <mx:Style>
        .myButtonStyle
        {
            skin: ClassReference("mx.skins.ProgrammaticSkin");
        }
    </mx:Style>
    <mx:HTTPService resultFormat="xml" id="checkLicence" useProxy="false" method="POST" url="{WStatic.serverURL+'licence.php'}" showBusyCursor="false" result="fCheckLicenceResult(event)" fault="fCheckLicenceFault(event)">
        <mx:request xmlns="">
            <action></action>
            <email></email>
            <pcuid></pcuid>
            <id></id>
            <info></info>
        </mx:request>
    </mx:HTTPService>
    <mx:HTTPService id="httpCargoData" resultFormat="xml" result="paramCargoDataResult(event)">
    </mx:HTTPService>
    <mx:XMLListCollection id="xmlCargoCollection" source="{cargoData.shipments.shipment[cmbSortCargoVisualShip.selectedIndex].cargo}"/> 
    <mx:Script source="scripts/CodeBlocks.as"/>
    <mx:Script source="scripts/CodeButtons.as"/>
    <mx:Script source="scripts/CodeCalc.as"/>
    <mx:Script source="scripts/CodeImport.as"/>
    <mx:Script source="scripts/CodeFile.as"/>
    <mx:Script source="scripts/CodeDragDrop.as"/>
    <mx:Script source="scripts/CodeContextMenu.as"/>
    <mx:Script source="scripts/CodeGrid.as"/>
    <mx:Script source="scripts/CodeMain.as"/>
    <mx:Script source="scripts/CodeStage.as"/>
    <mx:Script source="scripts/CodePictures.as"/>
    <mx:Script source="scripts/CodeCalcCML.as"/>
    <mx:Script source="scripts/CodeCalcCMLShifts.as"/>
    <mx:Script source="scripts/CodeCalcCMLAuto.as"/>
    <mx:Script source="scripts/CodeCalcCMLAutoTruck.as"/>
    <mx:Script source="scripts/CodeCalcCMLAutoTruckYZX_ZYX.as"/>
    <mx:Script source="scripts/CodeCalcCMLManual.as"/>
    <mx:Script source="scripts/CodeUndoRedo.as"/>
    <mx:Script source="scripts/CodeLocalization.as"/>
    <mx:Script source="scripts/CodeReporting.as"/>
    <mx:Script source="scripts/CodeCalcCMLAutoBatch.as"/>
    <mx:Script source="scripts/CodeWizard.as"/>
    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import mx.events.IndexChangedEvent;
            import types.WStatic;
            import mx.core.Application;
            import mx.events.CollectionEvent;
            import mx.events.AdvancedDataGridEvent;

        ]]>
    </mx:Script>
    <mx:Style>
        /* DragManager{
            rejectCursor: Embed(source="icons/app/i16.png");
            copyCursor: Embed(source="icons/app/i16.png");
            moveCursor: Embed(source="icons/app/i16.png");
        }  */

    </mx:Style>

    <mx:HDividedBox id="divider" x="3" y="41" width="100%" height="100%" minWidth="200">
    <mx:TabNavigator id="tbnavLeft" width="100%" height="100%" backgroundColor="#FFFC00" creationPolicy="all" cornerRadius="0" change="fNavTabLeftChange()">
        <mx:Canvas label="Add Cargo" width="100%" height="100%" id="tabAddCargo">
            <mx:Accordion x="0" y="0" width="100%" height="100%" borderStyle="none" creationPolicy="all" id="accAddCargo">
                <mx:Canvas label="Manual" width="100%" height="100%" horizontalScrollPolicy="off" id="tabManual">
                    <mx:Form x="0" y="0" width="500" height="299">
                        <mx:FormItem label="Shipment mark:" id="lblShipmentMark">
                            <mx:ComboBox id="cmbAddShipment" editable="true" cornerRadius="0" dataProvider="{cargoData.shipments.shipment}" labelField="@mark"></mx:ComboBox>
                        </mx:FormItem>
                        <mx:FormItem label="Cargo mark (optional):" id="lblCargoMark">
                            <mx:TextInput id="txCargoMark" borderStyle="solid"/>
                        </mx:FormItem>
                        <mx:FormItem label="Length ({unit_cm}):" id="lblLength">
                            <mx:TextInput text="100" width="60" height="20" borderStyle="solid" id="txLength" restrict=".0-9"/>
                        </mx:FormItem>
                        <mx:FormItem label="Width ({unit_cm}):" id="lblWidth">
                            <mx:TextInput text="100" width="60" height="20" borderStyle="solid" id="txWidth" restrict=".0-9"/>
                        </mx:FormItem>
                        <mx:FormItem label="Height ({unit_cm}):" id="lblHeight">
                            <mx:TextInput text="100" width="60" height="20" borderStyle="solid" id="txHeight" restrict=".0-9"/>
                        </mx:FormItem>
                        <mx:FormItem label="Volume ({unit_cbm}):" id="fiVolume" enabled="{txLength.text.length==0}">
                            <mx:TextInput width="60" id="txVolume" focusOut="{fCalculateLength()}" focusEnabled="false" backgroundColor="#B7BABC" restrict=".0-9"/>
                        </mx:FormItem>
                        <mx:FormItem label="Weight ({unit_kg}):" id="lblWeight">
                            <mx:TextInput text="100" width="60" height="20" borderStyle="solid" id="txWeight" restrict=".0-9"/>
                        </mx:FormItem>
                        <mx:FormItem label="Stackable:" id="lblStackable">
                            <mx:HBox width="100%">
                                <mx:CheckBox id="chkStack" selected="true"/>
                                <mx:Label text="Limit ({unit_kg}):" id="lblLimit"/>
                                <mx:TextInput width="60" height="20" borderStyle="solid" id="txStackWgt"/>
                                <mx:Label text="?" width="21" fontSize="14" id="lblEmpty" fontWeight="bold" textAlign="left"/>
                            </mx:HBox>
                        </mx:FormItem>
                        <mx:FormItem label="Quantity:" id="lblQuantity">
                            <mx:NumericStepper id="nsAddQty" cornerRadius="0" minimum="1" value="1" stepSize="1" maximum="1500"/>
                        </mx:FormItem>
                        <mx:FormItem label="Turnable:" id="fiTurnable">
                            <mx:HBox>
                                <mx:RadioButtonGroup id="rgAddTurn" selectedValue="0"/>
                                <mx:RadioButton label="No" groupName="rgAddTurn" value="0" id="rbNoManual"/>
                                <mx:RadioButton label="Only around axis Y" groupName="rgAddTurn" value="1" id="rbYManual"/>
                                <mx:RadioButton label="Yes" groupName="rgAddTurn" value="2" id="rbYesManual"/>
                            </mx:HBox>
                        </mx:FormItem>
                    </mx:Form>
                    <mx:Button overIcon="@Embed(source='icons/buttons/add_plan.png')" icon="@Embed(source='icons/buttons/add_plan_g.png')" buttonMode="true" label="Add" x="10" y="307" width="100" height="60" click="cmdAddCargo()" cornerRadius="0" labelPlacement="bottom" toolTip="Add defined cargo to plan" id="cmdAddDefinedCargoToPlan"/>
                    <mx:Button overIcon="@Embed(source='icons/buttons/qmark2.png')" icon="@Embed(source='icons/buttons/qmark2_g.png')" buttonMode="true" styleName="myButtonStyle" id="cmdShipMarkManualHelp" cornerRadius="0" width="22" toolTip="Do not enter different shipment mark for each dimension, only in case it's different shipment which must be loaded and unloaded in certain order." x="508" y="18"/>

                </mx:Canvas>
                <mx:Canvas label="Predefined" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" id="tabPredefined">
                    <mx:Button overIcon="@Embed(source='icons/buttons/add_plan.png')" icon="@Embed(source='icons/buttons/add_plan_g.png')" buttonMode="true" label="Add to Plan" y="10" width="100" height="60" click="cmdAddCargoPredef()" enabled="{dgCargoPredef.selectedIndex!=-1}" cornerRadius="0" labelPlacement="bottom" toolTip="Add selected cargo to plan" id="cmdAddSelectedCargoToPlan" textAlign="center" right="10"/>
                    <mx:ComboBox id="cmbAddShipmentPredef" editable="true" cornerRadius="0" dataProvider="{cargoData.shipments.shipment}" labelField="@mark"   x="86" y="10"></mx:ComboBox>
                    <mx:NumericStepper id="nsAddQtyPredef" cornerRadius="0" minimum="1" value="1" stepSize="1" x="86" y="40" maximum="100"/>
                    <mx:Label x="10" y="12" text="Shipment:" width="68" textAlign="right" id="lblShipment"/>
                    <mx:Label x="10" y="42" text="Quantity:" width="68" textAlign="right" id="lblQuantity2"/>
                    <mx:DataGrid x="0" y="120" height="100%" id="dgCargoPredef" dataProvider="{cargoPredefData.cargos.cargo}"
                        editable="true" selectable="true" width="100%" borderStyle="none" itemEditEnd="fCargoPredefChange(event)">
                        <mx:columns>
                            <mx:DataGridColumn headerText="Mark" dataField="mark" width="50" id="dgCargoPredefColMark"/>
                            <mx:DataGridColumn headerText="L" dataField="l" width="30" id="dgCargoPredefColL"/>
                            <mx:DataGridColumn headerText="W" dataField="w" width="30" id="dgCargoPredefColW"/>
                            <mx:DataGridColumn headerText="H" dataField="h" width="30" id="dgCargoPredefColH"/>
                            <mx:DataGridColumn headerText="Wgt" dataField="wgt" width="30" id="dgColWgt"/>
                            <mx:DataGridColumn headerText="Stack ({unit_kg})" itemRenderer="CellStackablePredef" width="100" editable="false" id="dgColStack"/>
                            <mx:DataGridColumn headerText="Turn  (No,only Y, Yes)" itemRenderer="CellTurnablePredef" width="110" editable="false" id="dgColTurn"/>
                        </mx:columns>
                    </mx:DataGrid>
                    <mx:Button overIcon="@Embed(source='icons/buttons/add.png')" icon="@Embed(source='icons/buttons/add_g.png')" buttonMode="true" styleName="myButtonStyle"  x="10" y="90" id="cmdPredefCargoAdd" click="fPredefCargoAdd()" cornerRadius="0" width="28" toolTip="Add new predefined cargo"/>
                    <mx:Button overIcon="@Embed(source='icons/buttons/delete.png')" icon="@Embed(source='icons/buttons/delete_g.png')" buttonMode="true" styleName="myButtonStyle"  x="50" y="90" click="fPredefCargoDelete()" id="cmdPredefCargoDelete" enabled="{dgCargoPredef.selectedIndex!=-1}" cornerRadius="0" width="28" toolTip="Delete selected predefined cargo"/>
                    <mx:Button buttonMode="true" styleName="myButtonStyle" toolTip="Search" cornerRadius="0" click="fSearchPredefCargoList(txtPredefSearch.text)" id="cmdPredefSearch" overIcon="@Embed(source='icons/buttons/search.png')" icon="@Embed(source='icons/buttons/search_g.png')" width="28" x="220" y="88"/>
                    <mx:TextInput width="126" borderStyle="solid" id="txtPredefSearch" x="86" y="92" keyDown="fSearchPredefCargoListKeyDown(event)"/>
                    <mx:Button overIcon="@Embed(source='icons/buttons/qmark2.png')" icon="@Embed(source='icons/buttons/qmark2_g.png')" buttonMode="true" styleName="myButtonStyle" id="cmdShipMarkPredefinedHelp" cornerRadius="0" width="22" toolTip="Do not enter different shipment mark for each dimension, only in case it's different shipment which must be loaded and unloaded in certain order." x="290" y="11"/>
                </mx:Canvas>
                <mx:Canvas label="Automatic" width="100%" height="100%" horizontalScrollPolicy="off" id="tabAutomatic">
                    <mx:ViewStack x="0" y="0" id="vsImport" width="100%" height="100%" creationPolicy="all">
                        <mx:Canvas label="View 1" width="100%" height="100%" id="vsImportGetData">
                            <mx:Button  id="cmdGetClipboard" label="Get Data from Clipboard" width="230" height="60" click="fGetClipboard()" horizontalCenter="0" y="57" cornerRadius="0" overIcon="@Embed(source='icons/buttons/clipboard.png')" icon="@Embed(source='icons/buttons/clipboard_g.png')"/>
                            <mx:Button  id="cmdPlanGetData" label="Get Data from Project" width="230" height="60" click="fGetPlan()" horizontalCenter="0" y="185" cornerRadius="0" overIcon="@Embed(source='icons/buttons/lci.png')" icon="@Embed(source='icons/buttons/lci_g.png')"/>
                            <mx:Text y="276" text="Press button and choose completed xlsx template to upload cargo data. If you don't have template yet, download one pressing download button." width="478" textAlign="center" height="36" horizontalCenter="0" id="lblTemplateText"/>
                            <mx:Text y="10" text="Copy cargo dimensions from Excel or Text Editor and press Button." width="406" textAlign="center" height="39" horizontalCenter="0" id="lblClipboardText"/>
                            <mx:Text y="151" text="Press button and choose xml project plan file." width="442" textAlign="center" height="26" horizontalCenter="0" id="lblPlanText"/>
                            <mx:Button  id="cmdGetDataXLSX" label="Get Data from Template" width="200" height="60" click="fGetXLSX()" y="315" cornerRadius="0" overIcon="@Embed(source='icons/buttons/xlsx.png')" icon="@Embed(source='icons/buttons/xlsx_g.png')" horizontalCenter="-15"/>
                            <mx:Button  id="cmdDownloadTemplate" width="30" height="60" click="fDownloadCargoDataTemplate()" y="315" cornerRadius="0" overIcon="@Embed(source='icons/buttons/download.png')" icon="@Embed(source='icons/buttons/download_g.png')" horizontalCenter="99"/>
                        </mx:Canvas>
                        <mx:Canvas label="Delimiter" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" id="vsImportDelimiter">
                            <mx:RadioButtonGroup id="rgDelimiters" selectedValue="1"/>
                            <mx:RadioButton id="semicolon" y="76" label="Semicolon" groupName="rgDelimiters" value="1" x="10"/>
                            <mx:RadioButton id="tab" y="102" label="Tab" groupName="rgDelimiters" value="2" x="10"/>
                            <mx:RadioButton id="comma" y="128" label="Comma" groupName="rgDelimiters" value="3" x="10"/>
                            <mx:RadioButton id="custom" y="154" label="Custom" groupName="rgDelimiters" click="txtCustom.setFocus()" value="4" x="10"/>
                            <mx:TextInput y="154" width="20" borderStyle="solid" id="txtCustom" toolTip="Define your delimiter here" visible="{custom.selected}" x="86"/>
                            <mx:Button id="cmdPrev" buttonMode="true" styleName="myButtonStyle" y="10" label="Prev" click="fGoTo('0')" x="10" cornerRadius="0" overIcon="@Embed(source='icons/buttons/prev.png')" icon="@Embed(source='icons/buttons/prev_g.png')"/>
                            <mx:Button id="cmdNext" buttonMode="true" styleName="myButtonStyle" y="10" label="Next" click="fGetTEXTClipboard()" x="93" cornerRadius="0" overIcon="@Embed(source='icons/buttons/next.png')" icon="@Embed(source='icons/buttons/next_g.png')" labelPlacement="left"/>
                            <mx:Label y="46" text="Choose the delimiter which your cargo dimensions list uses." width="435" fontSize="12" height="22" textAlign="left" x="10" id="lblChooseDelimiter"/>
                            <mx:TextArea y="184" width="435" height="168" id="txText" wordWrap="false" editable="true" enabled="true" x="10"/>
                            <mx:TextInput x="86" y="358" borderStyle="solid" width="81" id="txtTextFind"/>
                            <mx:TextInput x="273" y="358" borderStyle="solid" width="81" id="txtTextReplace"/>
                            <mx:Button x="362" y="358" label="Replace" id="cmdTextReplace" cornerRadius="0" click="fImportTextReplace()" width="83"/>
                            <mx:Label x="10" y="359" text="Find:" width="68" textAlign="right" id="lblFind"/>
                            <mx:Label x="177" y="359" text="Replace by:" width="88" textAlign="right" id="lblReplaceBy"/>
                        </mx:Canvas>
                        <mx:Canvas label="Grid" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" id="vsImportGrid">
                            <mx:Canvas y="40" label="Grid" width="100%" height="100%" horizontalScrollPolicy="auto" verticalScrollPolicy="auto" id="vsImportGrid2">
                            <!--<mx:VBox x="0" y="40" width="100%" height="100%" verticalGap="0" horizontalScrollPolicy="on">-->
                                <mx:DataGrid showHeaders="true" rowCount="1" width="100%" id="dgImportHeader" height="61" fontWeight="bold"  y="0"
                                     selectable="false" horizontalScrollPolicy="auto" verticalScrollPolicy="auto" headerColors="[yellow,yellow]" 
                                     columnStretch="{resizeCol(event)}" sortableColumns="false" backgroundColor="yellow" 
                                     horizontalScrollPosition="{dgImport.horizontalScrollPosition}" editable="false">

                                </mx:DataGrid>

                                <mx:DataGrid showHeaders="false" horizontalScrollPolicy="auto" verticalScrollPolicy="auto" headerColors="[yellow,yellow]" selectable="true" dataProvider="{clipXML.tr}" height="100%"
                                     sortableColumns="false" editable="true" id="dgImport" y="42" width="100%" > <!---->

                                </mx:DataGrid>
                            <!--</mx:VBox>-->
                            </mx:Canvas>
                            <mx:Button overIcon="@Embed(source='icons/buttons/next.png')" icon="@Embed(source='icons/buttons/next_g.png')" buttonMode="true" styleName="myButtonStyle" x="93" y="10" label="Next" click="fGoTo('3')" cornerRadius="0" labelPlacement="left" id="cmdNext2"/>
                            <mx:Button overIcon="@Embed(source='icons/buttons/prev.png')" icon="@Embed(source='icons/buttons/prev_g.png')" buttonMode="true" styleName="myButtonStyle" x="10" y="10" label="Prev" click="fGoTo('grid')" cornerRadius="0" id="cmdPrev2"/>
                        </mx:Canvas>
                        <mx:Canvas label="parameters" width="100%" height="100%" id="vsImportParameter" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                            <mx:Button overIcon="@Embed(source='icons/buttons/prev.png')" icon="@Embed(source='icons/buttons/prev_g.png')" buttonMode="true" styleName="myButtonStyle"  x="10" y="10" label="Prev" click="fGoTo('2')" cornerRadius="0" id="cmdPrev3"/>
                            <mx:Button overIcon="@Embed(source='icons/buttons/add_plan.png')" icon="@Embed(source='icons/buttons/add_plan_g.png')" buttonMode="true" label="Add to Plan" x="10" y="184" width="157" height="60" click="addCargoClip()" cornerRadius="0" labelPlacement="bottom" toolTip="Add cargo to plan" id="cmdAddCargoToPlan" textAlign="center"/>
                            <mx:Form x="10" y="40" width="462" height="136">
                                <mx:FormItem label="Units of imported data:" id="fiUnitsOfImportedData">
                                    <mx:toolTip>Unit the imported list uses to be converted to centimeters.</mx:toolTip>
                                    <mx:ComboBox id="cmbUnitClip" editable="false" cornerRadius="0" dataProvider="{unit_arr.item}" labelField="@label" selectedIndex="0" rowCount="6"></mx:ComboBox>
                                </mx:FormItem>
                                <mx:FormItem label="Shipment mark:" id="fiShipmentMark">
                                    <mx:ComboBox id="cmbAddShipmentClip" editable="true" cornerRadius="0" dataProvider="{cargoData.shipments.shipment}" labelField="@mark"  ></mx:ComboBox>
                                </mx:FormItem>
                                <mx:FormItem label="Stackable:" id="lblStackClip">
                                    <mx:CheckBox id="chkStackClip" selected="true"/>
                                </mx:FormItem>
                                <mx:FormItem label="Turnable:" id="fiTurnable2">
                                    <mx:HBox>
                                        <mx:RadioButtonGroup id="rgAddTurnClip" selectedValue="0"/>
                                        <mx:RadioButton label="No" groupName="rgAddTurnClip" value="0" id="rbNoAuto"/>
                                        <mx:RadioButton label="Only around axis Y" groupName="rgAddTurnClip" value="1" id="rbYAuto"/>
                                        <mx:RadioButton label="Yes" groupName="rgAddTurnClip" value="2" id="rbYesAuto"/>
                                    </mx:HBox>
                                </mx:FormItem>
                            </mx:Form>
                        </mx:Canvas>
                        <mx:Canvas label="vsImportPlan" width="100%" height="100%">
                            <mx:DataGrid x="0" y="83" width="100%" id="dgPlan" dataProvider="{cargoPlanData.shipments.shipment.cargo}" editable="true" height="100%" allowMultipleSelection="true">
                                <mx:columns>
                                    <mx:DataGridColumn headerText="" width="20" id="dgCargoPlanColSel" editable="false"/>
                                    <mx:DataGridColumn headerText="Mark" dataField="@mark" width="50" id="dgCargoPlanColMark"/>
                                    <mx:DataGridColumn headerText="L" dataField="@l" width="30" id="dgCargoPlanColL"/>
                                    <mx:DataGridColumn headerText="W" dataField="@w" width="30" id="dgCargoPlanColW"/>
                                    <mx:DataGridColumn headerText="H" dataField="@h" width="30" id="dgCargoPlanColH"/>
                                    <mx:DataGridColumn headerText="Wgt" dataField="@wgt" width="30" id="dgCargoPlanColWgt"/>
                                    <mx:DataGridColumn headerText="Stack ({unit_kg})" itemRenderer="CellStackablePlan" width="100" editable="false" id="dgCargoPlanColStack"/>
                                    <mx:DataGridColumn headerText="Turn  (No,only Y, Yes)" itemRenderer="CellTurnablePlan" width="110" editable="false" id="dgCargoPlanColTurn"/>
                                    <mx:DataGridColumn headerText="Count" dataField="@count" id="dgCargoPlanColCount"/>
                                </mx:columns>
                            </mx:DataGrid>
                            <mx:Button overIcon="@Embed(source='icons/buttons/prev.png')" icon="@Embed(source='icons/buttons/prev_g.png')" buttonMode="true" styleName="myButtonStyle"  x="10" y="10" label="Prev" click="fGoTo('0')" cornerRadius="0" id="cmdPrev4"/>
                            <mx:Button buttonMode="true" x="10" y="52" label="Select All" click="fPlanSelectAll(true)" styleName="myButtonStyle" labelPlacement="right" overIcon="@Embed(source='icons/buttons/show_all.png')" icon="@Embed(source='icons/buttons/show_all_g.png')" width="110" id="cmdPlanSelectAll"/>
                            <mx:Button overIcon="@Embed(source='icons/buttons/add_plan.png')" icon="@Embed(source='icons/buttons/add_plan_g.png')" buttonMode="true" styleName="myButtonStyle"  label="Add to Predefined Cargo" x="281" y="23" width="259" height="22" click="fPlanExport('predef')" enabled="{dgPlan.selectedIndex!=-1}" cornerRadius="0" labelPlacement="left" toolTip="Add selected cargo to plan" id="cmdPlanExportToPredef" textAlign="right"/>
                            <mx:Button overIcon="@Embed(source='icons/buttons/add_plan.png')" icon="@Embed(source='icons/buttons/add_plan_g.png')" buttonMode="true" styleName="myButtonStyle"  label="Add to Planned Cargo" x="281" y="53" width="259" height="22" click="fPlanExport('cargo')" enabled="{dgPlan.selectedIndex!=-1}" cornerRadius="0" labelPlacement="left" toolTip="Add selected cargo to plan" id="cmdPlanExportToCargo" textAlign="right"/>
                            <mx:ComboBox id="cmbAddShipmentPlan" editable="true" cornerRadius="0" dataProvider="{cargoData.shipments.shipment}" labelField="@mark"   x="204" y="53"></mx:ComboBox>
                            <mx:Label x="133" y="55" text="Shipment:" width="68" textAlign="right" id="lblShipmentPlan"/>
                        </mx:Canvas>
                    </mx:ViewStack>
                </mx:Canvas>
                <mx:Canvas label="EDI" width="100%" height="100%" id="tabEDI">
                    <mx:Button buttonMode="true" styleName="myButtonStyle" click="fGetEDI()" overIcon="@Embed(source='icons/buttons/edi.png')" icon="@Embed(source='icons/buttons/edi_g.png')" toolTip="EDI connector" right="10" bottom="10" width="29" height="24" id="cmdEDIConnector2"/>
                    <mx:DataGrid sortableColumns="false" id="dgedis" dataProvider="{ediData.edis.edi}" doubleClickEnabled="true" itemDoubleClick="fImportEDI()" left="10" top="10" right="10" bottom="42">
                        <mx:columns>
                            <mx:DataGridColumn headerText="EDI Name" dataField="name" width="100" id="dgColEdiName"/>
                            <mx:DataGridColumn headerText="Stack" width="30" textAlign="center" id="dgColEdiStack">
                                <mx:itemRenderer>
                                    <mx:Component>
                                        <mx:CheckBox selected="{XML(data).stackable=='true'}" change="{XML(data).stackable=selected}"/>
                                    </mx:Component>
                                </mx:itemRenderer>
                            </mx:DataGridColumn>
                            <mx:DataGridColumn headerText="Turn" width="50" textAlign="center" id="dgColEdiTurn">
                                <mx:itemRenderer>
                                    <mx:Component>
                                        <mx:ComboBox cornerRadius="0" selectedIndex="{XML(data).turnable}" dataProvider="{XML(this.parentDocument.xmlTurnCombo).item}" labelField="@label" change="{XML(data).turnable=selectedIndex}"/>
                                    </mx:Component>
                                </mx:itemRenderer>
                            </mx:DataGridColumn>
                            <mx:DataGridColumn headerText="Last use date" dataField="datelastuse" width="50" id="dgColEdiLastUse"/>
                            <mx:DataGridColumn headerText="Creation date" dataField="datecreation" width="50" id="dgColEdiCreation"/>
                        </mx:columns>
                    </mx:DataGrid>
                    <mx:Button label="Run" cornerRadius="0" width="87" click="fImportEDI()" left="10" bottom="10" id="cmdRun" enabled="{dgedis.selectedIndex!=-1}"/>
                </mx:Canvas>
            </mx:Accordion>
        </mx:Canvas>
        <mx:Canvas label="Add Container" width="100%" height="100%" id="tabAddContainer">
            <mx:Accordion x="0" y="0" width="100%" height="100%" borderStyle="none" id="accContainers0">
                <mx:Canvas label="Predefined Containers" width="100%" height="100%" id="accContainersPredefined0" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<!--                    <mx:DataGrid x="0" y="40" height="100%" id="dgContainersPredef0" dataProvider="{cargoPredefData.containers.container}"
                         editable="true" width="100%" borderStyle="none" change="{saveConfigFile()}">
                        <mx:columns>
                            <mx:DataGridColumn headerText="Type" dataField="mark" width="50" id="dgColType1"/>
                            <mx:DataGridColumn headerText="L" dataField="l" width="30" id="dgColL1"/>
                            <mx:DataGridColumn headerText="W" dataField="w" width="30" id="dgColW1"/>
                            <mx:DataGridColumn headerText="H" dataField="h" width="30" id="dgColH1"/>
                            <mx:DataGridColumn headerText="Wgt" dataField="wgt" width="30" id="dgColWgt1"/>
                            <mx:DataGridColumn headerText="W Door" dataField="wdoor" width="30" id="dgColWDoor1"/>
                            <mx:DataGridColumn headerText="H Door" dataField="hdoor" width="30" id="dgColHDoor1"/>
                        </mx:columns>
                    </mx:DataGrid>-->
                    <mx:DataGrid x="0" y="114" height="100%" id="dgContainersPredef" dataProvider="{cargoPredefData.containers.container}"
                         editable="false" enabled="{(rgEquipMode.selectedValue==2)}" width="100%" borderStyle="none" change="{saveConfigFile()}" itemEditEnd="fContainersPredefChange(event)" itemDoubleClick="{fPredefContainerEdit()}" doubleClickEnabled="true">
                        <mx:columns>
                            <mx:DataGridColumn headerText="Unit" dataField="unit" width="20" id="dgColUnit"/>
                            <mx:DataGridColumn headerText="Equip" dataField="equip" width="20" id="dgColEquip"/>
                            <mx:DataGridColumn headerText="Type" dataField="mark" width="80" id="dgColType2"/>
                            <mx:DataGridColumn headerText="L" dataField="l" width="20" id="dgColL2"/>
                            <mx:DataGridColumn headerText="W" dataField="w" width="20" id="dgColW2"/>
                            <mx:DataGridColumn headerText="H" dataField="h" width="20" id="dgColH2"/>
                            <mx:DataGridColumn headerText="Wgt" dataField="wgt" width="20" id="dgColWgt2"/>
                            <mx:DataGridColumn headerText="W Door" dataField="wdoor" width="20" id="dgColWDoor2"/>
                            <mx:DataGridColumn headerText="H Door" dataField="hdoor" width="20" id="dgColHDoor2"/>
                            <mx:DataGridColumn headerText="Payload" dataField="payload" width="20" id="dgColPayload1"/>
                        </mx:columns>
                    </mx:DataGrid>
                    <mx:HBox y="0" height="31" backgroundColor="#FFFC00" width="100%" x="0" horizontalGap="20" verticalAlign="middle" horizontalAlign="center">
                        <mx:RadioButtonGroup id="rgEquipMode" selectedValue="0" change="{changeEquipMode()}"/>
                        <mx:RadioButton label="Auto Container" groupName="rgEquipMode" value="0" id="rbEquipAutoCtr"/>
                        <mx:RadioButton label="Auto Trailer" groupName="rgEquipMode" value="1" id="rbEquipAutoTruck"/>
                        <mx:RadioButton label="Custom" groupName="rgEquipMode" value="2" id="rbEquipCustom"/>                       
                    </mx:HBox>
                    <mx:HBox x="10" y="43" width="276" enabled="{(rgEquipMode.selectedValue==2)}">                      
                        <mx:Button overIcon="@Embed(source='icons/buttons/add.png')" icon="@Embed(source='icons/buttons/add_g.png')" buttonMode="true" styleName="myButtonStyle" label="" toolTip="Add new predefined container" id="cmdPredefContainerAdd" click="fPredefContainerAdd()" cornerRadius="0" width="28"/>
                        <mx:Button overIcon="@Embed(source='icons/buttons/delete.png')" icon="@Embed(source='icons/buttons/delete_g.png')" buttonMode="true" styleName="myButtonStyle" label="" toolTip="Delete selected predefined container" click="fPredefContainerDelete()" id="cmdPredefContainerDelete" enabled="{dgContainersPredef.selectedIndex!=-1}" cornerRadius="0" width="28"/>
                        <mx:Button overIcon="@Embed(source='icons/buttons/settings.png')" icon="@Embed(source='icons/buttons/settings_g.png')" buttonMode="true" styleName="myButtonStyle" label="" toolTip="Edit" click="fPredefContainerEdit()" id="cmdPredefContainerEdit" enabled="{dgContainersPredef.selectedIndex!=-1}" cornerRadius="0" width="28"/>
                        <mx:Button overIcon="@Embed(source='icons/buttons/web.png')" icon="@Embed(source='icons/buttons/web_g.png')" buttonMode="true" styleName="myButtonStyle" label="" toolTip="Download equipment" click="fPredefContainerDownload()" id="cmdPredefContainerDownload" cornerRadius="0" width="28"/>
                        <mx:Button overIcon="@Embed(source='icons/buttons/convert_to_cm.png')" icon="@Embed(source='icons/buttons/convert_to_cm_g.png')" buttonMode="true" styleName="myButtonStyle" label="" toolTip="Convert all equipments to centimeters" click="fConvertEquip('cm')" id="cmdConvertCm" cornerRadius="0" width="28"/>
                        <mx:Button overIcon="@Embed(source='icons/buttons/convert_to_in.png')" icon="@Embed(source='icons/buttons/convert_to_in_g.png')" buttonMode="true" styleName="myButtonStyle" label="" toolTip="Convert all equpiments to inches" click="fConvertEquip('in')" id="cmdConvertIn" cornerRadius="0" width="28"/>

                    </mx:HBox>
                    <mx:HBox x="10" y="73" width="276" enabled="{(rgEquipMode.selectedValue==2)}">
                        <mx:Label text="Search for:" width="66" textAlign="right" id="lblSearch"/>
                        <mx:TextInput borderStyle="solid" id="txtPredefContainerSearch" keyDown="fSearchPredefContainerListKeyDown(event)" width="86"/>
                        <mx:Button buttonMode="true" styleName="myButtonStyle" toolTip="Search" cornerRadius="0" id="cmdPredefContainerSearch" click="fSearchPredefContainerList(txtPredefContainerSearch.text)" width="28" icon="@Embed(source='icons/buttons/search_g.png')" overIcon="@Embed(source='icons/buttons/search.png')"/>
                        <mx:Spacer width="15" height="10"/>

                    </mx:HBox>
                    <mx:Button overIcon="@Embed(source='icons/buttons/add_plan.png')" icon="@Embed(source='icons/buttons/add_plan_g.png')" buttonMode="true" label="Add to Plan" width="120" id="cmdAddContainerToPlan" enabled="{dgContainersPredef.selectedIndex!=-1 &amp;&amp; (rgEquipMode.selectedValue==2)}" click="cmdAddContainerPredef()" cornerRadius="0" labelPlacement="left" toolTip="Add selected container to plan" height="60" y="41" right="10"/>
                </mx:Canvas>
            </mx:Accordion>
        </mx:Canvas>
        <mx:Canvas label="Visualization" width="100%" height="100%" id="tabVisualisation" creationPolicy="all">
            <mx:Canvas height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" width="100%" id="stageContainer" creationPolicy="all">
                <mx:Canvas y="0" width="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" height="100%" id="cargoStage" backgroundColor="#FFFFFF" borderColor="#000000" backgroundAlpha="1.0">
                    <mx:Canvas x="0" y="0" width="100%" height="100%" id="container" backgroundColor="#FFFFFF" borderStyle="none" 
                        borderColor="#000000" backgroundAlpha="0.0" mouseMove="fGetBoxInfo(event)" mouseDown="fStageMouseDown(event)" mouseUp="fStageMouseUp(event)" rollOut="fStageRollOut(event)" creationPolicy="all"
                         doubleClick="fStageDoubleClick()" doubleClickEnabled="false" cornerRadius="0" rightMouseDown="fStageRightDown(event)" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                         <mx:Label x="368" y="42" width="122" text="{myLoadType}" visible="false"/>             

                        <mx:Label x="382" y="89" id="labelX" visible="{myBlocks.Count>0 &amp;&amp; myBlocks.mySelectedDraggedBox==0}" mouseOver="labelsOpaque(event)" mouseOut="labelsOpaque(event)" mouseUp="fStageMouseUp(event)"/>
                        <mx:Label x="382" y="115" id="labelY" visible="{myBlocks.Count>0 &amp;&amp; myBlocks.mySelectedDraggedBox==0}" mouseOver="labelsOpaque(event)" mouseOut="labelsOpaque(event)" mouseUp="fStageMouseUp(event)"/>
                        <mx:Label x="382" y="141" id="labelZ" visible="{myBlocks.Count>0 &amp;&amp; myBlocks.mySelectedDraggedBox==0}" mouseOver="labelsOpaque(event)" mouseOut="labelsOpaque(event)" mouseUp="fStageMouseUp(event)"/>
                        <mx:Label x="382" y="167" id="labelZ_emptiness" visible="{myBlocks.Count>0 &amp;&amp; myBlocks.mySelectedDraggedBox==0}" mouseOver="labelsOpaque(event)" mouseOut="labelsOpaque(event)" mouseUp="fStageMouseUp(event)"/>
                        <mx:Label x="382" y="193" id="labelY_emptiness" visible="{myBlocks.Count>0 &amp;&amp; myBlocks.mySelectedDraggedBox==0}" mouseOver="labelsOpaque(event)" mouseOut="labelsOpaque(event)" mouseUp="fStageMouseUp(event)"/>
                        <mx:Label x="382" y="219" id="labelX_emptiness" visible="{myBlocks.Count>0 &amp;&amp; myBlocks.mySelectedDraggedBox==0}" mouseOver="labelsOpaque(event)" mouseOut="labelsOpaque(event)" mouseUp="fStageMouseUp(event)"/>
                        <mx:Label x="10" y="128" width="487" id="labelPOG" visible="{myBlocks.Count>0 &amp;&amp; chkGravity.selected}"/>
                        <mx:Label x="10" y="148" width="487" id="labelPOG2" visible="{myBlocks.Count>0 &amp;&amp; chkGravity.selected}"/>

                    </mx:Canvas>
                    <mx:Canvas visible="{myBlocks.Count>0}" bottom="0" height="57" width="233" id="cvHsLoading" backgroundAlpha="0.7" backgroundColor="#FFFFFF" x="10">
                        <!--<mx:HSlider id="hsLoading"  dataTipFormatFunction="myDataTipFormatter" minimum="0" snapInterval="1" liveDragging="true" height="20" width="167" allowTrackClick="true" change="fHsLoadingChange(event)" x="55" y="16"/>-->
                        <mx:HSlider id="hsLoading" showDataTip="false" minimum="0" snapInterval="1" liveDragging="true" height="20" width="167" allowTrackClick="true" change="fHsLoadingChange(event)" x="55" y="16"/>                     
                        <mx:Button enabled="{hsLoading.value &lt; hsLoadingMaximum}" x="33" y="19" width="15" cornerRadius="20" height="15" click="fHsLoadingButton('next')" id="cmdHsNext"/>
                        <mx:Button enabled="{hsLoading.value &gt; 0}" x="13" y="19" width="15" cornerRadius="20" height="15" click="fHsLoadingButton('prev')" id="cmdHsPrev"/>
                        <mx:Label text="{'(' + (myBlocks.activeContainerId+1) + '/' +  (cargoData.containers.container.length()) + ') / ' + hsLoading.value + ' / ' + sumPrevBoxesLoaded + ' / ' + sumTotalBoxesLoaded}" x="55" y="0" textAlign="center" id="lblHsLoading" width="158.5"/>
                    </mx:Canvas>
                     <mx:Panel visible="{myLoadType=='Manual Load' &amp;&amp; myBlocks.Count>0}" width="39" height="191" layout="absolute" cornerRadius="0" borderThicknessLeft="5" borderThicknessRight="5" borderThicknessTop="0" borderThicknessBottom="5" headerHeight="15" id="toolbox" right="10" top="74">
                        <mx:Button click="fToolboxToggle(event)" toggle="true" x="2" y="2" cornerRadius="0" id="cmdToolUnloadBox" width="25" height="22" toolTip="{mainUnload}" icon="@Embed(source='icons/view/unload.png')"/>
                        <mx:Button click="fToolboxToggle(event)" toggle="true" x="2" y="26" cornerRadius="0" id="cmdToolXLeftBox" width="25" height="22" toolTip="{mainShiftLeft}" icon="@Embed(source='icons/view/x_left.png')"/>
                        <mx:Button click="fToolboxToggle(event)" toggle="true" x="2" y="50" cornerRadius="0" id="cmdToolXRightBox" width="25" height="22" toolTip="{mainShiftRight}" icon="@Embed(source='icons/view/x_right.png')"/>
                        <mx:Button click="fToolboxToggle(event)" toggle="true" x="2" y="74" cornerRadius="0" id="cmdToolXCenterBox" width="25" height="22" toolTip="{mainShiftCenter}" icon="@Embed(source='icons/view/x_center.png')"/>
                        <mx:Button click="fToolboxToggle(event)" toggle="true" x="2" y="98" cornerRadius="0" id="cmdToolZBackBox" width="25" height="22" toolTip="{mainShiftBack}" icon="@Embed(source='icons/view/z_back.png')"/>
                        <mx:Button click="fToolboxToggle(event)" toggle="true" x="2" y="122" cornerRadius="0" id="cmdToolZFrontBox" width="25" height="22" toolTip="{mainShiftFront}" icon="@Embed(source='icons/view/z_front.png')"/>
                        <mx:Button click="fToolboxToggle(event)" toggle="true" x="2" y="146" cornerRadius="0" id="cmdToolZCenterBox" width="25" height="22" toolTip="{mainShiftCenter}" icon="@Embed(source='icons/view/z_center.png')"/>
                     </mx:Panel>
                    <mx:TitleWindow visible="{showBoxCalculator &amp;&amp; myBlocks.Count>0}" width="212" height="164" layout="absolute" showCloseButton="true" cornerRadius="0" id="BoxCalculator" close="{showBoxCalculator=false}" right="10" bottom="65" title="Box Calculator">
                        <mx:RadioButtonGroup id="rbgAddSubstract"/>
                        <mx:RadioButton groupName="rbgAddSubstract" x="10" y="10" label="Add" selected="true" id="rbAdd"  value="add"/>
                        <mx:RadioButton groupName="rbgAddSubstract" x="93" y="10" label="Substract" id="rbSubstract" value="substract"/>
                        <mx:RadioButtonGroup id="rbgDims"/>
                        <mx:RadioButton groupName="rbgDims" x="10" y="40" label="L" toolTip="Length" selected="true" id="rbL" value="l"/>
                        <mx:RadioButton groupName="rbgDims" x="49" y="40" label="W" toolTip="Width" id="rbW" value="w"/>
                        <mx:RadioButton groupName="rbgDims" x="93" y="40" label="H" toolTip="Height" id="rbH" value="h"/>
                        <mx:Button buttonMode="true" styleName="myButtonStyle" x="158" y="98" toolTip="Clear" cornerRadius="0" click="txDisplay.text='0'" width="24" id="cmdClear" overIcon="@Embed(source='icons/buttons/clean.png')" icon="@Embed(source='icons/buttons/clean_g.png')"/>
                        <mx:TextArea x="10" y="70" width="172" height="20" editable="false" wordWrap="true" id="txDisplay" text="0"/>
                    </mx:TitleWindow>                   
                    <mx:PopUpMenuButton x="10" y="36" id="cmdView" itemClick="fChangeView(event)" label=""
                        visible="{myBlocks.Count>0}" labelField="label" cornerRadius="0" width="121">
                        <mx:dataProvider>
                            <mx:Array>
                                <mx:Object id="oTopRight" idx="TopRight" label="TopRight" icon="@Embed(source='icons/view/TopRight.png')"/>
                                <mx:Object id="oTopLeft" idx="TopLeft" label="TopLeft" icon="@Embed(source='icons/view/TopLeft.png')"/>
                                <mx:Object id="oBottomLeft" idx="BottomLeft" label="BottomLeft" icon="@Embed(source='icons/view/BottomLeft.png')"/>
                                <mx:Object id="oBottomRight" idx="BottomRight" label="BottomRight" icon="@Embed(source='icons/view/BottomRight.png')"/>
                                <mx:Object id="oFront" idx="Front" label="Front" icon="@Embed(source='icons/view/Front.png')"/>
                                <mx:Object id="oTop" idx="Top" label="Top" icon="@Embed(source='icons/view/Top.png')"/>
                                <!--<mx:Object label="Bottom" icon="@Embed(source='icons/view/Bottom.png')"/>-->
                                <mx:Object id="oLeft" idx="Left" label="Left" icon="@Embed(source='icons/view/Left.png')"/>
                                <mx:Object id="oRight" idx="Right" label="Right" icon="@Embed(source='icons/view/Right.png')"/>                                 
                            </mx:Array>
                        </mx:dataProvider>                          
                    </mx:PopUpMenuButton>
                    <mx:PopUpButton enabled="{loadProgressId==0}" x="10" y="10" id="cmdLoadType" label=""
                         width="121"  cornerRadius="0" click="fChangeLoadType(event)"><!--enabled="{loadProgressId==0}"-->
                        <mx:popUp>
                            <mx:HBox width="110" height="70" horizontalAlign="center" backgroundColor="white" 
                                backgroundAlpha="1" alpha="1" borderColor="#8a8585" borderThickness="1" borderStyle="solid" verticalScrollPolicy="off" horizontalScrollPolicy="off">
                                <mx:VBox width="99%" verticalScrollPolicy="off" horizontalScrollPolicy="off">
                                    <!--<mx:Label textAlign="left" width="100%" id="asis" text="Load as is" click="fChangeLoadType(event)" mouseOver="labelsOpaque(event)" mouseOut="labelsOpaque(event)"/>-->
                                    <mx:Label textAlign="left" width="100%" id="auto" text="Auto Load" click="fChangeLoadType(event)" mouseOver="labelsOpaque(event)" mouseOut="labelsOpaque(event)"/>
                                    <mx:Label textAlign="left" width="100%" id="manual" text="Manual Load" click="fChangeLoadType(event)" mouseOver="labelsOpaque(event)" mouseOut="labelsOpaque(event)"/>
                                    <mx:Label textAlign="left" width="100%" id="editManual" text="Edit in Manual" click="fChangeLoadType(event)"
                                        opaqueBackground="#f6ff00" visible="{Application.application.myLoadType!='Manual Load' &amp;&amp; myBlocks.Count>0}"
                                        toolTip="Copy current plan to Manual mode for editting."/>
                                </mx:VBox>
                            </mx:HBox>
                        </mx:popUp>                     
                    </mx:PopUpButton>
                    <mx:PopUpMenuButton x="134" y="10" id="cmdLoadDirection" itemClick="fChangeLoadDirection(event)" label="YXZ"
                        labelField="label" width="80" enabled="{loadProgressId==0}" cornerRadius="0" visible="{myLoadType=='Auto Load'}">
                        <mx:dataProvider> 
                            <mx:Array>
                                <mx:Object id="oYXZ" idx="YXZ" idi="0" label="YXZ" icon="@Embed(source='icons/swf/yxz.swf')"/>
                                <mx:Object id="oXZY" idx="XZY" idi="1" label="XZY" icon="@Embed(source='icons/swf/xzy.swf')"/>
                                <mx:Object id="oYZX" idx="YZX" idi="2" label="YZX" icon="@Embed(source='icons/swf/yzx.swf')"/>
                                <mx:Object id="oZYX" idx="ZYX" idi="3" label="ZYX" icon="@Embed(source='icons/swf/zyx.swf')"/>
                            </mx:Array>
                        </mx:dataProvider>
                    </mx:PopUpMenuButton>
                    <mx:Button x="213" y="10" toggle="true" cornerRadius="0" id="cmdLoadSide" width="25" height="22" fontSize="9" icon="@Embed(source='icons/view/loadside.png')" toolTip="Save as image" click="setLoadSide()"/>
                    <mx:NumericStepper x="239" y="10" width="36" cornerRadius="0" minimum="0" stepSize="1" id="nsMaxLevelId" visible="{myLoadType=='Auto Load' &amp;&amp; myLoadDirection=='XZY'}" change="fChangeMaxStackLevel()"/>
                    <mx:NumericStepper x="239" y="10" width="50" cornerRadius="0" minimum="20" stepSize="1" id="nsMaxVolume" visible="{myLoadType=='Auto Load' &amp;&amp; myLoadDirection=='YXZ'}" change="fChangeMaxVolume()" maximum="100" value="100"/>
                    <mx:PopUpMenuButton x="292" y="10" id="cmdLoadColor" itemClick="fChangeLoadColor(event)" label=""
                        labelField="label" width="128" visible="{myBlocks.Count>0}" cornerRadius="0">
                        <!--myMenu.dataProvider[myMenu.selectedIndex].label-->
                        <mx:dataProvider> 
                            <mx:Array>
                                <mx:Object id="oBoxColor" idx="Box Color" label="Box Color" icon="@Embed(source='icons/box.png')" icon_tag="box_icon"/>
                                <mx:Object id="oCargoColor" idx="Cargo Color" label="Cargo Color" icon="@Embed(source='icons/cargo.png')" icon_tag="cargo_icon"/>
                                <mx:Object id="oShipmentColor" idx="Shipment Color" label="Shipment Color" icon="@Embed(source='icons/shipment.png')" icon_tag="shipment_icon"/>   
                            </mx:Array>
                        </mx:dataProvider>                          
                    </mx:PopUpMenuButton>
                    <mx:ProgressBar visible="{loadProgressId>0}" id="loadProgressBar" label="Loading cargo..." horizontalCenter="0" verticalCenter="-15" mode="manual" themeColor="#7D7D7D"/>

                    <!--<mx:CheckBox x="266" y="40" label="Gravity" id="chkGravity_old" fontWeight="bold" visible="{myBlocks.Count>0}" click="{if(chkGravity.selected) myBlocks.getGravity(container)}"/>-->
                    <mx:Button click="fContainerViewSwitcher(event)" enabled="{myBlocks.activeContainerId>0}" visible="{cmdLoadColor.visible}" x="134" y="36" label="&lt;" cornerRadius="0" id="cmdContainerPrev" width="30" height="22" fontSize="9"/>
                    <mx:Button toggle="true" visible="{cmdLoadColor.visible}" x="163" y="36" label="..." cornerRadius="0" id="cmdContainerList" width="228" height="22"/>
                    <mx:Button click="fContainerViewSwitcher(event)" enabled="{myBlocks.activeContainerId &lt; cargoData.containers.container.length()-1}" visible="{cmdLoadColor.visible}" x="390" y="36" label="&gt;" cornerRadius="0" id="cmdContainerNext" width="30" height="22" fontSize="9"/>

                    <mx:DataGrid change="fChangeContainerView(event)"
                        id="dgcvlist" dataProvider="{cargoData.containers.container}" 
                        draggableColumns="false" rowCount="10" width="188" x="10" top="171" bottom="65" 
                        visible="{cmdLoadColor.visible &amp;&amp; cmdContainerList.selected}" alpha="0.7" sortableColumns="false">
                        <mx:columns>
                            <mx:DataGridColumn dataField="@id" headerText="Id" width="25" id="dgcvlistColId"/>
                            <mx:DataGridColumn dataField="@mark" headerText="Mark" id="dgcvlistColMark"/>
                        </mx:columns>
                    </mx:DataGrid>  

                    <mx:Label x="10" y="109" width="307" id="labelVolume" visible="{myBlocks.Count>0}"/>
                    <mx:Button visible="{myBlocks.Count>0}" click="fZoom(event)" x="423" y="36" cornerRadius="0" icon="@Embed(source='icons/zoom/ZoomIn.png')" id="cmdZoomIn" width="25" height="22"/>
                    <mx:Button visible="{myBlocks.Count>0}" click="fZoom(event)" x="447" y="36" cornerRadius="0" icon="@Embed(source='icons/zoom/ZoomOut.png')" id="cmdZoomOut" width="25" height="22"/>
                    <mx:Button toggle="true" visible="{cmdLoadColor.visible}" x="471" y="36" cornerRadius="0" id="chkGravity" width="25" height="22" toolTip="Center of Gravity" icon="@Embed(source='icons/view/gravity.png')">
                        <mx:click>{if(chkGravity.selected) myBlocks.getGravity()}</mx:click>
                    </mx:Button>
                    <mx:Button visible="{cmdLoadColor.visible}" x="495" y="36" cornerRadius="0" id="cmdOverlap" width="25" height="22" fontSize="9" icon="@Embed(source='icons/view/overlap.png')" toolTip="Box Overlapping" toggle="true" click="fOverlapChange()"/>                   
                    <!--<mx:Button visible="{cmdLoadColor.visible}" x="519" y="36" cornerRadius="0" id="cmdMarkingOverlap" width="25" height="22" fontSize="9" icon="@Embed(source='icons/view/marking_overlap.png')" toolTip="Mark overlap" toggle="true" click="fMarkingOverlapChange()"/>-->
                    <mx:PopUpMenuButton x="502" y="10" id="cmdMarking" itemClick="fShowMarks(event)" label=""
                        visible="{myBlocks.Count>0}" cornerRadius="0" width="42"  maxWidth="42">
                        <mx:dataProvider>
                            <mx:Array>
                                <mx:Object id="oNoMarking1" idx="nomarking" label="" icon="@Embed(source='icons/view/marking.png')"/>
                                <mx:Object id="o1Marking1" idx="1marking" label="" icon="@Embed(source='icons/view/marking1.png')"/>
                                <mx:Object id="oAMarking1" idx="Amarking" label="" icon="@Embed(source='icons/view/markingA.png')"/>
                                <mx:Object id="oIdMarking1" idx="Idmarking" label="" icon="@Embed(source='icons/view/markingId.png')"/>                                 
                            </mx:Array>
                        </mx:dataProvider>                      
                    </mx:PopUpMenuButton>
                    <mx:Button visible="{cmdLoadColor.visible}" x="543" y="10" cornerRadius="0" id="cmdMarkingLine" width="25" height="22" fontSize="9" icon="@Embed(source='icons/view/markingLine.png')" toolTip="Info lines" toggle="true" click="fInfoLineChange()"/>

                    <mx:Button click="fExport()" visible="{cmdLoadColor.visible}" cornerRadius="0" id="cmdExport" width="100" height="47" fontSize="9" icon="@Embed(source='icons/buttons/expdata.png')" toolTip="Export" label="Export" labelPlacement="bottom" bottom="10" right="9"/>
                    <mx:Button visible="{cmdLoadColor.visible}" cornerRadius="0" id="cmdPallets" width="100" height="47" fontSize="9" icon="@Embed(source='icons/view/pallet.png')" toolTip="Load as pallets" click="fLoadAsPallets(event)" label="Load as pallets" labelPlacement="bottom" bottom="10" right="114"/>
                    <mx:Button visible="{isLoaded(cmdLoadColor.visible)}" x="447" y="10" cornerRadius="0" id="cmdCamera" width="25" height="22" fontSize="9" icon="@Embed(source='icons/view/camera.png')" toolTip="Take a snapshot" click="takePicture()"/>
                    <mx:Button visible="{isLoaded(cmdLoadColor.visible)}" x="423" y="10" cornerRadius="0" id="cmdSavePicture" width="25" height="22" fontSize="9" icon="@Embed(source='icons/view/save_picture.png')" toolTip="Save as image" click="savePicture()"/>
                    <mx:Button click="showBoxCalculator=(!showBoxCalculator)" visible="{cmdLoadColor.visible}" x="471" y="10" cornerRadius="0" id="cmdCalc" width="25" height="22" fontSize="9" icon="@Embed(source='icons/buttons/calc.png')" toolTip="Box calculator"/>
                    <!--<mx:Button visible="{cmdContainerView.visible}" x="361" y="40" cornerRadius="0" id="cmdCameraMng" width="25" height="22" fontSize="9" icon="@Embed(source='icons/view/camera_mng.png')" toolTip="Picture manager"/>-->                  
                    <mx:Label x="10" y="71" text="Wgt:" width="166.5" id="labelWgt" visible="{myBlocks.Count>0}"/>
                    <mx:Label x="10" y="90" htmlText="{'&lt;b>'+mainPayload+':&lt;/b> '+cargoData.containers.container[myBlocks.activeContainerId].@payload}" width="204.5" id="labelPayload" visible="{myBlocks.Count>0}"/>                        

                </mx:Canvas>
            </mx:Canvas>
        </mx:Canvas>
    </mx:TabNavigator>
    <mx:TabNavigator width="473" height="100%" backgroundColor="#FFFC00" creationPolicy="all" id="tnCargo" change="cargoTabChange(event)">
        <mx:Canvas label="Cargo" width="100%" height="100%" id="tabCargo" borderStyle="none">
            <mx:Accordion x="0" y="0" width="100%" height="100%" borderStyle="none" id="accCargo" creationPolicy="all" headerRenderer="AccCargoHeaderRenderer">
                <mx:Canvas label="Planned Cargo" width="100%" height="100%" id="accCargoCurrent" verticalScrollPolicy="off" horizontalScrollPolicy="off">
                    <mx:AdvancedDataGrid horizontalScrollPolicy="auto"  x="0" openDuration="120" iconFunction="setIcons" id="dgCargo" editable="true"  
                        sortableColumns="true" sortExpertMode="true" dataProvider="{cargoHierarchy}" designViewDataType="tree" width="100%" 
                        borderStyle="none" dragMoveEnabled="false" dragEnabled="false" dropEnabled="false" 
                        itemEditEnd="gridChangeQty(event)" selectionMode="multipleRows" itemRollOver="fItemRollOver(event)" rightMouseDown="fRightClick(event)"
                        dragDrop="onDragDrop(event)" dataChange="{Alert.show('done change')}"
                        dragEnter="onDragEnter(event)" dragOver="onDragOver(event)" headerRelease="fCargoHeaderRelease(event)"
                        dragComplete="onDragComplete(event)" itemClick="setCargoDetail(event)" draggableColumns="false" 
                        itemEditBegin="{isChangingDataGrid=true}" itemEditBeginning="disableEditing(event)" height="{canvasCargoDetail.y}" y="0">
                        <!--change="{isSavedFile=false}" displayItemsExpanded="true"-->
                        <mx:columns>
                            <mx:AdvancedDataGridColumn headerText="Shipment" dataField="@id" width="110" editable="{dgCargo.selectedItem.name()=='box'}" id="dgCargoColShipment"/>
                            <mx:AdvancedDataGridColumn headerText="Action" editable="false" sortable="false" itemRenderer="CellButtons" width="85" headerWordWrap="true" resizable="false" id="dgCargoColAction"/>
                            <mx:AdvancedDataGridColumn headerText="i" editable="false" itemRenderer="CellAlert" width="6" resizable="false" id="dgCargoColI"/>
                            <mx:AdvancedDataGridColumn headerText="Summary" editable="false" dataField="@summary" width="200" visible="{chkSummary.selected}" id="dgCargoColSummary"/>                          
                            <mx:AdvancedDataGridColumn headerText="Mark" dataField="@mark" width="80" id="dgCargoColMark"/>
                            <mx:AdvancedDataGridColumn headerText="M" dataField="@manual" width="30" visible="{chkManual.selected}" id="dgCargoColM"/>
                            <mx:AdvancedDataGridColumn headerText="A" dataField="@auto" width="30" visible="{chkManual.selected}" id="dgCargoColA"/>
                            <mx:AdvancedDataGridColumn sortCompareFunction="{numericSorter('ctr')}" headerText="Ctr" dataField="@ctr" width="30" editable="false" visible="{myLoadType=='Manual Load'}" id="dgCargoColCtr1"/>
                            <mx:AdvancedDataGridColumn sortCompareFunction="{numericSorter('ctr_auto')}" headerText="Ctr" dataField="@ctr_auto" width="30" editable="false" visible="{myLoadType!='Manual Load'}" id="dgCargoColCtr2"/>
                            <mx:AdvancedDataGridColumn sortCompareFunction="{numericSorter('qty')}" headerText="Qty" dataField="@qty" width="30" editable="{dgCargo.selectedItem.name()=='cargo'}" id="dgCargoColQty"/>                         
                            <mx:AdvancedDataGridColumn sortCompareFunction="{numericSorter('l')}" headerText="L" dataField="@l" editorDataField="text" width="40" editable="{dgCargo.selectedItem.name()=='cargo'}" id="dgCargoColL">
                                <mx:itemRenderer>                           
                                    <mx:Component>
                                        <mx:Text text="{XML(data).@l}" fontSize="{XML(data).@icon=='cargo_icon' || parentDocument.myLoadType=='Manual Load'?10:0}" color="{XML(data).@icon=='cargo_icon' || parentDocument.myLoadType=='Manual Load'?0x000000:0xFFFFFF}"/>
                                    </mx:Component>
                                </mx:itemRenderer>
                                <mx:itemEditor>
                                    <mx:Component>
                                        <mx:TextInput  />
                                    </mx:Component>                                 
                                </mx:itemEditor>
                            </mx:AdvancedDataGridColumn>
                            <mx:AdvancedDataGridColumn sortCompareFunction="{numericSorter('w')}" headerText="W" dataField="@w" editorDataField="text" width="40" editable="{dgCargo.selectedItem.name()=='cargo'}" id="dgCargoColW">
                                <mx:itemRenderer>                           
                                    <mx:Component>
                                        <mx:Text text="{XML(data).@w}" fontSize="{XML(data).@icon=='cargo_icon' || parentDocument.myLoadType=='Manual Load'?10:0}" color="{XML(data).@icon=='cargo_icon' || parentDocument.myLoadType=='Manual Load'?0x000000:0xFFFFFF}"/>
                                    </mx:Component>
                                </mx:itemRenderer>
                                <mx:itemEditor>
                                    <mx:Component>
                                        <mx:TextInput  />
                                    </mx:Component>                                 
                                </mx:itemEditor>                                
                            </mx:AdvancedDataGridColumn>
                            <mx:AdvancedDataGridColumn sortCompareFunction="{numericSorter('h')}"  headerText="H" dataField="@h" editorDataField="text" width="40" editable="{dgCargo.selectedItem.name()=='cargo'}" id="dgCargoColH">
                                <mx:itemRenderer>                           
                                    <mx:Component>
                                        <mx:Text text="{XML(data).@h}" fontSize="{XML(data).@icon=='cargo_icon' || parentDocument.myLoadType=='Manual Load'?10:0}" color="{XML(data).@icon=='cargo_icon' || parentDocument.myLoadType=='Manual Load'?0x000000:0xFFFFFF}"/>
                                    </mx:Component>
                                </mx:itemRenderer>
                                <mx:itemEditor>
                                    <mx:Component>
                                        <mx:TextInput  />
                                    </mx:Component>                                 
                                </mx:itemEditor>                                
                            </mx:AdvancedDataGridColumn>
                            <mx:AdvancedDataGridColumn sortCompareFunction="{numericSorter('wgt')}" headerText="Wgt" dataField="@wgt" width="40" editable="{dgCargo.selectedItem.name()=='cargo'}" id="dgCargoColWgt"/>                         
                            <mx:AdvancedDataGridColumn dataField="@stackable" headerText="Stack ({unit_kg})" itemRenderer="CellStackable" editable="false" width="160" id="dgCargoColStack"/>
                            <mx:AdvancedDataGridColumn dataField="@turnable" headerText="Turn (No,Y,Yes)" editable="false" itemRenderer="CellTurnable" width="105" headerWordWrap="true" resizable="false" id="dgCargoColTurn"/>
                            <mx:AdvancedDataGridColumn dataField="@group" headerText="Group" editable="false" itemRenderer="CellGroup" width="100" id="dgCargoColGroup" visible="{myLoadType=='Auto Load'}"/>
                            <mx:AdvancedDataGridColumn dataField="@cl" headerText="Color" editable="false" itemRenderer="CellColor" width="45" id="dgCargoColColor"/>
                            <mx:AdvancedDataGridColumn headerText="Sel" editable="false" width="5" minWidth="0" sortable="false"/>
                        </mx:columns>
                    </mx:AdvancedDataGrid>
                    <mx:Canvas x="0" width="100%" height="150" id="canvasCargoDetail" horizontalScrollPolicy="off" verticalScrollPolicy="off" creationPolicy="all" bottom="0">
                        <mx:Button x="0" y="0" label="Box details" cornerRadius="0" textAlign="left" width="100%" height="20" id="cmdCargoDetail" click="fCargoDetail()" fillAlphas="[1.0, 1.0]" fillColors="[#FEFF9C, #F0FF00]"/>
                        <mx:Canvas x="10" y="28" width="112" height="112" borderStyle="solid" id="cargoDetailThumbnail" buttonMode="true">
                        </mx:Canvas>
                        <mx:VBox x="130" y="28" height="112" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Ship. mark:" textAlign="right" width="72" id="lblDetailShipMark"/>
                                <mx:Label id="lbl_cd_shipmark" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Box mark:" textAlign="right" width="72" id="lblDetailBoxMark"/>
                                <mx:Label id="lbl_cd_boxmark" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Box id:" textAlign="right" width="72" id="lblDetailBoxId"/>
                                <mx:Label id="lbl_cd_boxid" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Container:" textAlign="right" width="72" id="lblDetailContainer"/>
                                <mx:Label id="lbl_cd_ctr" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Quantity:" textAlign="right" width="72" id="lblDetailQuantity"/>
                                <mx:Label id="lbl_cd_qty" fontWeight="bold"/>
                            </mx:HBox>
                        </mx:VBox>
                        <mx:VBox x="320" y="28" height="112" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                            <mx:HBox width="202" horizontalScrollPolicy="off">
                                <mx:Label text="L x W x H:" textAlign="right" width="72" id="lblDetailLWH"/>
                                <mx:Label id="lbl_cd_dims" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Weight:" textAlign="right" width="72" id="lblDetailWeight"/>
                                <mx:Label id="lbl_cd_wgt" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Total Wgt:" textAlign="right" width="72" id="lblDetailTotalWgt"/>
                                <mx:Label id="lbl_cd_wgttotal" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Volume:" textAlign="right" width="72" id="lblDetailVolume"/>
                                <mx:Label id="lbl_cd_vol" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Total Vol:" textAlign="right" width="72" id="lblDetailTotalVol"/>
                                <mx:Label id="lbl_cd_voltotal" fontWeight="bold"/>
                            </mx:HBox>
                        </mx:VBox>
                        <mx:VBox x="530" y="28" height="112" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="X x Y x Z:" textAlign="right" width="72" id="lblDetailXYZ"/>
                                <mx:Label id="lbl_cd_position" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Stackable:" textAlign="right" width="72" id="lblDetailStackable"/>
                                <mx:Label id="lbl_cd_stack" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Stack. limit:" textAlign="right" width="72" id="lblDetailStackLimit"/>
                                <mx:Label id="lbl_cd_stacklimit" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Turnable:" textAlign="right" width="72" id="lblDetailTurnable"/>
                                <mx:Label id="lbl_cd_turn" fontWeight="bold"/>
                            </mx:HBox>
                            <mx:HBox width="182" horizontalScrollPolicy="off">
                                <mx:Label text="Fixed turn:" textAlign="right" width="72" id="lblDetailFixedTurn"/>
                                <mx:Label id="lbl_cd_turnfixed" fontWeight="bold"/>
                            </mx:HBox>
                        </mx:VBox>                      
                    </mx:Canvas>
                </mx:Canvas>
                <mx:Canvas id="plannedCargoVisual" label="Planned Cargo Visual" width="100%" height="100%" backgroundColor="#FFFC00">
                    <mx:TileList x="0" id="tileCargoList" width="100%" top="0" dataProvider="{xmlCargoCollection}" itemRenderer="myCargoThumbnail" creationComplete="fSortCargoVisual()" rowHeight="206" columnWidth="122" bottom="30"></mx:TileList>
                    <mx:RadioButtonGroup id="rbgSortCargoVisual" selectedValue="dsc" change="fSortCargoVisual()"/>
                    <mx:HBox x="0" width="100%" height="32" verticalAlign="middle" backgroundColor="#FFFC00" bottom="0" borderStyle="solid">
                        <!--<mx:Label text="Deck:" width="42" textAlign="right"/>
                        <mx:ComboBox cornerRadius="0" width="89" id="cmbDeck" dataProvider="{DDTrailerArray}" labelField="id" editable="false" change="fDeckChange()">
                        </mx:ComboBox>-->
                        <mx:Label text="Sort:" width="42" textAlign="right"/>
                        <mx:ComboBox cornerRadius="0" width="89" id="cmbSortCargoVisualShip" dataProvider="{cargoData.shipments.shipment}" labelField="@mark" editable="false" change="fSortCargoVisual()">
                        </mx:ComboBox>
                        <mx:ComboBox cornerRadius="0" width="89" id="cmbSortCargoVisual" labelField="name" editable="false" change="fSortCargoVisual()">
                            <mx:dataProvider>
                                <mx:Array>
                                    <mx:Object id="oSortVolume" name="Volume" value="@vol"/>
                                    <mx:Object id="oSortWeight" name="Weight" value="@wgt"/>
                                    <mx:Object id="oSortLength" name="Length" value="@l"/>
                                    <mx:Object id="oSortWidth" name="Width" value="@w"/>
                                    <mx:Object id="oSortHeight" name="Height" value="@h"/>
                                </mx:Array>
                            </mx:dataProvider>
                        </mx:ComboBox>
                        <mx:RadioButton label="Asc" groupName="rbgSortCargoVisual" value="asc"/>
                        <mx:RadioButton label="Desc" groupName="rbgSortCargoVisual" value="dsc"/>
                        <mx:Button label="Unload Container" cornerRadius="0" id="cmdUnloadAll" click="fUnloadAll()"/>
                    </mx:HBox>
                </mx:Canvas>
            </mx:Accordion>
        </mx:Canvas>
        <mx:Canvas label="Containers" width="100%" height="100%" id="tabContainers">
            <mx:Accordion x="0" y="0" width="100%" height="100%" borderStyle="none" id="accContainers" headerRenderer="AccHeaderRenderer" headerHeight="23">
                <mx:Canvas label="Planned Containers" width="100%" height="100%" id="accContainersCurrent">
                    <mx:DataGrid x="0" y="0" height="100%" id="dgContainers" dataProvider="{cargoData.containers.container}" 
                        width="100%" borderStyle="none" itemRollOver="fContItemRollOver(event)" editable="true" change="fContainersChange(event)"
                        itemEditEnd="fContainersEditEnd(event)" itemEditBegin="fContainersEditBegin(event)" itemEditBeginning="fContainersEditBeginning(event)">
                        <mx:columns>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('id')}" headerText="ID" dataField="@id" width="20" editable="false" id="dgColId"/>
                            <mx:DataGridColumn sortable="false" headerText="Action" editable="false" itemRenderer="CellButtonsCont" width="200" resizable="false" id="dgColAction"/>
                            <mx:DataGridColumn headerText="Type" dataField="@mark" width="50" editable="true" id="dgColType3"/>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('l')}" headerText="L" dataField="@l" width="50" id="dgColL3"/>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('w')}" headerText="W" dataField="@w" width="50" id="dgColW3"/>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('w2')}" headerText="W2" dataField="@w2" width="50" id="dgColW2_3"/>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('h')}" headerText="H" dataField="@h" width="50" id="dgColH3"/>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('h2')}" headerText="H2" dataField="@h2" width="50" id="dgColH2_3"/>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('wgt')}" headerText="Wgt" dataField="@wgt" width="50" id="dgColWgt3"/>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('wdoor')}" headerText="W Door" dataField="@wdoor" width="30" id="dgColWDoor3"/>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('hdoor')}" headerText="H Door" dataField="@hdoor" width="30" id="dgColHDoor3"/>
                            <mx:DataGridColumn sortCompareFunction="{numericSorter('payload')}" headerText="Payload" dataField="@payload" width="40" editable="true" id="dgColPayload2"/>
                            <mx:DataGridColumn headerText="Truck license/Container seal no." dataField="@number" width="50" editable="true" id="dgColNumber"/>
                        </mx:columns>
                    </mx:DataGrid>

                </mx:Canvas>
            </mx:Accordion>
        </mx:Canvas>
        <mx:Canvas label="Views" width="100%" height="100%" enabled="{setPictureTabVisibility(cmdLoadColor.visible)}" id="tabViews">
            <mx:Accordion x="0" y="0" width="100%" height="100%" borderStyle="none" id="accPicture">
                <mx:Canvas label="Stored Views" width="100%" height="100%" id="accPictures" verticalScrollPolicy="off" horizontalScrollPolicy="off">
                    <mx:DataGrid horizontalScrollPolicy="auto" minWidth="500" x="0" y="0" id="dgPictures" editable="false"  
                        sortableColumns="true" dataProvider="{cargoData.pictures.picture.(@mode==myLoadType)}" width="100%" height="100%" 
                        borderStyle="none" headerRelease="{onHeaderRelease(event)}"
                        itemRollOver="fPictItemRollOver(event)" draggableColumns="false"
                        change="{isSavedFile=false}">
                        <mx:columns>
                            <mx:DataGridColumn headerText="id" dataField="@id" width="30" id="dgPicsColId"/>
                            <mx:DataGridColumn headerText="Mode" dataField="@mode" width="100" editable="false" id="dgPicsColMode"/>
                            <mx:DataGridColumn headerText="Action" editable="false" itemRenderer="CellButtonsPict" width="85" headerWordWrap="true" resizable="false" id="dgPicsColAction"/>
                            <mx:DataGridColumn headerText="Ctr" editable="false" dataField="@ctr" width="50" id="dgPicsColCtr"/>                            
                            <mx:DataGridColumn headerText="Color" dataField="@color" width="150" id="dgPicsColColor"/>
                            <mx:DataGridColumn headerText=""/>
                        </mx:columns>
                    </mx:DataGrid>
                </mx:Canvas>
            </mx:Accordion>
        </mx:Canvas>
        <mx:Canvas label="Reporting" width="100%" height="100%" id="tabReporting">
            <mx:DataGrid showHeaders="false" width="100%" id="dgReportingHeader" height="22" x="0" top="0"
                     selectable="false" sortableColumns="false" dataProvider="{xmlReportingHeader}" itemEditEnd="repHeaderChange(event)"
                     horizontalScrollPosition="{dgReporting.horizontalScrollPosition}" editable="true" alternatingItemColors="[#FFFFFF, #FFFFFF]">
                <mx:columns>
                    <mx:DataGridColumn headerText="Box id" dataField="id"/>
                    <mx:DataGridColumn headerText="Mark" dataField="mark"/>
                    <mx:DataGridColumn headerText="Ship id" dataField="ship_id"/>
                    <mx:DataGridColumn headerText="Ctr" dataField="ctr"/>
                    <mx:DataGridColumn headerText="L" dataField="l"/>
                    <mx:DataGridColumn headerText="W" dataField="w"/>
                    <mx:DataGridColumn headerText="H" dataField="h"/>
                    <mx:DataGridColumn headerText="Wgt" dataField="wgt"/>
                    <mx:DataGridColumn headerText="Stack" dataField="stack" editable="false">
                        <mx:itemRenderer>
                            <mx:Component>
                                <mx:ComboBox  borderColor="white" fillColors="[white,white]" selectedIndex="{parentDocument.getReportingComboValue(XML(data).stack)}" labelField="name" cornerRadius="0" change="{XML(data).stack=this.selectedItem.value}">
                                    <mx:dataProvider>
                                        <mx:Array>
                                            <mx:Object name="{this.parentDocument.turnNo}" value="0"/>
                                            <mx:Object name="{this.parentDocument.turnYes}" value="1"/>
                                            <mx:Object name="-" value=""/>
                                        </mx:Array>
                                    </mx:dataProvider>                                  
                                </mx:ComboBox>
                            </mx:Component>
                        </mx:itemRenderer>
                    </mx:DataGridColumn>

                    <mx:DataGridColumn headerText="Priority" dataField="group_id"/>
                    <mx:DataGridColumn headerText="Group" dataField="group_sel" editable="false">
                        <mx:itemRenderer>
                            <mx:Component>
                                <!--themeColor="white"-->
                                <mx:ComboBox borderColor="white" fillColors="[white,white]" selectedIndex="{parentDocument.getReportingComboValue(XML(data).group_sel)}" labelField="name" cornerRadius="0" change="{XML(data).group_sel=this.selectedItem.value}">
                                    <mx:dataProvider>
                                        <mx:Array>
                                            <mx:Object name="{this.parentDocument.turnNo}" value="0"/>
                                            <mx:Object name="{this.parentDocument.turnYes}" value="1"/>
                                            <mx:Object name="-" value=""/>
                                        </mx:Array>
                                    </mx:dataProvider>                                  
                                </mx:ComboBox>
                            </mx:Component>
                        </mx:itemRenderer>
                    </mx:DataGridColumn>
                    <mx:DataGridColumn headerText="Floor" dataField="flooronly" editable="false">
                        <mx:itemRenderer>
                            <mx:Component>
                                <!--themeColor="white"-->
                                <mx:ComboBox borderColor="white" fillColors="[white,white]" selectedIndex="{parentDocument.getReportingComboValue(XML(data).flooronly)}" labelField="name" cornerRadius="0" change="{XML(data).flooronly=this.selectedItem.value}">
                                    <mx:dataProvider>
                                        <mx:Array>
                                            <mx:Object name="{this.parentDocument.turnNo}" value="0"/>
                                            <mx:Object name="{this.parentDocument.turnYes}" value="1"/>
                                            <mx:Object name="-" value=""/>
                                        </mx:Array>
                                    </mx:dataProvider>                                  
                                </mx:ComboBox>
                            </mx:Component>
                        </mx:itemRenderer>                      
                    </mx:DataGridColumn>
                    <mx:DataGridColumn headerText="Alert" dataField="alert"/>
                </mx:columns>               
            </mx:DataGrid>

<!--            <mx:DataGrid id="dgReporting2" columnStretch="{resizeReportingCol(event)}" x="0" width="100%" dataProvider="{sorted_arr_reporting}" editable="false" bottom="0" top="283">
                <mx:columns>
                    <mx:DataGridColumn headerText="Box id" dataField="id"/>
                    <mx:DataGridColumn headerText="Mark" dataField="mark"/>
                    <mx:DataGridColumn headerText="Ship id" dataField="ship_id"/>
                    <mx:DataGridColumn headerText="Ctr" dataField="ctr"/>
                    <mx:DataGridColumn headerText="L" dataField="l"/>
                    <mx:DataGridColumn headerText="W" dataField="w"/>
                    <mx:DataGridColumn headerText="H" dataField="h"/>
                    <mx:DataGridColumn headerText="Wgt" dataField="wgt"/>
                    <mx:DataGridColumn headerText="Stack" dataField="stack">
                        <mx:itemRenderer>
                            <mx:Component>
                                <mx:CheckBox textAlign="center" selected="{data.stack=='1'}" enabled="false"/>
                            </mx:Component>
                        </mx:itemRenderer>                  
                    </mx:DataGridColumn>
                    <mx:DataGridColumn headerText="Priority" dataField="group_id"/>
                    <mx:DataGridColumn headerText="Group" dataField="group_sel">
                        <mx:itemRenderer>
                            <mx:Component>
                                <mx:CheckBox textAlign="center" selected="{data.group_sel=='1'}" enabled="false"/>
                            </mx:Component>
                        </mx:itemRenderer>      
                    </mx:DataGridColumn>
                </mx:columns>
            </mx:DataGrid>-->
            <mx:Button toolTip="Search" buttonMode="true" styleName="myButtonStyle" id="cmdReportingFilter" click="filterReport()" overIcon="@Embed(source='icons/buttons/search.png')" icon="@Embed(source='icons/buttons/search_g.png')" width="24" x="10" y="23" height="24"/>
            <mx:Button toolTip="Clear" buttonMode="true" styleName="myButtonStyle" x="42" y="23" cornerRadius="0" click="reportingFilterClear()" width="24" id="cmdReportingClear" overIcon="@Embed(source='icons/buttons/clean.png')" icon="@Embed(source='icons/buttons/clean_g.png')" height="24"/>
            <mx:Button toolTip="PDF" buttonMode="true" styleName="myButtonStyle" y="23" cornerRadius="0" click="fSaveReporting()" width="24" id="cmdReportingPDF" overIcon="@Embed(source='icons/buttons/pdf.png')" icon="@Embed(source='icons/buttons/pdf_g.png')" height="24" right="10"/>
            <mx:AdvancedDataGrid columnStretch="{resizeReportingCol(event)}" x="0" y="50" id="dgReporting" designViewDataType="flat" width="100%" height="100%" dataProvider="{sorted_arr_reporting}" editable="false">
                <mx:columns>
                    <mx:AdvancedDataGridColumn id="dgReportingColBoxId" headerText="Box id" dataField="id"/>
                    <mx:AdvancedDataGridColumn id="dgReportingColMark" headerText="Mark" dataField="mark"/>
                    <mx:AdvancedDataGridColumn id="dgReportingColShipId" headerText="Ship id" dataField="ship_id"/>
                    <mx:AdvancedDataGridColumn id="dgReportingColCtr" headerText="Ctr" dataField="ctr"/>
                    <mx:AdvancedDataGridColumn id="dgReportingColL" headerText="L" dataField="l"/>
                    <mx:AdvancedDataGridColumn id="dgReportingColW" headerText="W" dataField="w"/>
                    <mx:AdvancedDataGridColumn id="dgReportingColH" headerText="H" dataField="h"/>
                    <mx:AdvancedDataGridColumn id="dgReportingColWgt" headerText="Wgt" dataField="wgt"/>
                    <mx:AdvancedDataGridColumn id="dgReportingColStack" headerText="Stack" dataField="stack">
                        <mx:itemRenderer>
                            <mx:Component>
                                <mx:CheckBox textAlign="center" selected="{(data).stack=='1'}" enabled="false"/>
                            </mx:Component>
                        </mx:itemRenderer>                  
                    </mx:AdvancedDataGridColumn>
                    <mx:AdvancedDataGridColumn id="dgReportingColPriority" headerText="Priority" dataField="group_id"/>
                    <mx:AdvancedDataGridColumn id="dgReportingColGroup" headerText="Group" dataField="group_sel">
                        <mx:itemRenderer>
                            <mx:Component>
                                <mx:CheckBox textAlign="center" selected="{data.group_sel=='1'}" enabled="false"/>
                            </mx:Component>
                        </mx:itemRenderer>      
                    </mx:AdvancedDataGridColumn>
                    <mx:AdvancedDataGridColumn id="dgReportingColFlooronly" headerText="Floor" dataField="flooronly">
                        <mx:itemRenderer>
                            <mx:Component>
                                <mx:CheckBox textAlign="center" selected="{data.flooronly=='1'}" enabled="false"/>
                            </mx:Component>
                        </mx:itemRenderer>      
                    </mx:AdvancedDataGridColumn>
                    <mx:AdvancedDataGridColumn id="dgReportingColAlert" headerText="Alert" dataField="alert"/>
                </mx:columns>
            </mx:AdvancedDataGrid>
        </mx:Canvas>
        <mx:Canvas label="Log" width="100%" height="100%" id="tabLog" >
            <mx:TextArea editable="false" width="100%" id="txLog" left="0" bottom="40" top="0" wordWrap="true"/>
            <mx:Button label="Copy to Clipboard" cornerRadius="0" id="cmdLogClipboard" width="144" bottom="10" left="10" click="fLogCopy()"/>
            <mx:CheckBox label="Log progress" left="162" bottom="10" width="231" toolTip="Log progress will slow done loading performance." id="chkLogProgress"/>
        </mx:Canvas>
        <mx:Canvas label="Help" width="100%" height="100%" alpha="1.0" backgroundColor="white" id="tabHelp">
            <mx:HTML left="10" top="10" right="10" bottom="43" location="help/index.html" id="htmlHelp" locationChange="fHelpChange()" click="fHelpChange()"/>
            <mx:Button buttonMode="true" styleName="myButtonStyle" toolTip="Back" cornerRadius="0" bottom="10" left="10" click="fHelpBack()" id="cmdHelpBack" overIcon="@Embed(source='icons/buttons/prev.png')" icon="@Embed(source='icons/buttons/prev_g.png')" width="28"/>
            <mx:Button buttonMode="true" styleName="myButtonStyle" toolTip="Forward" cornerRadius="0" bottom="10" left="46" click="fHelpForward()" id="cmdHelpForward" overIcon="@Embed(source='icons/buttons/next.png')" icon="@Embed(source='icons/buttons/next_g.png')" width="28"/>
            <mx:Button buttonMode="true" styleName="myButtonStyle" toolTip="Search" cornerRadius="0" bottom="8" left="216" click="fHelpSearch()" id="cmdHelpSearch" enabled="{txtHelpSearch.text.length>0}" overIcon="@Embed(source='icons/buttons/search.png')" icon="@Embed(source='icons/buttons/search_g.png')" width="28"/>
            <mx:Button buttonMode="true" styleName="myButtonStyle" click="fQuickStartGuide()" width="28" overIcon="@Embed(source='icons/buttons/help.png')" icon="@Embed(source='icons/buttons/help_g.png')" toolTip="Quick start guide" id="cmdQuickStartGuide" left="276" bottom="10"/>
            <mx:TextInput width="126" borderStyle="solid" bottom="10" left="82" id="txtHelpSearch"/>
        </mx:Canvas>
    </mx:TabNavigator>
    </mx:HDividedBox>
    <mx:ApplicationControlBar x="0" y="0" width="100%" cornerRadius="0">
        <mx:Button buttonMode="true" styleName="myButtonStyle" id="cmdNewFile" click="fNewFile()" overIcon="@Embed(source='icons/buttons/new.png')" icon="@Embed(source='icons/buttons/new_g.png')" width="28" toolTip="New"/>
        <mx:Button buttonMode="true" id="cmdOpen" click="fOpenFile()" styleName="myButtonStyle" overIcon="@Embed(source='icons/buttons/open.png')" icon="@Embed(source='icons/buttons/open_g.png')" width="28" toolTip="Open"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" id="cmdSave" click="fSaveFile()" enabled="{isSavedFile==false}" overIcon="@Embed(source='icons/buttons/save.png')" icon="@Embed(source='icons/buttons/save_g.png')" disabledIcon="@Embed(source='icons/buttons/save_d.png')" width="28" toolTip="Save"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" id="cmdSaveAs" click="fSaveFileAs()" overIcon="@Embed(source='icons/buttons/save_as.png')" icon="@Embed(source='icons/buttons/save_as_g.png')" disabledIcon="@Embed(source='icons/buttons/save_as_g.png')" width="28" toolTip="Save as"/>
        <mx:Spacer width="20" height="8"/>
        <mx:Button buttonMode="true" enabled="{enableUndo()}" styleName="myButtonStyle" id="cmdUndo" click="fUndo()" overIcon="@Embed(source='icons/buttons/undo.png')" icon="@Embed(source='icons/buttons/undo_g.png')" disabledIcon="@Embed(source='icons/buttons/undo_d.png')" width="28" toolTip="Undo"/>
        <mx:Button buttonMode="true" enabled="{enableRedo()}" styleName="myButtonStyle" id="cmdRedo" click="fRedo()" overIcon="@Embed(source='icons/buttons/redo.png')" icon="@Embed(source='icons/buttons/redo_g.png')" disabledIcon="@Embed(source='icons/buttons/redo_d.png')" width="28" toolTip="Redo"/>
        <mx:Spacer width="100%" height="12"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="gridExpand('ship')" width="28" overIcon="@Embed(source='icons/buttons/show_shipments.png')" icon="@Embed(source='icons/buttons/show_shipments_g.png')" toolTip="Show shipments" id="cmdExpandShowShipments"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="gridExpand('cargo')" width="28" overIcon="@Embed(source='icons/buttons/show_cargo.png')" icon="@Embed(source='icons/buttons/show_cargo_g.png')" toolTip="Show cargo" id="cmdExpandShowCargo"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="gridExpand('yes')" width="28" overIcon="@Embed(source='icons/buttons/show_all.png')" icon="@Embed(source='icons/buttons/show_all_g.png')" toolTip="Show all" id="cmdExpandShowAll"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="gridExpand('no')" width="28" overIcon="@Embed(source='icons/buttons/hide_all.png')" icon="@Embed(source='icons/buttons/hide_all_g.png')" toolTip="Hide all" id="cmdExpandHideAll"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="refreshDGCargoGrid()" width="28" overIcon="@Embed(source='icons/buttons/refresh.png')" icon="@Embed(source='icons/buttons/refresh_g.png')" id="cmdRefresh"/>
        <mx:Spacer width="130" height="12"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="fGetEDI()" width="28" overIcon="@Embed(source='icons/buttons/edi.png')" icon="@Embed(source='icons/buttons/edi_g.png')" toolTip="EDI connector" id="cmdEDIConnector"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="fGetPayloadList()" width="28" overIcon="@Embed(source='icons/buttons/payload.png')" icon="@Embed(source='icons/buttons/payload_g.png')" toolTip="Country weight limits" id="cmdCTWgtLimits"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="fLogSend()" width="28" overIcon="@Embed(source='icons/buttons/error.png')" icon="@Embed(source='icons/buttons/error_g.png')" toolTip="Let us know about your problem." id="cmdSendError"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="fQuickStartGuide()" width="28" overIcon="@Embed(source='icons/buttons/help.png')" icon="@Embed(source='icons/buttons/help_g.png')" toolTip="Quick start guide" id="cmdQuickStartGuideMain"/>
        <mx:Button buttonMode="true" styleName="myButtonStyle" click="fCheckForUpdate(true)" width="28" overIcon="@Embed(source='icons/buttons/swupdate.png')" icon="@Embed(source='icons/buttons/swupdate_g.png')" toolTip="Check for update" id="cmdCheckForUpdate"/>     
        <!--<mx:CheckBox label="Summary" id="chkSummary"/>  
        <mx:CheckBox label="Manual" id="chkManual"/>-->
        <mx:PopUpButton openAlways="true" label="Show columns" cornerRadius="0" id="cmbShowColumns">
            <mx:popUp>
                <mx:HBox width="150" horizontalAlign="center" backgroundColor="white" 
                    backgroundAlpha="1" alpha="1" borderColor="#8a8585" borderThickness="1" borderStyle="solid">
                    <mx:VBox>
                        <mx:CheckBox id="chkSummary" label="Summary"/>
                        <mx:CheckBox id="chkManual" label="Index order columns"/>
                    </mx:VBox>
                </mx:HBox>
            </mx:popUp>
        </mx:PopUpButton>   
        <!--<mx:Button buttonMode="true" styleName="myButtonStyle" width="28" overIcon="@Embed(source='icons/buttons/help.png')" icon="@Embed(source='icons/buttons/help_g.png')" toolTip="About" id="cmdHelp" click="fOpenHelp()"/>-->
        <mx:Button buttonMode="true" styleName="myButtonStyle" width="28" overIcon="@Embed(source='icons/buttons/about.png')" icon="@Embed(source='icons/buttons/about_g.png')" toolTip="About" id="cmdAbout" click="fOpenAbout()"/>
    </mx:ApplicationControlBar>
    <mx:SWFLoader x="86" y="48" source="icons/swf/garrow.swf" visible="false"/>
    <mx:Image x="302" y="320" source="icons/bubble_icon_left.png" visible="false"/>
</mx:WindowedApplication>
joshtynjala commented 5 years ago

@LudvikWiejowski Look for the following line of code (line 191, I think):

<mx:DataGrid showHeaders="false" horizontalScrollPolicy="auto" verticalScrollPolicy="auto" headerColors="[yellow,yellow]" selectable="true" dataProvider="{clipXML.tr}" height="100%"
 sortableColumns="false" editable="true" id="dgImport" y="42" width="100%" > <!---->

Remove this empty comment at the end of the line, and that should make the MXML parser happy:

<!---->

LudvikWiejowski commented 5 years ago

@joshtynjala thanks a lot, unfortunately it did not make any difference. Still have the same problems. With player 10 20+ problems, with 10.1 10K+ problems, but it seems that with 10.1 all problems are related to the benevolent flex 3 rules when coding, which are more strict in VSC, but no issue with xmlx file I sent above. By the way, goto definition still does not work. I can see it, but it says, that it was not found.

joshtynjala commented 5 years ago

@LudvikWiejowski No difference at all?

Removing <!----> should have removed this style of errors:

'mx:Form' tag (or tag before this tag, or non-tag inside this tag) is unclosed or tag not allowed here.

When I removed that comment from your file, I definitely saw many errors disappear.

joshtynjala commented 5 years ago

However, I should point out that this these lines will probably always give you some trouble in VSCode:

You probably see errors like this for each included script:

No externally-visible definition with the name 'scripts.CodeBlocks' was found.

Using included scripts like that is considered a pretty bad practice. Getting an IDE to understand that a particular .as file is meant to be included instead of treated like a class isn't likely to happen any time soon.

If you wish to proceed, you'll probably need to move the code out of those files and place it inside <mx:Script></mx:Script> elements.

LudvikWiejowski commented 5 years ago

@joshtynjala oh, yes, there is a lot I would have to change in order make VSCode happy. But I can't afford to correct 8K+ problems, that would take me days. I think I will continue to develope my project in IntelliJ Idea, it gives me no errors. :) Also, goto definition still does not work for me.

I will use VSCode for Royale project in future.

Thanks for your support.

LudvikWiejowski commented 5 years ago

sorry, I was too quick. I found out why goto definition did not work. In my old "flex 3" code I used e.g. in classes definition of functions like this: private function myFunction, but VSCode does not like it and when I changed it to: var function myFunction, goto definition function started to work. I will play more with it. But why there are so many changes when it's still actionscript 3, or?

joshtynjala commented 5 years ago

private function myFunction

Functions written this way are fully supported by VSCode. I certainly wouldn't have started this project, if that weren't possible! That's basic AS3 syntax. :smile:

There must be something else that's causing issues, and go to definition not working for methods is just a side effect. Your project has some things about it that are a little out of the ordinary, like still being on Flex 3, using Githubissues.

  • Githubissues is a development platform for aggregating issues.