• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

flex 4

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Will/can one use flex objects in a web page like one can use a dojo widget. Like just using a flex datagrid embedded on a web page and having the ability to communicate with it via javascript?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes and no. You can embed Flash applications in web pages, and Flex provides a mechanism (ExternalInterface) to interface with JavaScript running in the host page. But you can't embed the component directly, you need to embed an Application (though there is nothing to prevent the application just containug a DataGrid).

(NB: please UseAMeaningfulSubjectLine when posting)
 
author
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your DataGrid would be compiled to a SWF which would then be embedded via the html object tag. You can then use the ExternalInterface API (part of AS3) to communicate with javascript. Using this method, you can make direct calls to your JS methods, passing arguments, and assign callback functions. This is a bi-directional relationship that is initialized at runtime as well. In other words, the communication does not have to be initiated by Flex (the SWF). Its actually quite easy when you realize its just like one object talking to another, but each with their own API. Hope this makes sense.
 
author
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jp roberts wrote:Will/can one use flex objects in a web page like one can use a dojo widget. Like just using a flex datagrid embedded on a web page and having the ability to communicate with it via javascript?



One thing about Flex is the size of the framework in the embedded swfs. It is rather large. However, Adobe provides the framework in signed runtime-shared-libraries (RSL) that are cached by the Flash Player. This means that if the visitor has already cached the RSLs then they don't need to retrieve the framework. It makes your SWFs acceptable in terms of size. As Dan says, communicating with the SWF via the ExternalInterface is really easy. The SWF object is a first-class JavaScript citizen. You can do some really cool things this way.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic