Flex 4 SWFLoader - Main app detecting events from remote sub app swf - apache-flex

I have 2 separate Flex 4 projects, same framework but running on different servers.
1) MainApp (IP:192.168.12.113:8080)
2) SubApp (IP:192.168.10.19:5080)
I need to integrate SubApp into MainApp and I have managed to do so using a SWFLoader.
//MainApp/mainapp.mxml
<s:SWFLoader id="contentLoader"
loadForCompatibility="true"
trustContent="true"
source="http://192.168.10.19:5080/SubApp.swf"/> //Using url
Right now, I need the SubApp to notify the MainApp when a particular button is clicked so that the MainApp can perform some functions (E.g. Open/close a sliding window). How can I go about doing it?
In addition, to clarify, is this kind of setup considered as multi-versioned remote sandbox? Both applications are trust-able and should be able to access each other variables/functions.
Help is greatly appreciated. Thanks.

Since they are in a differant domain, they are sandboxed applications. You can use the following for your case
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f0d.html#WS2db454920e96a9e51e63e3d11c0bf69084-7f00

Related

identify button is not visible while spying objects in blue prism

While spying objects in blueprism using application modeller, i am not able to see identify button, instead just seeing only launch option.
It's because the application that you are tring to spy on, isn't launched.
You need to launch it first(from BP)and then Blue Prism alow you to spy on it. If you open aplication "on your own" BP wont see it.
In Win 10, some applications like calculator cannot be spyed as in Win 7.
In order to get identify button you need to do belows:
Launch the application in an object using Navigate stage.
For example, you can create an object with the name "Launch".
Attach the application. You need to create another object using Navigate stage with the name "Attach".
Then you need to use Page stage referencing "Attach" page after Launch stage.
When you complete above, please run it and then, click on the Application Modeler. You can be able to use Identify button at that time.
My blue prism object screen
Kindly reconfigure the application in application modeller, while doing so, give attention to the options you select in application modeller. Setting the correct options like web based or windows based application the problem will be resolved.
Can be two reasons:
Either your application is not launched properly.
Sometimes we face problems with some versions of applications.
The best way to fix your problem is
Edit your settings remove the application path from the navigate stage.
Launch the application separately
Open Navigate stage > Action > Attach
Provide the window title within quotes (example: "Calculator")
Click OK then run the object
Now if you go to application modeller
You will be able to see the identify button under the element.
Hope this will help you.
"Microsoft.WindowsCalculator" use in the application executable path in application modeller.put Microsoft.WindowsCalculator in between < >

Flash inside Flex inside ExtendScript

i have been working on a Photoshop UI project and also working with Flash Builder for about 3 weeks and i can't find a solution to a communication problem. Here are some details about the issue; if you are interested in helping me, thanks.
The main frame of the UI is Extendscript
I have an as3 swf which needs to load a local JPG file dynamicly, I
assume this is a "Access Local Files Only" situation for Flash.
The same SWF needs to communicate with Extendscript, so i load it into
a FLEX app dynamicly via SWFLoader and it passes some variables to,
and triggers some functions in FLEX via a "myFlexParent" object.
Flex is the bridge between Flash and Extendscript so it passes the
variables and functions to Extendscript JSX code via
Externalinterface.call or CSXSInterface.instance.evalScript().
This is where i'm STUCK. I guess ExternalInterface calls or CSXSInterface.instance.evalScript() are threated as a network operation and they don't work if i set the compile option "-use-network=false" in flex. Bu otherwise the local JPG file cannot be loaded.
Adding locations in the Settings Manager wont work for me because i'm going to turn the UI into an Extension and it should be easy to install.
I guess i'm trying to find a way to establish 2 way communication between FLEX and ExtendScript, that would be interpreted by flash player as a LOCAL communication, which actually is.
I'll appreciate any bit of information. Thanks.
ExternalInterface is going to be considered a network call and setting the -use-network=false will break those calls down. This is due to the security sandbox. If it was allowed then the flash app could be used with some simple AJAX to turn a non-network app into a network app very easily.
Adobe doc's say:
This communication relies on the domain-based security restrictions
that the allowScriptAccess and allowNetworking properties define. You
set the values of the allowScriptAccess and allowNetworking properties
in the SWF file’s wrapper.
Reference link:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf6167e-7fff.html#WS2db454920e96a9e51e63e3d11c0bf6167e-7ff5
Look into changing your app into an AIR app as you will be able to do both network and local file operations (different security model since the user installs the application).

How to Use DragDrop in AIR Application?

I am building an AIR application which opens some specific documents. I want to enable dragdrop on this application. So that when application is running and user drag a file and drop that file on the application window, the application must respond to that event and must be able to perform some action. How can I do this? Thanks
I believe you're looking for the Invoke event.
I believe what you are looking for is a NativeDrag manager with specific settings in application.xml
You can see more details at http://raghuonflex.wordpress.com/2007/12/17/drag-drop-of-a-file-into-an-air-app-beta-3/

Sharing code between Flex and AIR

As you know, we could build a RIA application based on flex. Also, we could build an desktop application based on AIR. I have a question, If we want to build web & desktop application simultaneously. Could we use the same codes to ship our production to web & desktop?
If you design your application for it, you should have no problems in sharing 99% of your codebase between your Flex and AIR builds.
You will need a separate application MXML for the Flex / AIR versions as AIR uses a WindowedApplication and Flex uses Application
You will need to abstract your usage of any AIR-only APIs. That is, any class, property or method marked with the AIR-only icon (
) in the Online Documentation. You might find this process easier if you are using a Dependency Injection container like Swift Suspenders.
Alternatively, you can split your service definitions into two different source trees. This would result in your AIR project and Flex project sharing one source path, but also having their own source path. This way, code that accesses com.application.MyService would be shared across AIR and Flex but the implementation of com.application.MyService would differ depending on which 'service source path' was being used.
You may find it useful to configure each build with a compiler flag like -define+=CONFIG::AIR. This allows you to use conditional compilation so that you can compile the same file for both builds, but include specific code for the AIR build.
Here is an exmaple of conditional compilation:
public function getMyService() : IMyService
{
CONIFG::AIR
{
return new MyServiceThatUsesAnAIROnlyAPI();
}
return new FallbackServiceForFlex();
}
Unfortunately there is no way to 'negate' a conditional flag (ie. !CONFIG::AIR) so you either need to be smart about your usage of it, or include two flags (CONFIG::AIR and CONFIG::FLEX)
I'm surprised no one said it yet, but this is how I would do it:
Create a library project. this project will include all your
shared code.
Create a Flex project for web deployment
Create an AIR Project for AIR deployment
Both the Flex and AIR projects can reference and use code in the library project. The AIR project can use AIR specific functionality without affecting the web project.
If you need to perform different actions differently based on whether using the web project or the AIR project, you can create interfaces in the library project and implement them in the main project to use the respective APIs.
yes, you can do it.
there are some conditions you have to control in code.
Keep in mind, if the application is also a flex app, then it will be a single window app.
for every project I make needing this I create 3 projects
code base (the main control is a group or a canvas)
flex exporter => when you build this you will end up with a flex application
it has a control from #1 inside the main application
air exporter => when you build this you will end up with an Air app
it has a control from #1 inside the main window.

404 Error using Flash Builder 4 BlazeDS wizard

My issue this time around is trying to use the new DCD BlazeDS wizard in Flash Builder 4. If I set my project up as a combined Java/Flex app I am unable to connect to the RDS servlet using the wizard. I get a 404 error every time.
I'm certain the service is set up correctly since my app can access the exposed java classes and BlazeMonster can see the exposed services.
Is anyone else having this issue and if so has anyone found a work-around? I'd very much like to use the code generation features of the wizard for my project.
Thanks as always,
Codeflayer
You also need to make sure you have the RDSDispatchServlet setup in the web.xml config file.

Resources