SlideShare uma empresa Scribd logo
1 de 22
Flex with Rest and Optimazation MyLabs Flex with Rest and Optimazation
Ways between AJAX and Flex using the flashVars properties,  querying string parameters,  using the navigateToURL() method using the ExternalInterface class
Using FlashVar Property ,[object Object],[object Object]
Using FlashVar Property <html> <head> <title>/flex2/code/wrapper/SimplestFlashVarTestWrapper.html</title> <style> body { margin: 0px; overflow:hidden } </style> </head> <body scroll='no'> <table width='100%' height='100%' cellspacing='0' cellpadding='0'><tr><td valign='top'> <h1>Simplest FlashVarTest Wrapper</h1> <object id='mySwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'    codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab' height='100%' width='100%'> <param name='src' value='FlashVarTest.swf'/> <param name='flashVars' value='firstName=Nick&lastName=Danger'/> <embed name='mySwf' src='FlashVarTest.swf' pluginspage='http://www.adobe.com/go/getflashplayer' height='100%'  width='100%' flashVars='firstName=Nick&lastName=Danger'/> </object> </td></tr></table> </body> </html>
Using URL fragments  ,[object Object],[object Object],[object Object]
Using URL fragments  <mx:Script> <![CDATA[ import mx.managers.BrowserManager; import mx.managers.IBrowserManager; import mx.utils.URLUtil; private var bm:IBrowserManager; [Bindable] private var fName:String; [Bindable] private var lName:String;  private function init(e:Event):void { bm = BrowserManager.getInstance();  bm.init(&quot;&quot;, &quot;Welcome!&quot;); /* The following code will parse a URL that passes firstName and lastName as query string parameters after the &quot;#&quot; sign; for example: http://www.mydomain.com/MyApp.html#firstName=Nick&lastName=Danger */ var o:Object = URLUtil.stringToObject(bm.fragment, &quot;&&quot;);  fName = o.firstName; lName = o.lastName;  } ]]> </mx:Script>
Using the  navigateToURL () method ,[object Object],<?xml version=&quot;1.0&quot;?> <mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;> <mx:Script><![CDATA[ import flash.net.*; public function executeSearch(event:MouseEvent):void { var u:URLRequest = new URLRequest(&quot;http://www.google.com/search?hl=en&q=&quot; + ta1.text); navigateToURL(u,&quot;_blank&quot;); } ]]></mx:Script> <mx:TextArea id=&quot;ta1&quot;/> <mx:Button label=&quot;Search&quot; click=&quot;executeSearch(event)&quot;/> </mx:Application>
Using the navigateToURL() method ,[object Object],/ /in Flex  var u:URLRequest = new URLRequest(&quot; javascript:catchClick ('&quot;+ eName + &quot;','&quot; + eType +&quot;')&quot;); navigateToURL(u,&quot;_self&quot;); //On the HTML page <SCRIPT LANGUAGE=&quot;JavaScript&quot;> function catchClick(name, type) { alert(name + &quot; triggered the &quot; + type + &quot; event.&quot;); } </SCRIPT>
Using the ExternalInterface API  ,[object Object],[object Object],[object Object],[object Object]
Using the ExternalInterface API  Access javascript from flex <![CDATA[ import mx.controls.Alert; private function init():void { var userAgent:String = ExternalInterface.call(&quot;navigator.userAgent.toString&quot;); Alert.show(userAgent, &quot;navigator.userAgent:&quot;); } ]]> </mx:Script> <mx:ApplicationControlBar dock=&quot;true&quot;> <mx:Button label=&quot;Display user agent&quot; click=&quot;init();&quot; /> </mx:ApplicationControlBar>
Using the ExternalInterface API  Access flex from javascript public function myFunc(s:String):void { // whatever you want} public function initApp():void { ExternalInterface.addCallback(&quot;myFlexFunction&quot;,myFunc); }  <SCRIPT LANGUAGE=&quot;JavaScript&quot;> function callApp() { window.document.title = document.getElementById(&quot;newTitle&quot;).value; mySwf.myFlexFunction(window.document.title); } </SCRIPT>
ExternalInterface API security ,[object Object],[object Object],[object Object],<object id=‘myName' classid=' clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab'  allowScriptAccess='always'   height='100%' width='100%'>
The Flex AJAX Bridge ,[object Object],[object Object],[object Object]
When to use the Flex AJAX Bridge ,[object Object],[object Object],[object Object]
Optimization ,[object Object],[object Object]
Framework Optimization ,[object Object],[object Object],[object Object]
[object Object],Object creation Measurement/Layout  Rendering
Optimizing Actionscript: Object Creation ,[object Object],[object Object],[object Object],[object Object]
Optimizing Actionscript: Object Creation Solution #2: Ordered Creation During startup, stagger creation of objects <mx:Application> <mx:Panel width=&quot;250&quot; height=&quot;100&quot;  creationPolicy=“queued”  /> <mx:Label text=&quot;One&quot; /> </mx:Panel> <mx:Panel width=&quot;250&quot; height=&quot;100&quot;  creationPolicy=“queued”  /> <mx:Label text=&quot;Two&quot; /> </mx:Panel> </mx:Application>
Measurement/Layout: Definition The process of assigning a position and size to every component <mx:Application>   <mx:HBox>   <mx:Button label=“1”/>   <mx:Button label=“2”/>   </mx:HBox>   <mx:TextArea width=“100%” height=“100%” text=“Text”/>  </mx:Application>
Solution #1: Reduce Container Nesting ,[object Object],[object Object],[object Object],[object Object],[object Object]
Useful Links ,[object Object]

Mais conteúdo relacionado

Mais procurados

ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performancerudib
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCLearnNowOnline
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran TochAdil Jafri
 
ASP.NET AJAX Basics
ASP.NET AJAX BasicsASP.NET AJAX Basics
ASP.NET AJAX Basicspetrov
 
ASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsRandy Connolly
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Jonas Follesø
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsWebStackAcademy
 
Introduction To Asp.Net Ajax
Introduction To Asp.Net AjaxIntroduction To Asp.Net Ajax
Introduction To Asp.Net AjaxJeff Blankenburg
 
Your First ASP_Net project part 1
Your First ASP_Net project part 1Your First ASP_Net project part 1
Your First ASP_Net project part 1Biswadip Goswami
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.netSireesh K
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsRandy Connolly
 
Flutter State Management Using GetX.pdf
Flutter State Management Using GetX.pdfFlutter State Management Using GetX.pdf
Flutter State Management Using GetX.pdfKaty Slemon
 
Entity frameworks101
Entity frameworks101Entity frameworks101
Entity frameworks101Rich Helton
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.jsDev_Events
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web FormsSAMIR BHOGAYTA
 

Mais procurados (20)

Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAX
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
 
ASP.NET AJAX Basics
ASP.NET AJAX BasicsASP.NET AJAX Basics
ASP.NET AJAX Basics
 
ASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation Controls
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
 
Introduction To Asp.Net Ajax
Introduction To Asp.Net AjaxIntroduction To Asp.Net Ajax
Introduction To Asp.Net Ajax
 
Your First ASP_Net project part 1
Your First ASP_Net project part 1Your First ASP_Net project part 1
Your First ASP_Net project part 1
 
Ajax & ASP.NET 2
Ajax & ASP.NET 2Ajax & ASP.NET 2
Ajax & ASP.NET 2
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.net
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
 
Flutter State Management Using GetX.pdf
Flutter State Management Using GetX.pdfFlutter State Management Using GetX.pdf
Flutter State Management Using GetX.pdf
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Entity frameworks101
Entity frameworks101Entity frameworks101
Entity frameworks101
 
A View about ASP .NET and their objectives
A View about ASP .NET and their objectivesA View about ASP .NET and their objectives
A View about ASP .NET and their objectives
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.js
 
MVC Training Part 2
MVC Training Part 2MVC Training Part 2
MVC Training Part 2
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
 

Destaque

An Apocalypse of Ice; chapter 7
An Apocalypse of Ice; chapter 7An Apocalypse of Ice; chapter 7
An Apocalypse of Ice; chapter 7cobaltazure
 
Apocalypse of Ice Chapter 12 Part 1
Apocalypse of Ice Chapter 12 Part 1Apocalypse of Ice Chapter 12 Part 1
Apocalypse of Ice Chapter 12 Part 1cobaltazure
 
Share Vision First Trip
Share Vision First TripShare Vision First Trip
Share Vision First TripKhou Suylong
 
TDD sharevison team
TDD sharevison teamTDD sharevison team
TDD sharevison teamKhou Suylong
 
An Apocalypse of Ice; chapter 3
An Apocalypse of Ice; chapter 3An Apocalypse of Ice; chapter 3
An Apocalypse of Ice; chapter 3cobaltazure
 

Destaque (8)

Will bc day3
Will bc day3Will bc day3
Will bc day3
 
An Apocalypse of Ice; chapter 7
An Apocalypse of Ice; chapter 7An Apocalypse of Ice; chapter 7
An Apocalypse of Ice; chapter 7
 
Aao ichapter11
Aao ichapter11Aao ichapter11
Aao ichapter11
 
Apocalypse of Ice Chapter 12 Part 1
Apocalypse of Ice Chapter 12 Part 1Apocalypse of Ice Chapter 12 Part 1
Apocalypse of Ice Chapter 12 Part 1
 
Clean code
Clean codeClean code
Clean code
 
Share Vision First Trip
Share Vision First TripShare Vision First Trip
Share Vision First Trip
 
TDD sharevison team
TDD sharevison teamTDD sharevison team
TDD sharevison team
 
An Apocalypse of Ice; chapter 3
An Apocalypse of Ice; chapter 3An Apocalypse of Ice; chapter 3
An Apocalypse of Ice; chapter 3
 

Semelhante a Flex_rest_optimization

Flex In Portal Final
Flex In Portal   FinalFlex In Portal   Final
Flex In Portal FinalSunil Patil
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformAlfresco Software
 
Introduction To Flex
Introduction To FlexIntroduction To Flex
Introduction To FlexYoss Cohen
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009marpierc
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsRicardo Varela
 
Expanding a tree node
Expanding a tree nodeExpanding a tree node
Expanding a tree nodeHemakumar.S
 
SgCodeJam24 Workshop Extract
SgCodeJam24 Workshop ExtractSgCodeJam24 Workshop Extract
SgCodeJam24 Workshop Extractremko caprio
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flexJoseph Khan
 
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...marcocasario
 
Better Adobe Flex and AIR applications with AJAX
Better Adobe Flex and AIR applications with AJAXBetter Adobe Flex and AIR applications with AJAX
Better Adobe Flex and AIR applications with AJAXguestdb10f0
 
HTML5 - Future of Web
HTML5 - Future of WebHTML5 - Future of Web
HTML5 - Future of WebMirza Asif
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2Hugo Hamon
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 

Semelhante a Flex_rest_optimization (20)

Flex In Portal Final
Flex In Portal   FinalFlex In Portal   Final
Flex In Portal Final
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 
HTML5
HTML5HTML5
HTML5
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf Platform
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
Introduction To Flex
Introduction To FlexIntroduction To Flex
Introduction To Flex
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009
 
Adobe Flex
Adobe FlexAdobe Flex
Adobe Flex
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile Widgets
 
Expanding a tree node
Expanding a tree nodeExpanding a tree node
Expanding a tree node
 
SgCodeJam24 Workshop Extract
SgCodeJam24 Workshop ExtractSgCodeJam24 Workshop Extract
SgCodeJam24 Workshop Extract
 
How To Flex - Fondamentali
How To Flex - FondamentaliHow To Flex - Fondamentali
How To Flex - Fondamentali
 
Adobe Flex
Adobe FlexAdobe Flex
Adobe Flex
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flex
 
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
 
Ajax
AjaxAjax
Ajax
 
Better Adobe Flex and AIR applications with AJAX
Better Adobe Flex and AIR applications with AJAXBetter Adobe Flex and AIR applications with AJAX
Better Adobe Flex and AIR applications with AJAX
 
HTML5 - Future of Web
HTML5 - Future of WebHTML5 - Future of Web
HTML5 - Future of Web
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Flex_rest_optimization

  • 1. Flex with Rest and Optimazation MyLabs Flex with Rest and Optimazation
  • 2. Ways between AJAX and Flex using the flashVars properties, querying string parameters, using the navigateToURL() method using the ExternalInterface class
  • 3.
  • 4. Using FlashVar Property <html> <head> <title>/flex2/code/wrapper/SimplestFlashVarTestWrapper.html</title> <style> body { margin: 0px; overflow:hidden } </style> </head> <body scroll='no'> <table width='100%' height='100%' cellspacing='0' cellpadding='0'><tr><td valign='top'> <h1>Simplest FlashVarTest Wrapper</h1> <object id='mySwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab' height='100%' width='100%'> <param name='src' value='FlashVarTest.swf'/> <param name='flashVars' value='firstName=Nick&lastName=Danger'/> <embed name='mySwf' src='FlashVarTest.swf' pluginspage='http://www.adobe.com/go/getflashplayer' height='100%' width='100%' flashVars='firstName=Nick&lastName=Danger'/> </object> </td></tr></table> </body> </html>
  • 5.
  • 6. Using URL fragments <mx:Script> <![CDATA[ import mx.managers.BrowserManager; import mx.managers.IBrowserManager; import mx.utils.URLUtil; private var bm:IBrowserManager; [Bindable] private var fName:String; [Bindable] private var lName:String; private function init(e:Event):void { bm = BrowserManager.getInstance(); bm.init(&quot;&quot;, &quot;Welcome!&quot;); /* The following code will parse a URL that passes firstName and lastName as query string parameters after the &quot;#&quot; sign; for example: http://www.mydomain.com/MyApp.html#firstName=Nick&lastName=Danger */ var o:Object = URLUtil.stringToObject(bm.fragment, &quot;&&quot;); fName = o.firstName; lName = o.lastName; } ]]> </mx:Script>
  • 7.
  • 8.
  • 9.
  • 10. Using the ExternalInterface API Access javascript from flex <![CDATA[ import mx.controls.Alert; private function init():void { var userAgent:String = ExternalInterface.call(&quot;navigator.userAgent.toString&quot;); Alert.show(userAgent, &quot;navigator.userAgent:&quot;); } ]]> </mx:Script> <mx:ApplicationControlBar dock=&quot;true&quot;> <mx:Button label=&quot;Display user agent&quot; click=&quot;init();&quot; /> </mx:ApplicationControlBar>
  • 11. Using the ExternalInterface API Access flex from javascript public function myFunc(s:String):void { // whatever you want} public function initApp():void { ExternalInterface.addCallback(&quot;myFlexFunction&quot;,myFunc); } <SCRIPT LANGUAGE=&quot;JavaScript&quot;> function callApp() { window.document.title = document.getElementById(&quot;newTitle&quot;).value; mySwf.myFlexFunction(window.document.title); } </SCRIPT>
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Optimizing Actionscript: Object Creation Solution #2: Ordered Creation During startup, stagger creation of objects <mx:Application> <mx:Panel width=&quot;250&quot; height=&quot;100&quot; creationPolicy=“queued” /> <mx:Label text=&quot;One&quot; /> </mx:Panel> <mx:Panel width=&quot;250&quot; height=&quot;100&quot; creationPolicy=“queued” /> <mx:Label text=&quot;Two&quot; /> </mx:Panel> </mx:Application>
  • 20. Measurement/Layout: Definition The process of assigning a position and size to every component <mx:Application> <mx:HBox> <mx:Button label=“1”/> <mx:Button label=“2”/> </mx:HBox> <mx:TextArea width=“100%” height=“100%” text=“Text”/> </mx:Application>
  • 21.
  • 22.