Examples and popup windows

General Discussion of Scripting for Flex, Flash & CS SDK

Moderators: Tom, Kukurykus

undavide

Examples and popup windows

Post by undavide »

Hello,

I have a couple of questions to ask - actually the first one isn't really a question: I know that CS Extension Builder (the Flash Builder/Eclipse plugin that makes easier to code extensions for the CS - which I don't have BTW) comes with several examples. I would be nice if someone could gently make them available (I don't know but I guess that it wouldn't infringe any copyright) - the documentation is never enough and it would be enormously interesting to look at actual extensions code

Speaking of coding problems, I've posted this in the Adobe's CS SDK forum but it seems to me PS-Scripts could be a good place to get an answer anyway: I'm trying to make a Ps panel to open sort of a popup window. Actually, it's not really a popup - if you have some knowledge of Configurator2, the effect would be the same of the widget "popup panel" - basically I need to open from my extension, a bigger window that contains text information, links, images, etc: nothing I have to exchange data with (it's a big info/documentation window).

I've thought to create a separate swf and load it, but I suspect (like modal dialogs) it would be cropped to the panel's dimension (BTW I hadn't too much luck with SWFLoader). One solution could be to create a separate extension then load it via CSXSInterface.requestOpenExtension(), passing the extension ID (as they suggest here), but if possible I'd like to avoid to deploy an extension bundle and crowd the extensions menu with multiple items. Do you have any better/simpler idea?

Thanks in advance,

Davide
undavide

Examples and popup windows

Post by undavide »

Still valid the CS Extension Builder samples request, it seems I've found a solution for the popup window

I've created a info.mxml (mx:Window), adding this code to my main application:

Code: Select allpublic function myDoAbout():void
                      {
            var window:Window = new info();
            if(window){
               window.type = CSXSWindowType.MODAL_DIALOG;
               window.width = 400;
               window.height = 600;
               window.resizable = false;
               window.open();
            }
         }

It was that simple...
FYI, remember to add a button in the info window with a close method, otherwise PS will keep waiting.
Davide
myranalis

Examples and popup windows

Post by myranalis »

Thanks for posting that Davide - I was just about to ask the same with popup windows!!
undavide

Examples and popup windows

Post by undavide »

Currently I'm having hard times inserting content in the popup window. For some strange reason, Flash Builder 4 (mac) opens the mxml (mx:Window) in the design mode with a size like 200x200 pixels and there's no say to resize it, so I've solved creating a temporary mxml (mx:Application, 400x600px), dragging there the components I need (labels, text and so on), then pasting the code into my actual popup window. Is that the same with you?
Regards,

Davide
myranalis

Examples and popup windows

Post by myranalis »

I had compile errors with the code you posted, but I found this: http://www.roseindia.net/flex/howto/cre ... flex.shtml ... flex.shtml

I can get that window to appear in a photoshop panel if the sample is copied as is. Incorporating it into my own script is another matter yet. But, I've gotten side tracked trying to get the application to size appropriately for the photoshop panel window. (See post coming soon!!)
myranalis

Examples and popup windows

Post by myranalis »

I'm making progress on this, I've got my popups as TitleWindow as per the link i posted earlier, but the design view appears to work just as the application's design view does - no issues with size.