A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11255 Flash Movies | 9 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Knife Butterfly
» Title: SkullCandle
» Description: Simple Skull with a candle burning on it.
» More by Knife Butterfly


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 6392 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Cesar Kobashikawa - online portfolio
» Comments: Cesar Kobashikawa's Portfolio


Random Links | Add your own Flash Related Links
Flash Tutorials 1201 Tutorials 7 New Tutorials Added!
What's New | Top100

» FLV Converter for Mac
» After Effects Quality Effect using AS3
» FLV to 3GP: Convert video files from FLV (Flash Video) to 3GP for Mac
» create Christmas business flash presentation with hyperlinks
» Let Photos Show Your Happy Family this Christmas and Upload YouTube
» PowerPoint show to DVD slide show--- PPS to DVD
» How to burn FLV to DVD for Mac
» How to Create Christmas Flash Greeting Ecard with photos and music
» Getting Started In Flash
» Unknown Tag: Title10
Random Tutorial | Add Site

bbm.netBBM.net is designed to save you time and deliver the highest quality royalty-free music for your multimedia projects. Features include: over 450 Music Loop Packages from some of the best composers in the business, our music search engine to speed your selection process, alternate music versions & bonus sounds to use for rollovers or transitions, free technical support and free consulting.

Click here for details »

Web Page Production
Aquent
US-MD-Owings Mills

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Dynamic_Content

Categories Proxy Scripting in Flash - Loading External Data
Author: Jeffrey F. Hill | Website: http://www.flash-db.com |

 
Page 1
1 2 3 4 next»


Introduction

One of the greatest things about the internet is the wealth of free information and content available. Their are thousands of websites that allow you to use content from their websites and databases - and display it on yours. Some examples of this are stock quotes, Weather data, News stories, Search engine results, Auction listings, etc - the list goes on and on. Another important aspect of the internet are application service providers, some examples of these services could include CRM's (customer relationship management), Info sharing, sales tracking, e-business, Human resource's, desktop applications, etc - the list again goes on and on.

What do all of these have in Common? - All this data and all these services are not accessible directly by your Flash Movie. What if you wanted to include constantly changing and updated weather reports from noaa - or stock quotes from Yahoo financial - or News feeds from Moreover - or send a new Lead to a CRM service - or send payment information to Authorize.net for processing - or send and retrieve data from a database not located on your server. Well this tutorial goes into one method which allows you to do all of this in Flash - with the User Never leaving your Site!

Recommended reading: "For security reasons, a Flash movie playing in a Web browser is not allowed to access data that resides outside the Web domain from which the SWF originated." - http://www.macromedia.com/support/flash/ts/documents/loadvars_security.htm

Macromedia suggests two solutions or work arounds to this security feature, the first one is Proxy scripting the second involves DNS aliasing. This article/tutorial will go over two examples of Proxy Scripting and how it can be used to create a more diverse and changing Flash movie/experience. I also put together an example of a search engine for a visual example of what this is all about. The search engine is based on Yahoo, but with the results of the search query sent from and displayed in Flash (included in the download) - For a working version/example of the search engine visit - http://www.flash-db.com/Search/. This is just one of many useful applications of this article. Their is also an example of using this method with moreover news at www.flash-db.com/News/.

This tutorial is not for everyone and it will not be possible for everyone to use this. 1) Since a server side script is needed, this script must be run on a server. 2) Some servers do not allow outgoing connections, if your server has this restriction then it will not be possible to run this script. (Some free and really large inexpensive commercial hosting companies will have this restriction due to their firewall settings). 3) These scripts are not needed with Stand-Alone (exe) flash presentations - this is only needed for SWF files embedded in a Browser on the internet.

Overview

First it's necessary to define two types of Data/Content that we will be accessing. 1) Static - this involves web pages that are not changing and are not based on information (query terms) that are passed to them. Examples of this would be Text files, HTML pages, and XML content - that reside on a server/domain outside of your own. 2) Dynamic - this involves web pages, database's, and other scripts that look up or perform queries based on the information you send to them.

Static: Loading static content/data from other servers is easier then loading dynamic content. This is because you will not have to build a request method such as "GET" or "POST". This is just fetching or grabbing static content from else where on the web and bringing it back to your flash movie. An example. If you wanted to you could also return Images, SWF's, mp3's, movies etc with this method - although since LoadMovie does not have this restriction their would be no sense in doing this with these types of files.

Dynamic: Dynamic content/data requires that a request be sent via "GET" or "POST". Then depending on the Data you send the page - it reacts and produces results based on your request Data. A good example of this is sending a Search engine a Search Term. If you wanted to search Google for "Flash" you would have to tell it to search for "Flash". Another example would be if you wanted to add a Sales Lead to a service that tracks this information for you. Or if you wanted to send Credit card info to a credit card transaction processor. Or maybe add information to a database on a different server. Basically any time you have to send information to get information in return.

Tying it together: Basic Flow of data: From Flash -> to the Script -> To the external source -> Back to the script -> Back to Flash. The hardest part of all of this (because most data is not returned in nicely formatted XML) is parsing and formatting the data that is returned from the external source to a format Flash can easily display. Easy returned formats to work with include CSV (comma seperated values) TSV (Tab seperated values) - and of course XML (which does not require any parsing since Flash can already read XML). A lot of times you'll have to work with complex HTML stuff coming back which is the hardest to format and parse for use in Flash. This is the real art behind all of this.

Thoughts: Macromedia added this security restriction (external data is not accessible) because Flash can Loop and no user action is needed to send out a request via "GET" or "POST". So at first you might think "Big deal" - but if you look at this further and keep in mind past DOS (denial of service) attacks, you'll see that Macromedia was right by adding this security feature and did so with good reason. What if someone put up hundreds/thousands of really simple Flash movies all over on free web servers that sent out hundreds/thousands/millions of requests to someone's database or site every second. This could become a problem and reduce the performance (or crash) the website that was being targeted. (This last paragraph is just an thought - and may or may not be plausible).

1 2 3 4 next»

» Level Advanced

Added: : 2002-04-05
Rating: 7.08 Votes: 27
Hits: 1736
» Author
Jeffrey Hill is a freelance web developer from Boulder, Colorado. He specializes in creating and developing dynamic database driven Flash content, applications, and content management systems. Specialty's include SQL, PHP, Perl, and XML.
» Download
Download the files used in this tutorial.
Download (18 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Symantec Whitepaper: Converging System and Data Protection for Complete Disaster Recovery
Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
  Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Symantec Whitepaper: Comprehensive Backup and Recovery of VMware Virtual Infrastructure
MORE WHITEPAPERS, EBOOKS, AND ARTICLES