Flex_and_Flash

50 %
50 %
Information about Flex_and_Flash
Education

Published on September 20, 2007

Author: Rajinder

Source: authorstream.com

Flex and Flash:Are Two Heads Better Than One? : Flex and Flash:Are Two Heads Better Than One? Speaker Information : Speaker Information Windows-based Developer - Since ‘85 Senior ColdFusion MX Developer - Since ‘99 Technical Instructor - Since ‘85 Flash Developer - Since ’99 Flex Developer – Since ’05 theo@teratech.com http://therush.wordpress.com Presentation Agenda : Presentation Agenda Advantages of Flash and Flex Flash and Flex Audience Producing the Same Results (kinda) Everything Old is New Again Using LocalConnection Using ExternalInterface Other Considerations AdvantagesFlash : AdvantagesFlash Longevity Thousands of Flash related resources Thousands of community created components and samples Great authoring tool for designers Visual drawing environment AdvantagesFlex : AdvantagesFlex Improved ASv3 architecture Improved components Developer-centric Eclipse based development environment Predefined effects and transitions The Flash Audience : The Flash Audience Timelines Layers Stage Canvas MovieClip Designer The Flex Audience : The Flex Audience Actionscript Tags Data Services Perspectives Source View Developer Working Together : Working Together Producing the Same Results (kinda) : Producing the Same Results (kinda) Version 9 only Version 8 and below In the “Bad Ol’e Days” … : In the “Bad Ol’e Days” … Used getUrl() and fscommand() to communicate from Flash to JavaScript. Used setVariable() to communicate from JavaScript to Flash. fscommand() used VBScript that could conflict with other VBScript on the page and can only pass one string parameter. Everything Old is New Again : Everything Old is New Again LocalConnection ExternalInterface Invoke methods between Flash apps/movies Pass data between Flash apps/movies Using LocalConnectionWhy use LocalConnection? : Using LocalConnectionWhy use LocalConnection? Supported by Flash Player version 6 and above Uses a one-way “Channel” to communicate Supports asynchronous communication Pass multiple variables Using LocalConnectionHow does it work? Step 1 : Using LocalConnectionHow does it work? Step 1 SENDER: Create a new LocalConnection object (1) Use send() method of the localconnection object (2) 1) myLC:LocalConnection = new LocalConnection(); 2) myLC.send(swf1, myName, name_txt.text); Using LocalConnectionHow does it work? Step 2 : Using LocalConnectionHow does it work? Step 2 RECIEVER: Create a new LocalConnection object (1) Prepare to receive commands (2) Define function that will be called by SENDER (3) 1) myLC:LocalConnection = new LocalConnection(); 2) myLC.connect(swf1); 3) myLC.myName = function(param) { reciever_txt.text = param; } Using LocalConnectionHow does it work? : Using LocalConnectionHow does it work? setClock clockStopped Provides direct one-way communication between swfs Using LocalConnectionCan you show us an example? : Using LocalConnectionCan you show us an example? The Resort Tracker 2000 v.5 Using ExteranalInterfaceWhy use ExternalInterface? : Using ExteranalInterfaceWhy use ExternalInterface? Supports synchronous communication Easier to implement Uses JavaScript as a “proxy” between Pass multiple variables Supports multiple data types Note: Only supported by Flash Player version 8 above Using ExternalInterfaceHow does this work? Step 1 : Using ExternalInterfaceHow does this work? Step 1 SEND TO JS: Import ExternalInterface class Use call() method of ExternalInterface object Import flash.external.ExternalInterface ExternalInterface .call(“alert”, “Hello from Flash”); Using ExternalInterfaceHow does this work? Step 2 : Using ExternalInterfaceHow does this work? Step 2 RECIEVE FROM JS: Import ExternalInterface class Use addCallBack() method of ExternalInterface object Import flash.external.ExternalInterface ExternalInterface.addCallBack(“tweenMe”, this, tweenMe); Using ExternalInterfaceHow does this work? Step 3 : Using ExternalInterfaceHow does this work? Step 3 SEND TO FLASH: Get reference to Flash object Use object reference to call Flash function // for IE use myFlash = window[“flashmovie”]; // otherwise use myFlash = document[“flashmovie”]; myFlash.tweenMe(“Hello from JS”) Using ExternalInterfaceHow does this work? : Using ExternalInterfaceHow does this work? setClock clockStopped Using ExternalInterface Got another example? : Using ExternalInterface Got another example? The African Country Guide ver .5 Other Considerations : Other Considerations Flash 8 Security Model Frame Rate Other ConsiderationsFlash 8 Security Model : Other ConsiderationsFlash 8 Security Model By default, local SWFs can no longer contact the Internet, perform HTTP communication, or communicate with local HTML files. SWF and HTML content from non-local URLs may no longer load any content (SWF, HTML, PNG, and so on) from local paths. Use localConnection.allowDomain to permit cross-domain scripting. Use a crossdomain.xml policy file to permit cross-scripting operations. Other ConsiderationsFlash 8 Security Model (cont.) : Other ConsiderationsFlash 8 Security Model (cont.) Use allowScriptAccess to handle communication with Javascript. allowScriptAccess Never: outbound scripting fails Always: outbound scripting succeeds (default) sameDomain: outbound scripting allowed only if swf resides in same domain (default in FP 8+) Other ConsiderationsFrame Rate : Other ConsiderationsFrame Rate Flex’s default frame rate is 24 Adjust your Flash movie accordingly You can reset the default Flex frame rate Open Project Properties >> Flex Compiler Add the following into "Additional compiler arguments:" in single line: -default-frame-rate int Note: The maximum frame rate is limited to machine performance, if this value is set too high the player will simply run at the fastest rate that it can on the given machine. Additional Resources : Additional Resources http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16243 http://livedocs.macromedia.com/flex/2/langref/flash/net/LocalConnection.html http://www.adobe.com/devnet/flash/articles/external_interface_05.html http://livedocs.macromedia.com/flex/2/langref/flash/external/ExternalInterface.html http://therush.wordpress.com Additional Resources : Additional Resources Flash / JavaScript Integration Kit (Beta) http://weblogs.macromedia.com/flashjavascript/ Flex-Ajax Bridge http://labs.adobe.com/wiki/index.php/Flex_Framework:FABridge

