14 Replies Latest reply on Jul 3, 2017 3:36 AM by nathans47916809

    Is It Possible to Create Two Dialogs in Flash UI.

    nathans47916809 Level 1

      Dear Friends,

        I have Create a FlashUI With 2 Dialogs(With 2 Extension ids in Extension list and Two Separate mxml Files).

      When I click a button(Show Sub Dialog)  in main dialog then the Sub Dialog is Shown .

      But the Controls Are Not Shown in the Second Dialog(Created as Panel or ModalDialog but Problem not solved).

      please give your Suggestion to Solve this Problem.

       

       

      Thank you Friends,

      Nathan.

        • 1. Re: Is It Possible to Create Two Dialogs in Flash UI.
          LeoTaro Level 4

          What happens if you swap the two mxml files so that the sub dialog is shown first?

          • 2. Re: Is It Possible to Create Two Dialogs in Flash UI.
            nathans47916809 Level 1

            Dear Friend,

              I try with swapping mxml as you said then the Controls of Second Dialog(only a Button) is Shown in First Dialog.

              I cant judge what is the problem here.

              I am having 2 mxmls :

               1)FreeGridUI.mxml is Same as Illustrator Sample FreeGridUI.mxml.This is the First Dialog.I added a button to show the Sub Dialog.

               2)ShowUI.mxml Is the Sub Dialog's mxml.see the ShowUI.mxml in the below image.

            Then the manifest.xml is Shown below

            <?xml version="1.0" encoding="UTF-8" standalone="no"?><ExtensionManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ExtensionBundleId="FreeGrid" ExtensionBundleVersion="3.0.0.20110105_m_16" Version="2.0">

              <ExtensionList>

              <Extension Id="FreeGrid" Version="3.0"/>

              <Extension Id="ShowUI" Version="3.0"/>

              </ExtensionList>

              <ExecutionEnvironment>

              <HostList>

              <Host Name="ILST" Version="15.0"/>

              </HostList>

              <LocaleList>

              <Locale Code="en_ME"/>

              <Locale Code="pt_BR"/>

              <Locale Code="en_US"/>

              <Locale Code="pl_PL"/>

              <Locale Code="ja_JP"/>

              <Locale Code="ru_RU"/>

              <Locale Code="zh_CN"/>

              <Locale Code="uk_UA"/>

              <Locale Code="ro_RO"/>

              <Locale Code="el_GR"/>

              <Locale Code="pt_PT"/>

              <Locale Code="en_GB"/>

              <Locale Code="en_IE"/>

              <Locale Code="cs_CZ"/>

              <Locale Code="zh_TW"/>

              <Locale Code="he_IL"/>

              <Locale Code="nb_NO"/>

              <Locale Code="fr_CA"/>

              <Locale Code="es_ES"/>

              <Locale Code="ko_KR"/>

              <Locale Code="fi_FI"/>

              <Locale Code="de_DE"/>

              <Locale Code="it_IT"/>

              <Locale Code="en_CE"/>

              <Locale Code="hu_HU"/>

              <Locale Code="fr_FR"/>

              <Locale Code="es_MX"/>

              <Locale Code="ar_AE"/>

              <Locale Code="tr_TR"/>

              <Locale Code="sv_SE"/>

              <Locale Code="da_DK"/>

              <Locale Code="nl_NL"/>

              </LocaleList>

              <RequiredRuntimeList>

              <RequiredRuntime Name="CSXS" Version="2.0"/>

              </RequiredRuntimeList>

              </ExecutionEnvironment>

              <DispatchInfoList>

              <Extension Id="FreeGrid">

              <DispatchInfo>

              <Resources>

              <SwfPath>./FreeGridUI.swf</SwfPath>

              </Resources>

              <Lifecycle>

              <AutoVisible>true</AutoVisible>

              </Lifecycle>

              <UI>

              <Type>Panel</Type>

              <Geometry>

              <Size>

              <Height>226</Height>

              <Width>300</Width>

              </Size>

              <MaxSize>

              <Height>226</Height>

              <Width>300</Width>

              </MaxSize>

              <MinSize>

              <Height>226</Height>

              <Width>300</Width>

              </MinSize>

              </Geometry>

              </UI>

              </DispatchInfo>

              </Extension>

              <Extension Id="ShowUI">

              <DispatchInfo>

              <Resources>

              <SwfPath>./ShowUI.swf</SwfPath>

              </Resources>

              <Lifecycle>

              <AutoVisible>true</AutoVisible>

              </Lifecycle>

              <UI>

              <Type>Panel</Type>

              <Geometry>

              <Size>

              <Height>226</Height>

              <Width>300</Width>

              </Size>

              <MaxSize>

              <Height>226</Height>

              <Width>300</Width>

              </MaxSize>

              <MinSize>

              <Height>226</Height>

              <Width>300</Width>

              </MinSize>

              </Geometry>

              </UI>

              </DispatchInfo>

              </Extension>

             

             

              </DispatchInfoList>

            </ExtensionManifest>

             

             

            please give your Suggestion to Solve this problem.

             

            Thank you Friend,

            Nathan

            • 3. Re: Is It Possible to Create Two Dialogs in Flash UI.
              LeoTaro Level 4

              What code do you use to show the sub dialog when you click on the button in the main dialog?

              • 4. Re: Is It Possible to Create Two Dialogs in Flash UI.
                nathans47916809 Level 1

                Dear Friend,

                  The Code in FreeGridUI on Button(Show Dlg) Click is Given Below,

                public function ShowFunc() : void

                {

                  var ShowClickEvent : CSXSEvent = new CSXSEvent("com.adobe.csxs.events.ShowClicked", CSXSEventScope.APPLICATION);

                  var xml : XML = new XML();

                  var xmlContent : String = getContent();

                  xml = XML(xmlContent);

                  ShowClickEvent.data = xml;

                  CSXSInterface.getInstance().dispatchEvent(ShowClickEvent);

                }

                And in FreeGrid Plugin Project The Code To Show Sub Dialog is Give Below.

                #define EVENT_TYPE_SHOW_CLICKED "com.adobe.csxs.events.ShowClicked"

                #define SUB_UI  "ShowUI"

                csxs::event::EventErrorCode FreeGridDialogController::RegisterCSXSEventListeners()

                {

                  csxs::event::EventErrorCode result = csxs::event::kEventErrorCode_Success;

                  do {

                  result =  fPPLib.AddEventListener(EVENT_TYPE_OK_CLICKED, OkClickedFunc, this);

                  if (result != csxs::event::kEventErrorCode_Success)

                  {

                  break;

                  }

                  result =  fPPLib.AddEventListener(EVENT_TYPE_PANEL_READY, PanelReadyFunc, this);

                  if (result != csxs::event::kEventErrorCode_Success) {

                  break;

                  }

                  result =  fPPLib.AddEventListener(EVENT_TYPE_SHOW_CLICKED, ShowFunc, this);

                  if (result != csxs::event::kEventErrorCode_Success) {

                  break;

                  }

                  }

                  while(false);

                  return result;

                }

                csxs::event::EventErrorCode FreeGridDialogController::RemoveEventListeners()

                {

                  csxs::event::EventErrorCode result = csxs::event::kEventErrorCode_Success;

                  do {

                  result =  fPPLib.RemoveEventListener(EVENT_TYPE_OK_CLICKED, OkClickedFunc, this);

                  if (result != csxs::event::kEventErrorCode_Success)

                  {

                  break;

                  }

                  result =  fPPLib.RemoveEventListener(EVENT_TYPE_PANEL_READY, PanelReadyFunc, this);

                  if (result != csxs::event::kEventErrorCode_Success)

                  {

                  break;

                  }

                  result =  fPPLib.RemoveEventListener(EVENT_TYPE_SHOW_CLICKED, ShowFunc, this);

                  if (result != csxs::event::kEventErrorCode_Success)

                  {

                  break;

                  }

                  }

                  while(false);

                  return result;

                }

                 

                static void ShowFunc(const csxs::event::Event* const eventParam, void* const context)

                {

                  sAIUser->MessageAlert(ai::UnicodeString("Button Clicked"));//For My Ref to check button click

                  FreeGridDialogController *freeGridController = (FreeGridDialogController *)context;

                  freeGridController->LoadExtension(SUB_UI);

                }

                 

                 

                 

                 

                Please give your suggestion to solve this problem

                 

                 

                Thank you Friend,

                Nathan

                • 5. Re: Is It Possible to Create Two Dialogs in Flash UI.
                  nathans47916809 Level 1

                  Dear Friend,

                        The problem is Still not Solved.

                         please give me your Suggestion to Create 2 Dialogs in Flash UI.

                   

                  Thank you Friend,

                  Nathan

                  • 6. Re: Is It Possible to Create Two Dialogs in Flash UI.
                    GeghamB

                    Hi,

                    you can try to open 2nd dialog using something like this

                     

                     

                    public function ShowSubDialog():void

                    {

                    var subW:Window = new Window();

                    subW.title = "SubDialog";

                     

                    subW.type = CSXSWindowType.MODAL_DIALOG;

                    subW.open();

                    subW.maxWidth = 250;

                    subW.minWidth = 230;

                    subW.width = 230;

                    subW.maxHeight = 250;

                    subW.minHeight = 230;

                    subW.height = 230;

                    //--

                    subW.stage.align = StageAlign.TOP_LEFT;

                    subW.stage.scaleMode = StageScaleMode.NO_SCALE;

                     

                    var button:Button = new Button();

                    button.x = 10;

                    button.y = 10;

                    button.label = "...";

                    //...

                    subW.stage.addChild(button);

                    }

                     

                     

                     

                    public static function ShowSubDialog():void { var subW:Window = new Window(); subW.name = "SubDialog"; subW.title = "SubDialog"; subW.type = CSXSWindowType.MODAL_DIALOG; subW.open(); subW.maxWidth = 250; subW.minWidth = 230; subW.width = 230; subW.maxHeight = 250; subW.minHeight = 230; subW.height = 230; //-- subW.stage.align = StageAlign.TOP_LEFT; subW.stage.scaleMode = StageScaleMode.NO_SCALE; var button:Button = new Button(); button.x = 10; button.y = 10; button.label = "..."; /*...*/ subW.stage.addChild(button); }

                    • 7. Re: Is It Possible to Create Two Dialogs in Flash UI.
                      nathans47916809 Level 1

                      Dear Friend,

                         Thank you For Your Suggestion,

                          I can't use window class in the Button Click Event of First Dialog.It Shows error like below

                       

                      Is it necessary to include some thing,to use Window class?

                      Please give your Suggestion to Solve this Problem.

                       

                      Thank You Friend,

                      Nathan

                      • 8. Re: Is It Possible to Create Two Dialogs in Flash UI.
                        GeghamB Level 1

                        You're welcome,

                        have you tried the

                         

                        import mx.core.Window;

                         

                        This should help.

                        • 9. Re: Is It Possible to Create Two Dialogs in Flash UI.
                          nathans47916809 Level 1

                          Dear Friend,

                             Thank you For Your Suggestion,

                              The Dialog is Shown now .But The Controls in the Dialog is not Shown.I thing this Problem is same as I already explained from the Start(Another method to Create 2nd Dialog).

                             Please see the image Given below

                          please note that i tried the full code as you said,

                           

                            var subW:Window = new Window();

                            subW.title = "SubDialog";

                            

                            subW.type = CSXSWindowType.MODAL_DIALOG;

                            subW.open();

                            subW.maxWidth = 250;

                            subW.minWidth = 230;

                            subW.width = 230;

                            subW.maxHeight = 250;

                            subW.minHeight = 230;

                            subW.height = 230;

                            //--

                            subW.stage.align = StageAlign.TOP_LEFT;

                            subW.stage.scaleMode = StageScaleMode.NO_SCALE;

                            

                            var button:Button = new Button();

                            button.x = 10;

                            button.y = 10;

                            button.label = "...";

                            //...

                            subW.stage.addChild(button);

                           

                           

                          The Button Control is not Shown.

                           

                          please give your suggestion to solve this problem.

                           

                          Thank you Friend,

                          Nathan.

                          • 10. Re: Is It Possible to Create Two Dialogs in Flash UI.
                            nathans47916809 Level 1

                            Dear Friend,

                            The Problem is still not solved.

                              I tried the same way and found a problem,The second dialog is Shown but the init() Function is not Called.The Controls are not shown.

                              I cant find the exact problem why the init() function of second dialog is not called.

                            please give your suggestion to solve this problem.

                             

                            Thank you Friend,

                            Nathan.

                            • 11. Re: Is It Possible to Create Two Dialogs in Flash UI.
                              LeoTaro Level 4

                              Why have you got [Bindable] before your init1 function? This might be why your init function is not being called, but it shouldn't stop the controls being shown.

                               

                              It is possible to launch a flash dialog from another flash dialog, so there is a problem with your code somewhere.

                              • 12. Re: Is It Possible to Create Two Dialogs in Flash UI.
                                nathans47916809 Level 1

                                Dear Friend,

                                  Thank You For Immediate Reply and Confirmation(it is possible to launch a flash dialog from another flash dialog).

                                  I am new to FlashUI Development.There is no sample in Illustrator SDK to launch a flash dialog from another flash dialog.

                                  I Developed two Flash Dialogs For Later versions of Illustrator CC 2015.3 and C 2017 with your guidance.

                                  Now I am trying to create two Flash dialogs(launch a flash dialog from another flash dialog) For Adobe Illustrator CS 6 version by using Adobe Flash Builder 4.6 and Cretive suite extension Builder 2 which one was get from you.

                                   I can't find why the controls in the seond dialogs are not shown.

                                   I already provide the code i used to launch a flash dialog from another flash dialog.

                                   please give your Suggestion to Solve this problem.

                                   If it is possible can you give me a sample to launch a flash dialog from another flash dialog.

                                 

                                Thank You Friend,

                                Nathan

                                 

                                • 13. Re: Is It Possible to Create Two Dialogs in Flash UI.
                                  LeoTaro Level 4

                                  What happens when you remove the [Bindable] line from your ShowUI.mxml?

                                   

                                  I checked you could launch a flash dialog from another flash dialog by modifying one of our production plugins. I can't give you the code for this and I don't have time to create a sample. If you give me your code, I could have a quick look at it.

                                  • 14. Re: Is It Possible to Create Two Dialogs in Flash UI.
                                    nathans47916809 Level 1

                                    Dear Friend,

                                       Thank You For Your Suggestion.

                                         If I Remove the [Bindable] line from your ShowUI.mxml then Init() Function is called.

                                        I try to Create new Project and Remove the [Bindable] line from your ShowUI.mxml then the problem is solved now.

                                        The Controls in the Second Dialog is Shown now.

                                        Then I try to add [Bindable] line in to  ShowUI.mxml.But the problem is not Reproduced again.

                                        I can't find what is the actual mistake in my code.Anyway the problem is solved now.

                                     

                                    Thank you Friend,

                                    Nathan.