Ajax Bridge vs. the ExternalInterface Class
Hi,
I am writing a pure Actionscript 3 application in Adobe Flex. I want my application to interact with scripting in a browser. It seems that there are two options: Adobe's Ajax Bridge (typically used with a Flex application that uses mxml?) and Adobe's External Interface class (flash.external.ExternalInterface). Is there any reason to use the Ajax Bridge over the ExternalInterface class, or vice versa?
Thank you.
I'd recommend sticking with ExternalInterface until/unless it is insufficient. ExternalInterface is nice because of its simplicity. You can call JavaScript from ActionScript and vice versa; nothing fancy or complicated to get in the way.
The following documentation may be helpful:
http://www.flexafterdark.com/docs/Flex-JavaScript
Let me know if that helps...
Ben Edwards
Similar Messages
-
Not supported: Air + Ajax + (flex-ajax-bridge) + LCDS
I'm building an application Air (Flex + extjs) and offline synchronization with LCDS. For sure I need the flex-ajax-bridge.
But the experiments failed on Air runtime container, when ajax tried to communicate with server end data services.
And I checked the source code of flex bridge file (FDMSBridge.as):
import bridge.FABridge;
import flash.display.DisplayObject;
import flash.display.MovieClip;
import flash.events.Event;
import flash.external.ExternalInterface;
import mx.core.mx_internal;
use namespace object_proxy;
[Frame(extraClass="FakeFlexInit")]
public class FDMSBridge extends FDMSBase
private var gateway:FABridge;
public function FDMSBridge()
super();
if (ExternalInterface.available == false)
return;
ExternalInterface.addCallback("createObject", createObject);
private function createObject(className:String, cArgs:Array):Object
From the source code, we can tell the bridge rely heavily on the flash.external interface; AND look at this link -
http://livedocs.adobe.com/labs/air/1/aslr/flash/external/ExternalInterface.html
where it says -
Note: Adobe AIR currently does not support the ExternalInterface class.
which leads to the conclusion that:
Air + Ajax(HTML) + LCDS solution is not supported by AIR currently.
The ExternalInterface class environment:
Browser Operating System Operating System
Internet Explorer 5.0 and later Windows
Netscape 8.0 and later Windows MacOS
Mozilla 1.7.5 and later Windows MacOS
Firefox 1.0 and later Windows MacOS
Safari 1.3 and later MacOS
Can anyone tell me what's the version of AIR built-in browser (squirralfish)? or, will AIR support FDMSBridge soon?
Thanks!I agree, it would be nice to have gzip encoding support in
AIR's browser component. But, I looked at what my AIR app sends
when it requests a web page, and it's not claiming to the remote
server that it can support gzip. If the server is sending the
content gzipped anyway, it's almost certainly broken. Web servers
aren't supposed to dictate encodings. Clients say what they're
capable of receiving, and servers send the data in that format if
they're capable of sending any of the requested formats.
I see only one exception in the spec.
Section
14.3 says the server is allowed to send what it likes if the
client doesn't say what it wants (true for AIR) and it cannot
support the default, which is to say, sending the raw data as it is
on disk. So, is that the case? Can this server really not send raw
data, to anyone, ever? If so, it's violating the spirit of the web,
to the point that I'd say it's broken, even if the spec does allow
it. And if the server really is capable of sending the raw data,
it's
really broken for insisting on sending it compressed when
the client hasn't told it that it can handle it; this would
actually be against the spec, not just against the spirit of the
spec.
It would seem a more sensible use of your time to fix the
server than to go and learn another technology just to work around
its brokenness. -
Examples for using the Flex-Ajax-Bridge
All samples that ship with BlazeDS use pure Flex on the
client-side; what I would like to
have are samples that show the Flex-Ajax-Bridge in action;
using BlazeDS/LCDS as the data
exchange engine; and then use this engine's capabilities to
do Ajax stuff on the
client-side; I have found one example where Ajax delivered
data is pumped into Flex using
the Flex-Ajax-Bridge; but not the other way round ...
Another question: Can I use the Flex-Ajax-Bridge shipped with
BlazeDS with the standalone
LCDS and the CF8 integrated LCDS, too ? Or are there
different versions of the
Flex-Ajax-Bridge available ?- get an instance of weblogic.management.MBeanHome for the WLS server from
JNDI, using weblogic.management.MBeanHome.JNDI_NAME+"."+"yourServerName"
- get MBeanServer from MBeanHome
To register your mbeans...
- invoke registerMBean() on MBeanServer as in javax.management.MBeanServer
- Note that the objectname which is passed to registerMBean() should be an
instance of weblogic.management.WebLogicObjectName
To get values from weblogic mbeans.....
- use various getters in weblogic.management.MBeanHome
pls see relevant javadocs for details
Michael Guillory <[email protected]> wrote in message
news:3a5e155b$[email protected]..
I would like to revisit Peter's question from 1/2/2001. I need to be ableto
access the
Mbeans from the Administration Server, please let me know where I can find
some
information.
Thank you
Mike -
Java Access Bridge 1.1 Could not find the main class
When I try to load Java Access Bridge 1.1 I receive the following error:
Could not find the main class. Program will exit.
Does anyone know why?you must check with the classpath
please see that you have not repeated %classpath%
at the end of the class path like you do in win98.
similiarly with %path%
in win2000 it is automatically taken care off. -
Are there release notes for the new Flex Ajax Bridge?
Are there release notes for the new Flex Ajax Bridge?
Hello,
You can find the release notes
here
. The wiki page has been updated as well to point to the release
notes document, in the Where can I find out more section.
Thanks for noticing they were missing,
Cristian -
Is The Flex/Ajax Bridge Possible in a Pure Actionsript Project??
Is it possible to create a Actionscript/Ajax Bridge in a pure
AS project? Meaning - AJAX Bridge not using MXML.PUSH...
-
Flex Ajax bridge - flash player detection
Does anyone know of a Flex HTML wrapper template which
handles the express install (with history) user experiences in a
manner which is compatible with the lifecycle of the Flex/Ajax
bridge? Assuming JavaScript is enabled, the express install process
creates the embed DOM node for the SWF dynamically; however, the
FABridge scripts assume that the embed node(s) exist within the
DOM; the the initialisation of the FABridge queries the DOM for
‘bridge’ instances (i.e. embed tags with the relevant
flash vars). If the embed node is not present, the
FABridge.instances object is not initialised correctly. This causes
two problems: firstly, attempting to register an initialisation
callback in the FABridge will fail, since the bridge instance is
not known. Secondly, the ExternalInterface call from the Flash
component to signify that it has successfully initialised does not
have an endpoint to communicate with, meaning that the client side
lifecycle cannot be instantiated.
If anyone has come across a useful strategy to approach this
problem, I'd be hugely grateful for any pointers.
Thanks, GregThe html wrapper code generated by Flex Builder does this
automatically if you have Project, Flex compiler, use Express
Install checked.
Tracy -
Ajax Bridge with no "getRoot()" method when using flash builder 4.7 trail
i am working on ajax bridge with flashbuilder 4.7 trial, the ide generated the ajax bridge html&js code for me, but when i browsing it in my safari 6.0, there is no effect.
after a long time debuging, i added a try-catch in the js file auto-generated by flashbuilder:
function ex3_07_solutionReady() {
// Initialize the "root" object. This represents the actual
// "ex3_07_solution.mxml" flex application.
try {
b_ex3_07_solution_root = FABridge["b_ex3_07_solution"].root();
} catch(e) {
alert(e);
and i got this error message:
TypeError: 'undefined' is not a function (evaluating 'this.target.getRoot()')
Does anyone have this problem?? I need all your help!Flash Builder 4.7 on OSX requires Java version 1.6. Mavericks comes with Java version 1.7, so you'll need to install the older version.
You may also want to bump the specs in the "Adobe FlashBuilder 4.7.ini" file.
More information in this thread.
http://forum.starling-framework.org/topic/flash-builder-47-crashes-on-mavericks -
Retrieving the COM class factory error-80070005
Hai,
I created web application in that I connected to company and used SBO Com license bridge ie., Gethardwarekey() . It works fine in our place. When it is launched it shows following error.
Retrieving the COM class factory for component with CLSID {80D2BE0E-15FF-4793-A4DE-0C053B194D0A} failed due to the following error: 80070005
I have set enable 32 bit as true.
Any help is appreciated.
Thanks in advance.Friend you solved it? please share the solution
many Thanks -
Flex-Ajax Bridge general availability
We have an Ajax application; we have new requirements to
display graphs that update dynamically every couple of seconds, we
found Flex and Flex-Ajax Bridge very helpful.
But I believe the Flex-Ajax Bridge has not been completely
tested and it is only in a pre-alpha stage.
What is the roadmap for Flex-Ajax Bridge? When will it be
fully tested/supported?Hi,
this needs clarification:
FABridge:
http://livedocs.adobe.com/flex/3/html/help.html?content=ajaxbridge_1.html
is *client* side library - it allows ActionScript engine communication with JavaScript engine (two-way) to enrich client side epxerience.
The Flex/Struts is client/server integration and yes, there are existing solution I think (note: I'm not web-tier coder), see:
http://www.adobe.com/devnet/flex/articles/flex_struts.html
http://code.google.com/p/fxstruts/
above seems quite dated - but it at least shows possibilities I think.
regards,
Peter -
Adobe Flex & AJAX bridge & ExtJS
I have similar problem as the follow post: anyone has solution?
http://forums.adobe.com/message/2568496Problem solved!!!
The cause was Ext panel moving around Flex <object> when rendering itself during init phase in JavaScript. That caused Flex Ajax Bridge to lose its connectivity with the object. Changed object creation into lazy one (after eveything was moved around) and works ok. -
Previewing an image before uploading it using the FileReference class
Previewing an image before uploading it using the FileReference class in flash player 3 not in SDK4
Previewing an image before uploading it using the FileReference class in flash player 3 not in SDK4
-
Previewing an image before uploading it using the FileReference class in flex 3
Previewing an image before uploading it using the FileReference class in flex 3 ?
hai,
when this code is used in my application ,i got the name of image and new frame is added each time .But image is not displayed.....
The code starts like this
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" initialize="init()" backgroundColor="white" width="100%" height="100%">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.messaging.Channel;
import mx.messaging.ChannelSet;
import mx.messaging.channels.AMFChannel;
import mx.rpc.events.ResultEvent;
import mx.controls.Image;
import spark.events.IndexChangeEvent;
import mx.managers.DragManager;
<mx:DataGridColumn headerText="Dimension Value" width="10" dataField="dimensionValue"/>
<mx:DataGridColumn headerText="Unit Nmae" width="10" dataField="dimensionUnitName"/>
</mx:columns>
</mx:DataGrid>
<mx:Spacer width="2%"/>
</mx:HDividedBox>
</mx:VBox>
<mx:Spacer height="0"/>
<mx:VBox width="100%">
<s:HGroup height="90" top="0" left="0" right="0" verticalAlign="justify" gap="10" paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5">
<s:Button id="btn_loader" top="5" bottom="24" width="100" label="load" click="loadImages()"/>
<s:Group width="100%">
<s:Group name="cl" top="0" left="0" bottom="0" width="20" mouseOver="//scroll_on(event)" mouseOut="//scroll_off(event)">
<s:BitmapImage source="@Embed('../assets/left.jpg')" top="0" left="0" bottom="0" right="0" fillMode="scale"/>
</s:Group>
<s:List id="imgList" skinClass="skins.ListSkin" top="-3" left="27" right="28" bottom="10"
dataProvider="{ImageCollection}" itemRenderer="Image_Render">
<s:layout>
<s:HorizontalLayout gap="0"/>
</s:layout>
</s:List>
<s:Group name="cr" top="0" right="0" bottom="0" width="20" mouseOver="//scroll_on(event)" mouseOut="//scroll_off(event)">
<s:BitmapImage source="@Embed('../assets/right.jpg')" top="-1" left="0" bottom="0" right="0" fillMode="scale"/>
</s:Group>
</s:Group>
</s:HGroup>
<s:SkinnableContainer id="dropCanvas" top="100" left="5" right="5" bottom="5" backgroundAlpha="1.0" alpha="1.0"
dragEnter="dropCanvas_dragEnterHandler(event)"
dragDrop="dropCanvas_dragDropHandler(event)" contentBackgroundColor="#914E4E" backgroundColor="#F7F7F7">
</s:SkinnableContainer>
</mx:VBox>
<mx:Spacer height="5"/>
</mx:VDividedBox>
</mx:Panel>
</mx:Canvas> -
Get the values from the bean class?
Hi Praveen and all can u please suggest in this,
I have developped an application In that Create One java class that Extends PageProcesscomponenet and utilizing the Bean That have the Connetion method and retriving the query Based on the Logon customer and spoof customer.
this functionality I have developped in Pageprocessor component.
The same functinality I am utilizing another java Class that Extends AbstractPortalcomponent and utilizing the same Bean.
But the problem both java classes for I used one Jsp only Dynmic spoof customer will come from the JSP Input filed.
In the new Java Class How can I capture the Event When I click the Buttong the InputField value capturing into the AbstractPortalcomponent Class.
I tried like this but It comes as Null Value.
Event event = myContext.getCurrentEvent();
if(event!=null)
InputField ip= (InputField) myContext.getComponentForId("spoofCust");
String spoofCust=ip.getValue().toString();
Please suggest me in this.
What is wrong with this.
Thanks,
Lohi.
Message was edited by:
Lohitha MLohitha,
Try replacing your two lines of code:
InputField ip= (InputField) myContext.getComponentForId("spoofCust");
String spoofCust=ip.getValue().toString();
with:
InputField ip = (InputField) getComponentByName("spoofCust");
String spoofCust = ip.getValueAsDataType().toString();
Let me know how that works for you.
-John -
Trying to create a Photomerge in Bridge, when the files open in Photoshop ( small jegs ) , I get a error message of " Unable to process latte files " / " null is not an object "
Please helpWait a second, Photoshop can make lattes now? Personally I prefer my coffee black, but man have I been under-utilizing this program.
Maybe you are looking for
-
Replication of Customer master data from R/3 to CRM.
Dear Friends, If i want to replicate customer from R/3 to CRM what are the prerequisites and how to execute a campaign for the replicated BP's(target groups).What is the load object that we use in R3AS. REgards, Prabhu.
-
HELP!!! AE3000 Adapter Not Working With Windows 7
Hello, I have a Gateway desktop with Windows 7 installed on it. I recently bought the Linksys AE3000 adapter to get internet for it, but whenever I plug it in, the light doesn't come on or anything. I tried the CD as well and it says that the adapter
-
Can't drag images into "album" on iWeb gallery
I use iWeb 08 I am able to drag individual images to the page but I cannot seem to drag albums, multiple images to the "drag albums here" section. I drag them and there is a green "plus" sign but the page/ "drag albums here" space doesn't accept the
-
Powershell read CSV file line by line and only first header
I have a CSV file, which reads like this: read, book read1, book1 read2, book2 I want to read only the first value, before comma one line at time, meaning first time it will be read read1 read2 no headers and i want to pass that value to a variable f
-
Does my iMac have DVD burning capability?
I recently bought an external HP dvd1270e only to find out it won't run unless I go out and spend a bunch for Windows 7 or some version, got me thinking whether my internal is already set up to burn. Any help would be greatly appreciated, I'm fairly