Add a comment

Related presentations

Related pages

Apache Flex - Wikipedia, the free encyclopedia

Apache Flex; Developer(s) Apache Software Foundation and Adobe Systems: Initial release: June 20, 2004: Stable release: 4.15.0 / January 11, 2016; 60 days ...
Read more

Free, open-source framework | Adobe Flex

Adobe Flex is a free, open-source framework for building mobile, web, and desktop applications that share a common codebase, reducing time and cost of ...
Read more

Adobe Flash Builder 4.7 Premium

Use Flex and Flash Builder with... Java ...
Read more

Flex And Flash | LinkedIn

View 3997 Flex And Flash posts, presentations, experts, and more. Get the professional knowledge you need on LinkedIn.
Read more

Build iOS Applications using Flex and Flash Builder 4.5 ...

Developer Evangelist Serge Jespers explains how you can build iOS applications using new capabilities in Flex and Flash Builder 4.5.
Read more

Flex And Flash - manoftoday - Manoftoday Wiki Start ...

Flex And Flash fold unfold. Table of Contents. REST. http://www.infoq.com/news/2008/01/gosling-on-flash. xml ...
Read more

Flex and Flash Builder 4.6 and pre-release

Flex and Flash Builder 4.6 and pre-release. Today we are pleased to announce Flex SDK and Flash Builder 4.6, the next major step in cross-platform mobile ...
Read more

Adobe Flex 4.6 * Deploy an application on a mobile device

Home / Developing Mobile Applications with Flex and Flash Builder 4.6 / Deploy. ... On an iOS device, you deploy and install an application (IPA file) ...
Read more

Adobe Flex 4.6 * Getting started with mobile applications

Home / Developing Mobile Applications with Flex and Flash Builder 4.6 / Getting started. Getting started with mobile applications. Design a mobile application.
Read more